diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5070640..4241f1a 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 248c4615-4118-44e3-9280-c0978ea11cf6 management: - docChecksum: a026d44cd257aabf336c5b32794f8274 + docChecksum: 9e89f4e0df39546add90b40ae6eac529 docVersion: v1 - speakeasyVersion: 1.456.0 - generationVersion: 2.481.0 - releaseVersion: 0.2.4 - configChecksum: b129f5eda208ed130bef4e9687189926 + speakeasyVersion: 1.473.0 + generationVersion: 2.495.0 + releaseVersion: 0.3.0 + configChecksum: c14f8f63ea342007562335282736245c repoURL: https://github.com/clerk/clerk-sdk-csharp.git published: true features: @@ -14,9 +14,9 @@ features: additionalDependencies: 0.1.0 additionalProperties: 0.0.1 constsAndDefaults: 0.0.1 - core: 3.10.9 + core: 3.10.11 deprecations: 2.81.2 - examples: 2.81.3 + examples: 2.81.5 flattening: 2.81.3 globalSecurity: 2.83.6 globalSecurityCallbacks: 0.1.0 @@ -24,7 +24,7 @@ features: globalServerURLs: 2.82.3 groups: 2.81.2 intellisenseMarkdownSupport: 0.1.0 - methodArguments: 0.1.0 + methodArguments: 0.2.0 nameOverrides: 2.81.2 nullables: 0.1.0 responseFormat: 0.0.4 @@ -32,7 +32,6 @@ features: unions: 0.2.2 generatedFiles: - .gitattributes - - CONTRIBUTING.md - Clerk.BackendAPI.sln - NUGET.md - USAGE.md @@ -72,9 +71,13 @@ generatedFiles: - docs/Models/Components/ErrorMeta.md - docs/Models/Components/ExternalAccount.md - docs/Models/Components/ExternalAccounts.md + - docs/Models/Components/FromOAuth.md + - docs/Models/Components/FromOAuthVerificationStatus.md - docs/Models/Components/HTTPMetadata.md - docs/Models/Components/IdentificationLink.md - docs/Models/Components/IdentifierType.md + - docs/Models/Components/Instance.md + - docs/Models/Components/InstanceObject.md - docs/Models/Components/InstanceRestrictions.md - docs/Models/Components/InstanceRestrictionsObject.md - docs/Models/Components/InstanceSettings.md @@ -87,6 +90,7 @@ generatedFiles: - docs/Models/Components/InvitationStatus.md - docs/Models/Components/JWTTemplate.md - docs/Models/Components/JWTTemplateObject.md + - docs/Models/Components/Jwks.md - docs/Models/Components/Keys.md - docs/Models/Components/LatestActivity.md - docs/Models/Components/Meta.md @@ -98,9 +102,6 @@ generatedFiles: - docs/Models/Components/OAuthApplications.md - docs/Models/Components/OTPVerificationStatus.md - docs/Models/Components/OTPVerificationStrategy.md - - docs/Models/Components/Oauth.md - - docs/Models/Components/OauthVerificationStatus.md - - docs/Models/Components/OauthVerificationStrategy.md - docs/Models/Components/Object.md - docs/Models/Components/Organization.md - docs/Models/Components/OrganizationDomain.md @@ -185,6 +186,13 @@ generatedFiles: - docs/Models/Components/VerificationStatus.md - docs/Models/Components/VerificationStrategy.md - docs/Models/Components/Verifications.md + - docs/Models/Components/WaitlistEntries.md + - docs/Models/Components/WaitlistEntry.md + - docs/Models/Components/WaitlistEntryInvitation.md + - docs/Models/Components/WaitlistEntryInvitationObject.md + - docs/Models/Components/WaitlistEntryInvitationStatus.md + - docs/Models/Components/WaitlistEntryObject.md + - docs/Models/Components/WaitlistEntryStatus.md - docs/Models/Components/Web3Signature.md - docs/Models/Components/Web3SignatureVerificationStatus.md - docs/Models/Components/Web3SignatureVerificationStrategy.md @@ -192,7 +200,6 @@ generatedFiles: - docs/Models/Components/Web3WalletObject.md - docs/Models/Components/Web3WalletVerification.md - docs/Models/Components/Web3WalletVerificationAdmin.md - - docs/Models/Components/WellKnownJWKS.md - docs/Models/Errors/ClerkErrors.md - docs/Models/Errors/Meta.md - docs/Models/Operations/Actor.md @@ -211,6 +218,7 @@ generatedFiles: - docs/Models/Operations/CreateAllowlistIdentifierResponse.md - docs/Models/Operations/CreateBlocklistIdentifierRequestBody.md - docs/Models/Operations/CreateBlocklistIdentifierResponse.md + - docs/Models/Operations/CreateBulkInvitationsResponse.md - docs/Models/Operations/CreateEmailAddressRequestBody.md - docs/Models/Operations/CreateEmailAddressResponse.md - docs/Models/Operations/CreateInvitationRequestBody.md @@ -223,6 +231,7 @@ generatedFiles: - docs/Models/Operations/CreateOrganizationDomainRequestBody.md - docs/Models/Operations/CreateOrganizationDomainResponse.md - docs/Models/Operations/CreateOrganizationInvitationBulkRequest.md + - docs/Models/Operations/CreateOrganizationInvitationBulkRequestBody.md - docs/Models/Operations/CreateOrganizationInvitationBulkResponse.md - docs/Models/Operations/CreateOrganizationInvitationRequest.md - docs/Models/Operations/CreateOrganizationInvitationRequestBody.md @@ -238,9 +247,17 @@ generatedFiles: - docs/Models/Operations/CreateRedirectURLResponse.md - docs/Models/Operations/CreateSAMLConnectionRequestBody.md - docs/Models/Operations/CreateSAMLConnectionResponse.md + - docs/Models/Operations/CreateSessionRequestBody.md + - docs/Models/Operations/CreateSessionResponse.md + - docs/Models/Operations/CreateSessionTokenFromTemplateObject.md - docs/Models/Operations/CreateSessionTokenFromTemplateRequest.md + - docs/Models/Operations/CreateSessionTokenFromTemplateRequestBody.md - docs/Models/Operations/CreateSessionTokenFromTemplateResponse.md - docs/Models/Operations/CreateSessionTokenFromTemplateResponseBody.md + - docs/Models/Operations/CreateSessionTokenRequest.md + - docs/Models/Operations/CreateSessionTokenRequestBody.md + - docs/Models/Operations/CreateSessionTokenResponse.md + - docs/Models/Operations/CreateSessionTokenResponseBody.md - docs/Models/Operations/CreateSignInTokenRequestBody.md - docs/Models/Operations/CreateSignInTokenResponse.md - docs/Models/Operations/CreateSvixAppResponse.md @@ -249,6 +266,8 @@ generatedFiles: - docs/Models/Operations/CreateUserResponse.md - docs/Models/Operations/CreateUserTOTPRequest.md - docs/Models/Operations/CreateUserTOTPResponse.md + - docs/Models/Operations/CreateWaitlistEntryRequestBody.md + - docs/Models/Operations/CreateWaitlistEntryResponse.md - docs/Models/Operations/DeleteAllowlistIdentifierRequest.md - docs/Models/Operations/DeleteAllowlistIdentifierResponse.md - docs/Models/Operations/DeleteBackupCodeRequest.md @@ -299,6 +318,7 @@ generatedFiles: - docs/Models/Operations/GetClientResponse.md - docs/Models/Operations/GetEmailAddressRequest.md - docs/Models/Operations/GetEmailAddressResponse.md + - docs/Models/Operations/GetInstanceResponse.md - docs/Models/Operations/GetJWKSResponse.md - docs/Models/Operations/GetJWTTemplateRequest.md - docs/Models/Operations/GetJWTTemplateResponse.md @@ -360,6 +380,9 @@ generatedFiles: - docs/Models/Operations/ListRedirectURLsResponse.md - docs/Models/Operations/ListSAMLConnectionsRequest.md - docs/Models/Operations/ListSAMLConnectionsResponse.md + - docs/Models/Operations/ListWaitlistEntriesQueryParamStatus.md + - docs/Models/Operations/ListWaitlistEntriesRequest.md + - docs/Models/Operations/ListWaitlistEntriesResponse.md - docs/Models/Operations/LockUserRequest.md - docs/Models/Operations/LockUserResponse.md - docs/Models/Operations/MergeOrganizationMetadataRequest.md @@ -395,6 +418,7 @@ generatedFiles: - docs/Models/Operations/SetUserProfileImageRequestBody.md - docs/Models/Operations/SetUserProfileImageResponse.md - docs/Models/Operations/Status.md + - docs/Models/Operations/TemplateSlug.md - docs/Models/Operations/TemplateType.md - docs/Models/Operations/ToggleTemplateDeliveryPathParamTemplateType.md - docs/Models/Operations/ToggleTemplateDeliveryRequest.md @@ -519,6 +543,7 @@ generatedFiles: - docs/sdks/testingtokens/README.md - docs/sdks/users/README.md - docs/sdks/userweb3wallets/README.md + - docs/sdks/waitlistentries/README.md - docs/sdks/webhooks/README.md - global.json - src/Clerk/BackendAPI/ActorTokens.cs @@ -577,9 +602,13 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Components/ErrorMeta.cs - src/Clerk/BackendAPI/Models/Components/ExternalAccount.cs - src/Clerk/BackendAPI/Models/Components/ExternalAccounts.cs + - src/Clerk/BackendAPI/Models/Components/FromOAuth.cs + - src/Clerk/BackendAPI/Models/Components/FromOAuthVerificationStatus.cs - src/Clerk/BackendAPI/Models/Components/HTTPMetadata.cs - src/Clerk/BackendAPI/Models/Components/IdentificationLink.cs - src/Clerk/BackendAPI/Models/Components/IdentifierType.cs + - src/Clerk/BackendAPI/Models/Components/Instance.cs + - src/Clerk/BackendAPI/Models/Components/InstanceObject.cs - src/Clerk/BackendAPI/Models/Components/InstanceRestrictions.cs - src/Clerk/BackendAPI/Models/Components/InstanceRestrictionsObject.cs - src/Clerk/BackendAPI/Models/Components/InstanceSettings.cs @@ -592,6 +621,7 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Components/InvitationStatus.cs - src/Clerk/BackendAPI/Models/Components/JWTTemplate.cs - src/Clerk/BackendAPI/Models/Components/JWTTemplateObject.cs + - src/Clerk/BackendAPI/Models/Components/Jwks.cs - src/Clerk/BackendAPI/Models/Components/Keys.cs - src/Clerk/BackendAPI/Models/Components/LatestActivity.cs - src/Clerk/BackendAPI/Models/Components/Meta.cs @@ -603,9 +633,6 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Components/OAuthApplications.cs - src/Clerk/BackendAPI/Models/Components/OTPVerificationStatus.cs - src/Clerk/BackendAPI/Models/Components/OTPVerificationStrategy.cs - - src/Clerk/BackendAPI/Models/Components/Oauth.cs - - src/Clerk/BackendAPI/Models/Components/OauthVerificationStatus.cs - - src/Clerk/BackendAPI/Models/Components/OauthVerificationStrategy.cs - src/Clerk/BackendAPI/Models/Components/Object.cs - src/Clerk/BackendAPI/Models/Components/Organization.cs - src/Clerk/BackendAPI/Models/Components/OrganizationDomain.cs @@ -690,6 +717,13 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Components/VerificationStatus.cs - src/Clerk/BackendAPI/Models/Components/VerificationStrategy.cs - src/Clerk/BackendAPI/Models/Components/Verifications.cs + - src/Clerk/BackendAPI/Models/Components/WaitlistEntries.cs + - src/Clerk/BackendAPI/Models/Components/WaitlistEntry.cs + - src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitation.cs + - src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitationObject.cs + - src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitationStatus.cs + - src/Clerk/BackendAPI/Models/Components/WaitlistEntryObject.cs + - src/Clerk/BackendAPI/Models/Components/WaitlistEntryStatus.cs - src/Clerk/BackendAPI/Models/Components/Web3Signature.cs - src/Clerk/BackendAPI/Models/Components/Web3SignatureVerificationStatus.cs - src/Clerk/BackendAPI/Models/Components/Web3SignatureVerificationStrategy.cs @@ -697,7 +731,6 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Components/Web3WalletObject.cs - src/Clerk/BackendAPI/Models/Components/Web3WalletVerification.cs - src/Clerk/BackendAPI/Models/Components/Web3WalletVerificationAdmin.cs - - src/Clerk/BackendAPI/Models/Components/WellKnownJWKS.cs - src/Clerk/BackendAPI/Models/Errors/ClerkErrors.cs - src/Clerk/BackendAPI/Models/Errors/Meta.cs - src/Clerk/BackendAPI/Models/Errors/SDKError.cs @@ -717,6 +750,7 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Operations/CreateAllowlistIdentifierResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateBlocklistIdentifierRequestBody.cs - src/Clerk/BackendAPI/Models/Operations/CreateBlocklistIdentifierResponse.cs + - src/Clerk/BackendAPI/Models/Operations/CreateBulkInvitationsResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateEmailAddressRequestBody.cs - src/Clerk/BackendAPI/Models/Operations/CreateEmailAddressResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateInvitationRequestBody.cs @@ -729,6 +763,7 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Operations/CreateOrganizationDomainRequestBody.cs - src/Clerk/BackendAPI/Models/Operations/CreateOrganizationDomainResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequest.cs + - src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequestBody.cs - src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequest.cs - src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequestBody.cs @@ -744,9 +779,17 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Operations/CreateRedirectURLResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateSAMLConnectionRequestBody.cs - src/Clerk/BackendAPI/Models/Operations/CreateSAMLConnectionResponse.cs + - src/Clerk/BackendAPI/Models/Operations/CreateSessionRequestBody.cs + - src/Clerk/BackendAPI/Models/Operations/CreateSessionResponse.cs + - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateObject.cs - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequest.cs + - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequestBody.cs - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateResponseBody.cs + - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenRequest.cs + - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenRequestBody.cs + - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenResponse.cs + - src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenResponseBody.cs - src/Clerk/BackendAPI/Models/Operations/CreateSignInTokenRequestBody.cs - src/Clerk/BackendAPI/Models/Operations/CreateSignInTokenResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateSvixAppResponse.cs @@ -755,6 +798,8 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Operations/CreateUserResponse.cs - src/Clerk/BackendAPI/Models/Operations/CreateUserTOTPRequest.cs - src/Clerk/BackendAPI/Models/Operations/CreateUserTOTPResponse.cs + - src/Clerk/BackendAPI/Models/Operations/CreateWaitlistEntryRequestBody.cs + - src/Clerk/BackendAPI/Models/Operations/CreateWaitlistEntryResponse.cs - src/Clerk/BackendAPI/Models/Operations/DeleteAllowlistIdentifierRequest.cs - src/Clerk/BackendAPI/Models/Operations/DeleteAllowlistIdentifierResponse.cs - src/Clerk/BackendAPI/Models/Operations/DeleteBackupCodeRequest.cs @@ -805,6 +850,7 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Operations/GetClientResponse.cs - src/Clerk/BackendAPI/Models/Operations/GetEmailAddressRequest.cs - src/Clerk/BackendAPI/Models/Operations/GetEmailAddressResponse.cs + - src/Clerk/BackendAPI/Models/Operations/GetInstanceResponse.cs - src/Clerk/BackendAPI/Models/Operations/GetJWKSResponse.cs - src/Clerk/BackendAPI/Models/Operations/GetJWTTemplateRequest.cs - src/Clerk/BackendAPI/Models/Operations/GetJWTTemplateResponse.cs @@ -866,6 +912,9 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Operations/ListRedirectURLsResponse.cs - src/Clerk/BackendAPI/Models/Operations/ListSAMLConnectionsRequest.cs - src/Clerk/BackendAPI/Models/Operations/ListSAMLConnectionsResponse.cs + - src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesQueryParamStatus.cs + - src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesRequest.cs + - src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesResponse.cs - src/Clerk/BackendAPI/Models/Operations/LockUserRequest.cs - src/Clerk/BackendAPI/Models/Operations/LockUserResponse.cs - src/Clerk/BackendAPI/Models/Operations/MergeOrganizationMetadataRequest.cs @@ -901,6 +950,7 @@ generatedFiles: - src/Clerk/BackendAPI/Models/Operations/SetUserProfileImageRequestBody.cs - src/Clerk/BackendAPI/Models/Operations/SetUserProfileImageResponse.cs - src/Clerk/BackendAPI/Models/Operations/Status.cs + - src/Clerk/BackendAPI/Models/Operations/TemplateSlug.cs - src/Clerk/BackendAPI/Models/Operations/TemplateType.cs - src/Clerk/BackendAPI/Models/Operations/ToggleTemplateDeliveryPathParamTemplateType.cs - src/Clerk/BackendAPI/Models/Operations/ToggleTemplateDeliveryRequest.cs @@ -1025,6 +1075,7 @@ generatedFiles: - src/Clerk/BackendAPI/Utils/SpeakeasyMetadata.cs - src/Clerk/BackendAPI/Utils/URLBuilder.cs - src/Clerk/BackendAPI/Utils/Utilities.cs + - src/Clerk/BackendAPI/WaitlistEntries.cs - src/Clerk/BackendAPI/Webhooks.cs examples: GetPublicInterstitial: @@ -1046,7 +1097,7 @@ examples: offset: 10 responses: "200": - application/json: [{"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}] + application/json: [{"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}, {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}, {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123}] "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} VerifyClient: @@ -1055,7 +1106,7 @@ examples: application/json: {"token": "jwt_token_example"} responses: "200": - application/json: {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123} + application/json: {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetClient: @@ -1065,7 +1116,7 @@ examples: client_id: "cli_123456789" responses: "200": - application/json: {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123} + application/json: {"object": "client", "id": "client_123456789abcd", "session_ids": ["sess_123456789abcd", "sess_23456789abcd"], "sessions": [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}, {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}], "sign_in_id": "signin_123456789abcd", "sign_up_id": "signup_123456789abcd", "last_active_session_id": "session_123456789abcd", "updated_at": 1632580323, "created_at": 1622481123} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateEmailAddress: @@ -1074,7 +1125,7 @@ examples: application/json: {"user_id": "user_12345", "email_address": "example@clerk.com", "verified": false, "primary": true} responses: "200": - application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} + application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetEmailAddress: @@ -1084,7 +1135,7 @@ examples: email_address_id: "email_address_id_example" responses: "200": - application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} + application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteEmailAddress: @@ -1106,7 +1157,7 @@ examples: application/json: {"verified": false, "primary": true} responses: "200": - application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} + application/json: {"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreatePhoneNumber: @@ -1164,6 +1215,13 @@ examples: application/json: [{"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000}] "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + createSession: + speakeasy-default-create-session: + responses: + "200": + application/json: {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetSession: speakeasy-default-get-session: parameters: @@ -1196,6 +1254,16 @@ examples: application/json: {"object": "session", "id": "sess_123456789abcd", "user_id": "user_123456789abcd", "client_id": "client_123456789abcd", "actor": null, "status": "active", "last_active_organization_id": "org_123456789abcd", "last_active_at": 1622471123, "expire_at": 1685471123, "abandon_at": 1630471123, "updated_at": 1622532323, "created_at": 1622470000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + CreateSessionToken: + speakeasy-default-create-session-token: + parameters: + path: + session_id: "" + responses: + "200": + application/json: {} + "401": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateSessionTokenFromTemplate: speakeasy-default-create-session-token-from-template: parameters: @@ -1203,19 +1271,11 @@ examples: session_id: "ses_123abcd4567" template_name: "custom_hasura" responses: - "401": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"object": "token", "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvZSBCbG9nZ3MiLCJpYXQiOjE1MTYyMzkwMjJ9.qKVwLLnbfqfM5VCfU8vDhXXXS0VklRcsErgTpELYgfw"} + "401": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetTemplateList: - speakeasy-default-get-template-list: - parameters: - path: - template_type: "sms" - responses: - "400": - application/json: {"errors": []} - "200": {} "": parameters: path: @@ -1224,7 +1284,7 @@ examples: "200": application/json: [{"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

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

Hello, {{ user.name }}

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

Hello, {{ user.name }}

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

Hello, {{ user.name }}

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

Hello, {{ user.name }}

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

Your code: {{code}}

", "body": "Use this code to verify your email: {{code}}", "delivered_by_clerk": true, "from_email_name": "hello", "reply_to_email_name": "support"} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

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

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "updated_at": 1610000000, "created_at": 1600000000} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} PreviewTemplate: speakeasy-default-preview-template: parameters: @@ -1269,28 +1342,14 @@ examples: requestBody: application/json: {"subject": "Welcome to our service!", "body": "Hi, thank you for joining our service.", "from_email_name": "hello", "reply_to_email_name": "support"} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {} - ToggleTemplateDelivery: - speakeasy-default-toggle-template-delivery: - parameters: - path: - template_type: "email" - slug: "welcome-email" - requestBody: - application/json: {"delivered_by_clerk": true} - responses: "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} - "200": - application/json: {"id": "temp_12345", "object": "template", "instance_id": "inst_67890", "resource_type": "system", "template_type": "email", "name": "Welcome Email", "slug": "welcome_email", "position": 1, "can_revert": false, "can_delete": true, "subject": "Welcome to our service!", "markup": "

Hello, {{ user.name }}

", "body": "You are now signed up. Welcome!", "available_variables": ["user.name", "user.email"], "required_variables": ["user.name"], "from_email_name": "Clerk Support", "reply_to_email_name": "support@clerk.com", "delivered_by_clerk": true, "updated_at": 1610000000, "created_at": 1600000000} GetUserList: "": parameters: query: - last_active_at_since: 1700690400000 email_address: ["test@example.com"] phone_number: ["+12345678901"] external_id: ["external-id-123"] @@ -1299,20 +1358,26 @@ examples: user_id: ["user-id-123"] organization_id: ["org-id-123"] query: "John" + last_active_at_before: 1700690400000 + last_active_at_after: 1700690400000 + last_active_at_since: 1700690400000 + created_at_before: 1730160000000 + created_at_after: 1730160000000 limit: 20 offset: 10 + order_by: "-created_at" responses: "200": - application/json: [{"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "from_oauth_microsoft", "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved_for_second_factor": false, "default_second_factor": true, "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "backup_codes": ["code1", "code2", "code3"], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "admin", "attempts": 0, "expire_at": 1620000000}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "provider_user_id": "prov_user_id_123", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml"}, "saml_connection": {"id": "sc_1234567890", "name": "My Company SAML Config", "domain": "mycompany.com", "active": true, "provider": "saml_custom", "sync_user_attributes": true, "allow_subdomains": false, "allow_idp_initiated": true, "created_at": 1614768000, "updated_at": 1622540800}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}] + application/json: [{"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}, {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "email_link", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved": false, "verification": {"status": "verified", "strategy": "phone_code", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}, {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_123", "object": "email_address", "email_address": "john.doe@example.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1609459200, "updated_at": 1609459200}], "phone_numbers": [{"id": "phone_id_123", "object": "phone_number", "phone_number": "+12345678901", "reserved": false, "verification": {"status": "verified", "strategy": "admin", "attempts": 2, "expire_at": 1622852400}, "linked_to": [{"type": "oauth_google", "id": "link_id_123"}], "created_at": 1609459200, "updated_at": 1609459200}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000}] "400": - application/json: {"errors": [{"message": "", "long_message": "", "code": "", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}, {"message": "", "long_message": "", "code": "", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}, {"message": "", "long_message": "", "code": "", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} + application/json: {"errors": [{"message": "Invalid input", "long_message": "The input provided does not meet the requirements.", "code": "400_bad_request", "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} CreateUser: speakeasy-default-create-user: requestBody: application/json: {"external_id": "ext-id-001", "first_name": "John", "last_name": "Doe", "email_address": ["john.doe@example.com"], "phone_number": ["+12345678901"], "web3_wallet": ["0x123456789abcdef0x123456789abcdef"], "username": "johndoe123", "password": "Secure*Pass4", "password_digest": "$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", "skip_password_checks": false, "skip_password_requirement": false, "totp_secret": "base32totpsecretkey", "backup_codes": ["123456", "654321"], "public_metadata": {"role": "user"}, "private_metadata": {"internal_id": "789"}, "unsafe_metadata": {"preferences": {"theme": "dark"}}, "created_at": "2023-03-15T07:15:20.902Z"} responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetUsersCount: @@ -1338,7 +1403,7 @@ examples: user_id: "usr_1" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateUser: @@ -1350,7 +1415,7 @@ examples: application/json: {"external_id": "ext_123", "first_name": "Jane", "last_name": "Doe", "primary_email_address_id": "eml_12345", "notify_primary_email_address_changed": true, "primary_phone_number_id": "phn_67890", "primary_web3_wallet_id": "wlt_123", "username": "janedoe", "profile_image_id": "img_789", "password": "secretPass123!", "password_digest": "$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc", "skip_password_checks": false, "sign_out_of_other_sessions": true, "totp_secret": "ABCD1234EFGH5678", "backup_codes": ["123456", "654321"], "public_metadata": {"theme": "dark"}, "private_metadata": {"vip": true}, "unsafe_metadata": {"age": 30}, "delete_self_enabled": true, "create_organization_enabled": false, "created_at": "2021-04-05T14:30:00.000Z"} responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteUser: @@ -1370,7 +1435,7 @@ examples: user_id: "user_12345" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UnbanUser: @@ -1380,7 +1445,7 @@ examples: user_id: "user_12345" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} LockUser: @@ -1390,7 +1455,7 @@ examples: user_id: "user_123456789" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UnlockUser: @@ -1400,7 +1465,7 @@ examples: user_id: "user_12345" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} SetUserProfileImage: @@ -1408,9 +1473,11 @@ examples: parameters: path: user_id: "usr_test123" + requestBody: + multipart/form-data: {} responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteUserProfileImage: @@ -1420,7 +1487,7 @@ examples: user_id: "usr_test123" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "saml", "external_verification_redirect_url": "https://example.com/saml_callback", "expire_at": 1622852400}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateUserMetadata: @@ -1430,7 +1497,7 @@ examples: user_id: "user_123456789" responses: "200": - application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} + application/json: {"id": "user_id_123", "object": "user", "external_id": "external_user_id_123", "primary_email_address_id": "email_id_123", "primary_phone_number_id": "phone_id_123", "primary_web3_wallet_id": "wallet_id_123", "username": "john_doe", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/new-profile.jpg", "has_image": true, "public_metadata": {"role": "admin"}, "private_metadata": {"ssn": "123-45-6789"}, "unsafe_metadata": {"theme": "dark"}, "email_addresses": [{"id": "email_id_56789", "object": "email_address", "email_address": "example@clerk.com", "reserved": false, "verification": {"status": "verified", "strategy": "admin"}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1615458901, "updated_at": 1615459001}], "phone_numbers": [{"id": "ph_123456789", "object": "phone_number", "phone_number": "+11234567890", "reserved": false, "verification": {"status": "verified", "strategy": "email_code", "attempts": 1, "expire_at": 1615462399}, "linked_to": [{"type": "oauth_google", "id": "link_12345"}], "created_at": 1594842023, "updated_at": 1604842023}], "web3_wallets": [{"id": "wallet_id_123", "object": "web3_wallet", "web3_wallet": "0x123456789abcdef", "verification": {"status": "verified", "strategy": "web3_metamask_signature", "nonce": "nonce_value"}, "created_at": 1609459200, "updated_at": 1609459200}], "passkeys": [{"id": "passkey_id_123", "object": "passkey", "name": "My Passkey", "last_used_at": 1615852800, "verification": {"status": "verified", "strategy": "passkey", "nonce": "nonce"}}], "password_enabled": true, "two_factor_enabled": true, "totp_enabled": true, "backup_code_enabled": true, "mfa_enabled_at": 1615852800, "mfa_disabled_at": null, "external_accounts": [{}], "saml_accounts": [{"id": "saml_account_id_123", "object": "saml_account", "provider": "SAML Provider", "active": true, "email_address": "user@example.com", "public_metadata": {"department": "IT"}, "verification": {"status": "verified", "strategy": "ticket"}}], "last_sign_in_at": 1622852400, "banned": false, "locked": false, "lockout_expires_in_seconds": null, "verification_attempts_remaining": 5, "updated_at": 1622852400, "created_at": 1609459200, "delete_self_enabled": true, "create_organization_enabled": true, "last_active_at": 1700690400000, "legal_accepted_at": 1700690400000} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetOAuthAccessToken: @@ -1440,10 +1507,10 @@ examples: user_id: "user_123" provider: "oauth_google" responses: + "200": + application/json: [{"object": "oauth_access_token", "external_account_id": "external_account_456", "provider_user_id": "provider_user_789", "token": "access_token_123", "provider": "oauth_google", "label": "Primary account", "scopes": ["email", "profile"], "token_secret": "token_secret_xyz"}] "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} - "200": - application/json: [{"object": "oauth_access_token", "external_account_id": "external_account_456", "provider_user_id": "provider_user_789", "token": "access_token_123", "provider": "oauth_google", "public_metadata": {}, "label": "Primary account", "scopes": ["email", "profile"], "token_secret": "token_secret_xyz"}] UsersGetOrganizationMemberships: speakeasy-default-users-get-organization-memberships: parameters: @@ -1454,7 +1521,7 @@ examples: offset: 10 responses: "200": - application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} + application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UsersGetOrganizationInvitations: @@ -1467,7 +1534,7 @@ examples: offset: 10 responses: "200": - application/json: {"data": [], "total_count": 939995} + application/json: {"data": [{}], "total_count": 375907} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} VerifyPassword: @@ -1478,10 +1545,10 @@ examples: requestBody: application/json: {"password": "securepassword123"} responses: - "500": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"verified": true} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} VerifyTOTP: speakeasy-default-verify-TOTP: parameters: @@ -1490,30 +1557,34 @@ examples: requestBody: application/json: {"code": "123456"} responses: - "500": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"verified": true, "code_type": "totp"} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DisableMFA: speakeasy-default-disable-MFA: parameters: path: user_id: "user_123456" responses: - "404": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"user_id": "user_123456"} + "404": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteBackupCode: speakeasy-default-delete-backup-code: parameters: path: user_id: "" responses: - "404": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {} + "404": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UserPasskeyDelete: speakeasy-default-user-passkey-delete: parameters: @@ -1525,16 +1596,7 @@ examples: application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} - UserWeb3WalletDelete: - speakeasy-default-user-web3-wallet-delete: - parameters: - path: - user_id: "" - web3_wallet_identification_id: "" - responses: - "200": - application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} - "400": + "500": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateUserTOTP: speakeasy-default-create-user-TOTP: @@ -1543,19 +1605,23 @@ examples: user_id: "" responses: "200": - application/json: {"object": "", "id": "", "secret": "", "uri": "https://watery-humidity.org", "verified": true, "key": ""} + application/json: {"object": "", "id": "", "secret": "", "uri": "https://golden-signature.com/", "verified": true, "key": "", "key1": ""} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteTOTP: speakeasy-default-delete-TOTP: parameters: path: user_id: "" responses: - "404": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {} + "404": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteExternalAccount: speakeasy-default-delete-external-account: parameters: @@ -1567,13 +1633,28 @@ examples: application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + UserWeb3WalletDelete: + speakeasy-default-user-web3-wallet-delete: + parameters: + path: + user_id: "" + web3_wallet_identification_id: "" + responses: + "200": + application/json: {"object": "deleted_object", "id": "deleted_object_id_example", "slug": "deleted-object-slug", "deleted": true} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateInvitation: speakeasy-default-create-invitation: requestBody: - application/json: {"email_address": "user@example.com", "public_metadata": {}, "redirect_url": "https://example.com/welcome", "notify": true, "ignore_existing": "​false"} + application/json: {"email_address": "user@example.com", "redirect_url": "https://example.com/welcome", "notify": true, "ignore_existing": "​false"} responses: "200": - application/json: {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200} + application/json: {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListInvitations: @@ -1585,7 +1666,14 @@ examples: status: "pending" responses: "200": - application/json: [{"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}, {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}] + application/json: [{"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}, {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}, {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}] + CreateBulkInvitations: + speakeasy-default-create-bulk-invitations: + responses: + "200": + application/json: [{"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}, {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}] + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} RevokeInvitation: speakeasy-default-revoke-invitation: parameters: @@ -1593,7 +1681,7 @@ examples: invitation_id: "inv_123" responses: "200": - application/json: {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "public_metadata": {}, "revoked": true, "status": "revoked", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200} + application/json: {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": true, "status": "revoked", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListInstanceOrganizationInvitations: @@ -1602,11 +1690,14 @@ examples: query: limit: 20 offset: 10 + order_by: "-created_at" responses: "200": - application/json: {"data": [], "total_count": 5142} + application/json: {"data": [], "total_count": 255187} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateOrganizationInvitation: speakeasy-default-create-organization-invitation: parameters: @@ -1615,10 +1706,10 @@ examples: requestBody: application/json: {"email_address": "user@example.com", "inviter_user_id": "user_67890", "role": "admin", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "redirect_url": "https://example.com/welcome"} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1622547600, "updated_at": 1622551200} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListOrganizationInvitations: speakeasy-default-list-organization-invitations: parameters: @@ -1639,23 +1730,13 @@ examples: path: organization_id: "org_12345" requestBody: - application/json: [] + application/json: [{"email_address": "newmember@example.com", "inviter_user_id": "user_67890", "role": "admin", "redirect_url": "https://example.com/welcome"}] responses: "200": application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "organization_id": "org_12345", "status": "pending", "created_at": 1622547600, "updated_at": 1622551200}], "total_count": 10} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListPendingOrganizationInvitations: - speakeasy-default-list-pending-organization-invitations: - parameters: - path: - organization_id: "" - query: {} - responses: - "200": - application/json: {"data": [], "total_count": 910782} - "400": - application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} "": parameters: path: @@ -1665,9 +1746,9 @@ examples: offset: 10 responses: "200": - application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "member", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1617981379, "updated_at": 1625581379}], "total_count": 10} + application/json: {"data": [{"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "member", "organization_id": "org_12345", "status": "pending", "created_at": 1617981379, "updated_at": 1625581379}], "total_count": 10} "400": - application/json: {"errors": [{"message": "Invalid input", "long_message": "The input provided does not meet the requirements.", "code": "400_bad_request", "meta": {}, "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} + application/json: {"errors": [{"message": "Invalid input", "long_message": "The input provided does not meet the requirements.", "code": "400_bad_request", "clerk_trace_id": "trace_123456789abcd"}], "meta": {}} GetOrganizationInvitation: speakeasy-default-get-organization-invitation: parameters: @@ -1675,10 +1756,10 @@ examples: organization_id: "org_123456789" invitation_id: "inv_987654321" responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1622547600, "updated_at": 1622551200} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} RevokeOrganizationInvitation: speakeasy-default-revoke-organization-invitation: parameters: @@ -1688,26 +1769,26 @@ examples: requestBody: application/json: {"requesting_user_id": "usr_12345"} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"id": "inv_12345", "object": "organization_invitation", "email_address": "user@example.com", "role": "admin", "organization_id": "org_12345", "status": "pending", "public_metadata": {"key": "value"}, "private_metadata": {"private_key": "secret_value"}, "created_at": 1622547600, "updated_at": 1622551200} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListAllowlistIdentifiers: speakeasy-default-list-allowlist-identifiers: responses: - "401": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: [{"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}, {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}, {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600}] + "401": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateAllowlistIdentifier: speakeasy-default-create-allowlist-identifier: requestBody: application/json: {"identifier": "user@example.com", "notify": true} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"object": "allowlist_identifier", "id": "alid_123456", "invitation_id": "inv_123456", "identifier": "user@example.com", "identifier_type": "email_address", "instance_id": "instance_12345", "created_at": 1622547600, "updated_at": 1622648600} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteAllowlistIdentifier: speakeasy-default-delete-allowlist-identifier: parameters: @@ -1730,10 +1811,10 @@ examples: requestBody: application/json: {"identifier": "example@example.com"} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"object": "blocklist_identifier", "id": "identifier_id", "identifier": "blocked@example.com", "identifier_type": "email_address", "instance_id": "instance_id_here", "created_at": 1609459200, "updated_at": 1612137600} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteBlocklistIdentifier: speakeasy-default-delete-blocklist-identifier: parameters: @@ -1749,10 +1830,10 @@ examples: requestBody: application/json: {"restricted_to_allowlist": false, "from_email_address": "noreply", "progressive_sign_up": true, "session_token_template": "defaultSessionToken", "enhanced_email_deliverability": true, "test_mode": true} responses: - "402": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"object": "instance_settings", "id": "inst_123456789", "restricted_to_allowlist": false, "from_email_address": "noreply@clerk.dev", "progressive_sign_up": true, "enhanced_email_deliverability": true} + "402": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateProductionInstanceDomain: speakeasy-default-update-production-instance-domain: requestBody: @@ -1770,10 +1851,10 @@ examples: CreateActorToken: speakeasy-default-create-actor-token: requestBody: - application/json: {"user_id": "user_1a2b3c", "expires_in_seconds": 3600, "session_max_duration_in_seconds": 1800} + application/json: {"user_id": "user_1a2b3c", "actor": {}, "expires_in_seconds": 3600, "session_max_duration_in_seconds": 1800} responses: "200": - application/json: {"object": "actor_token", "id": "actor_tok_1a2b3c", "status": "pending", "user_id": "user_1a2b3c", "token": "token_string", "url": "https://example.com/token", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "actor_token", "id": "actor_tok_1a2b3c", "status": "pending", "user_id": "user_1a2b3c", "actor": {}, "token": "token_string", "url": "https://example.com/token", "created_at": 1609459200, "updated_at": 1612137600} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} RevokeActorToken: @@ -1783,7 +1864,7 @@ examples: actor_token_id: "act_tok_abcdefghijk" responses: "200": - application/json: {"object": "actor_token", "id": "actor_tok_1a2b3c", "status": "pending", "user_id": "user_1a2b3c", "token": "token_string", "url": "https://example.com/token", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "actor_token", "id": "actor_tok_1a2b3c", "status": "pending", "user_id": "user_1a2b3c", "actor": {}, "token": "token_string", "url": "https://example.com/token", "created_at": 1609459200, "updated_at": 1612137600} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListDomains: @@ -1822,6 +1903,11 @@ examples: application/json: {"object": "domain", "id": "domain_id", "name": "example.com", "is_satellite": false, "frontend_api_url": "https://frontend.example.com", "accounts_portal_url": null, "proxy_url": null, "development_origin": "http://localhost:3000", "cname_targets": [{"host": "cname.example.com", "value": "value.example.com", "required": true}]} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + GetInstance: + speakeasy-default-get-instance: + responses: + "200": + application/json: {"environment_type": "development", "allowed_origins": ["http://localhost:3000", "https://some-domain"]} UpdateInstance: speakeasy-default-update-instance: requestBody: @@ -1834,10 +1920,10 @@ examples: requestBody: application/json: {"allowlist": false, "blocklist": true, "block_email_subaddresses": true, "block_disposable_email_domains": true, "ignore_dots_for_gmail_addresses": false} responses: - "402": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {"object": "instance_restrictions", "allowlist": false, "blocklist": true, "block_email_subaddresses": true, "ignore_dots_for_gmail_addresses": false} + "402": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateInstanceOrganizationSettings: speakeasy-default-update-instance-organization-settings: requestBody: @@ -1845,7 +1931,7 @@ examples: responses: "200": application/json: {"object": "organization_settings", "enabled": true, "max_allowed_memberships": 5, "max_allowed_roles": 3, "max_allowed_permissions": 15, "creator_role": "admin", "admin_delete_enabled": true, "domains_enabled": true, "domains_enrollment_modes": ["automatic_invitation", "automatic_suggestion"], "domains_default_role": "member"} - "402": + "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateSvixApp: speakeasy-default-create-svix-app: @@ -1930,7 +2016,7 @@ examples: application/json: {"name": "NewOrg", "created_by": "user_123", "private_metadata": {"internal_code": "ABC123"}, "public_metadata": {"public_event": "Annual Summit"}, "slug": "neworg", "max_allowed_memberships": 100} responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"key": "", "public_info": "Info visible to everyone"}, "private_metadata": {"key": "", "key1": "", "internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetOrganization: @@ -1941,7 +2027,7 @@ examples: query: {} responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"key": "", "key1": "", "public_info": "Info visible to everyone"}, "private_metadata": {"key": "", "key1": "", "internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateOrganization: @@ -1950,10 +2036,10 @@ examples: path: organization_id: "org_123_update" requestBody: - application/json: {"public_metadata": {}, "private_metadata": {}, "name": "New Organization Name", "slug": "new-org-slug", "max_allowed_memberships": 100, "admin_delete_enabled": true} + application/json: {"name": "New Organization Name", "slug": "new-org-slug", "max_allowed_memberships": 100, "admin_delete_enabled": true} responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"key": "", "key1": "", "key2": "", "public_info": "Info visible to everyone"}, "private_metadata": {"key": "", "key1": "", "internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteOrganization: @@ -1975,7 +2061,7 @@ examples: application/json: {"public_metadata": {"announcement": "We are opening a new office!"}, "private_metadata": {"internal_use_only": "Future plans discussion."}} responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"key": "", "key1": "", "key2": "", "public_info": "Info visible to everyone"}, "private_metadata": {"key": "", "key1": "", "internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UploadOrganizationLogo: @@ -1987,7 +2073,7 @@ examples: multipart/form-data: {"uploader_user_id": "user_67890", "file": {"": "path/to/your/logo.png"}} responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"key": "", "key1": "", "key2": "", "internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800, "image_url": "https://example.com/image_url.png", "has_image": true} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800, "image_url": "https://example.com/image_url.png", "has_image": true} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteOrganizationLogo: @@ -1997,7 +2083,7 @@ examples: organization_id: "org_12345" responses: "200": - application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"key": "", "key1": "", "key2": "", "public_info": "Info visible to everyone"}, "private_metadata": {"key": "", "key1": "", "key2": "", "internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800} "404": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateOrganizationMembership: @@ -2008,10 +2094,10 @@ examples: requestBody: application/json: {"user_id": "user_456", "role": "admin"} responses: + "200": + application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} - "200": - application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} ListOrganizationMemberships: speakeasy-default-list-organization-memberships: parameters: @@ -2023,7 +2109,7 @@ examples: order_by: "+created_at" responses: "200": - application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}, {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}, {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} + application/json: {"data": [{"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}, {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}, {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800}], "total_count": 1} "401": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateOrganizationMembership: @@ -2035,10 +2121,10 @@ examples: requestBody: application/json: {"role": "admin"} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": - application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + "404": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteOrganizationMembership: speakeasy-default-delete-organization-membership: parameters: @@ -2046,10 +2132,10 @@ examples: organization_id: "org_12345" user_id: "user_67890" responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": - application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} + "401": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateOrganizationMembershipMetadata: speakeasy-default-update-organization-membership-metadata: parameters: @@ -2057,12 +2143,12 @@ examples: organization_id: "org_123456" user_id: "user_654321" requestBody: - application/json: {"public_metadata": {}, "private_metadata": {}} + application/json: {} responses: + "200": + application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} - "200": - application/json: {"id": "org_mem_123", "object": "organization_membership", "role": "member", "permissions": ["read"], "public_metadata": {}, "private_metadata": {}, "organization": {"object": "organization", "id": "org_123", "name": "Acme Corp", "slug": "acme-corp", "members_count": 150, "max_allowed_memberships": 300, "admin_delete_enabled": true, "public_metadata": {"public_info": "Info visible to everyone"}, "private_metadata": {"internal_use_only": "Sensitive data"}, "created_by": "user_123456", "created_at": 1625078400, "updated_at": 1625164800}, "public_user_data": {"user_id": "usr_123456", "first_name": "John", "last_name": "Doe", "image_url": "https://example.com/path/to/image.jpg", "has_image": true, "identifier": "john.doe@example.com"}, "created_at": 1625078400, "updated_at": 1625164800} InstanceGetOrganizationMemberships: speakeasy-default-instance-get-organization-memberships: parameters: @@ -2074,16 +2160,20 @@ examples: application/json: {"data": [], "total_count": 1} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} + "500": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateOrganizationDomain: speakeasy-default-create-organization-domain: parameters: path: organization_id: "" + requestBody: + application/json: {} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListOrganizationDomains: speakeasy-default-list-organization-domains: parameters: @@ -2094,7 +2184,7 @@ examples: offset: 10 responses: "200": - application/json: {"total_count": 605114} + application/json: {"data": [{}, {}, {}], "total_count": 547272} "401": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteOrganizationDomain: @@ -2114,11 +2204,13 @@ examples: path: organization_id: "" domain_id: "" + requestBody: + application/json: {} responses: - "400": - application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} "200": application/json: {} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} VerifyDomainProxy: speakeasy-default-verify-domain-proxy: requestBody: @@ -2190,7 +2282,7 @@ examples: application/json: {"external_id": "ext_id_7890abcdef123456"} responses: "200": - application/json: {"object": "sign_up_attempt", "id": "signup_1234567890abcdef", "status": "complete", "required_fields": ["email_address"], "optional_fields": ["first_name", "last_name"], "missing_fields": ["phone_number"], "unverified_fields": ["email_address"], "username": "user_123456", "email_address": "user@example.com", "phone_number": "+1234567890", "web3_wallet": "0x1234567890abcdef1234567890abcdef12345678", "password_enabled": true, "first_name": "John", "last_name": "Doe", "custom_action": false, "external_id": "ext_id_7890abcdef123456", "created_session_id": "sess_1234567890abcdef", "created_user_id": "user_1234567890abcdef", "abandon_at": 1609459200} + application/json: {"object": "sign_up_attempt", "id": "signup_1234567890abcdef", "status": "complete", "required_fields": ["email_address"], "optional_fields": ["first_name", "last_name"], "missing_fields": ["phone_number"], "unverified_fields": ["email_address"], "username": "user_123456", "email_address": "user@example.com", "phone_number": "+1234567890", "web3_wallet": "0x1234567890abcdef1234567890abcdef12345678", "password_enabled": true, "first_name": "John", "last_name": "Doe", "custom_action": false, "external_id": "ext_id_7890abcdef123456", "created_session_id": "sess_1234567890abcdef", "created_user_id": "user_1234567890abcdef", "abandon_at": 1609459200, "legal_accepted_at": 1700690400000} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListOAuthApplications: @@ -2201,7 +2293,7 @@ examples: offset: 10 responses: "200": - application/json: {"data": [{"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600}], "total_count": 1} + application/json: {"data": [{"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://neglected-plastic.biz", "token_introspection_url": "https://crooked-overload.name/", "created_at": 1609459200, "updated_at": 1612137600}], "total_count": 1} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateOAuthApplication: @@ -2210,7 +2302,7 @@ examples: application/json: {"name": "Example App", "callback_url": "https://example.com/oauth/callback", "scopes": "profile email public_metadata", "public": true} responses: "200": - application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600, "client_secret": "secretXYZ123"} + application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://probable-heating.com/", "token_introspection_url": "https://standard-utilization.com/", "created_at": 1609459200, "updated_at": 1612137600, "client_secret": "secretXYZ123"} "400": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetOAuthApplication: @@ -2220,7 +2312,7 @@ examples: oauth_application_id: "oauth_app_12345" responses: "200": - application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://normal-making.name", "token_introspection_url": "https://lavish-ice-cream.biz", "created_at": 1609459200, "updated_at": 1612137600} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateOAuthApplication: @@ -2232,7 +2324,7 @@ examples: application/json: {"name": "Updated OAuth App Name", "callback_url": "https://example.com/oauth/callback", "scopes": "profile email public_metadata private_metadata"} responses: "200": - application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600} + application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://passionate-flu.org", "token_introspection_url": "https://lumbering-wheel.com", "created_at": 1609459200, "updated_at": 1612137600} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteOAuthApplication: @@ -2252,7 +2344,7 @@ examples: oauth_application_id: "oauth_application_12345" responses: "200": - application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "created_at": 1609459200, "updated_at": 1612137600, "client_secret": "secretXYZ123"} + application/json: {"object": "oauth_application", "id": "oauth_app_1234", "instance_id": "instance_5678", "name": "Example OAuth App", "client_id": "client_12345", "public": false, "scopes": "profile email", "callback_url": "https://example.com/oauth/callback", "authorize_url": "https://example.com/authorize", "token_fetch_url": "https://example.com/oauth/token", "user_info_url": "https://example.com/userinfo", "discovery_url": "https://enchanting-language.org", "token_introspection_url": "https://tempting-popularity.net/", "created_at": 1609459200, "updated_at": 1612137600, "client_secret": "secretXYZ123"} "403": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} ListSAMLConnections: @@ -2263,7 +2355,7 @@ examples: offset: 10 responses: "200": - application/json: {"data": [{"object": "saml_connection", "id": "", "name": "", "domain": "soft-integer.com", "idp_entity_id": "", "idp_sso_url": "https://baggy-conservative.biz/", "idp_certificate": "", "acs_url": "https://impartial-epic.com/", "sp_entity_id": "", "sp_metadata_url": "https://lavish-order.biz/", "active": false, "provider": "", "user_count": 160633, "sync_user_attributes": false, "created_at": 521364, "updated_at": 469208}, {"object": "saml_connection", "id": "", "name": "", "domain": "rusty-summary.name", "idp_entity_id": "", "idp_sso_url": "https://winding-heating.com", "idp_certificate": "", "acs_url": "https://enlightened-space.net/", "sp_entity_id": "", "sp_metadata_url": "https://favorable-heartbeat.net/", "active": false, "provider": "", "user_count": 15207, "sync_user_attributes": true, "created_at": 532002, "updated_at": 785391}], "total_count": 5} + application/json: {"data": [{"object": "saml_connection", "id": "", "name": "", "domain": "neglected-plastic.biz", "idp_entity_id": "", "idp_sso_url": "https://crooked-overload.name/", "idp_certificate": "", "acs_url": "https://secret-bob.com/", "sp_entity_id": "", "sp_metadata_url": "https://memorable-overcoat.com", "active": true, "provider": "", "user_count": 367745, "sync_user_attributes": true, "created_at": 73227, "updated_at": 931165}, {"object": "saml_connection", "id": "", "name": "", "domain": "odd-sustenance.info", "idp_entity_id": "", "idp_sso_url": "https://glorious-strategy.com/", "idp_certificate": "", "acs_url": "https://insistent-tinderbox.biz", "sp_entity_id": "", "sp_metadata_url": "https://unpleasant-chairperson.info/", "active": true, "provider": "", "user_count": 432930, "sync_user_attributes": true, "created_at": 103421, "updated_at": 523875}, {"object": "saml_connection", "id": "", "name": "", "domain": "tempting-handle.org", "idp_entity_id": "", "idp_sso_url": "https://imaginative-cap.biz/", "idp_certificate": "", "acs_url": "https://animated-ostrich.org", "sp_entity_id": "", "sp_metadata_url": "https://bowed-poppy.name", "active": false, "provider": "", "user_count": 816637, "sync_user_attributes": false, "created_at": 81309, "updated_at": 164965}], "total_count": 5} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} CreateSAMLConnection: @@ -2272,7 +2364,7 @@ examples: application/json: {"name": "My SAML Connection", "domain": "example.org", "provider": "saml_custom", "idp_entity_id": "http://idp.example.org/", "idp_sso_url": "http://idp.example.org/sso", "idp_certificate": "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", "idp_metadata_url": "http://idp.example.org/metadata.xml", "idp_metadata": "", "name": "", "domain": "stingy-necklace.name", "idp_entity_id": "", "idp_sso_url": "https://descriptive-skyscraper.net", "idp_certificate": "", "acs_url": "https://junior-meatloaf.org", "sp_entity_id": "", "sp_metadata_url": "https://glorious-discourse.name/", "active": false, "provider": "", "user_count": 373144, "sync_user_attributes": false, "created_at": 67442, "updated_at": 70153} + application/json: {"object": "saml_connection", "id": "", "name": "", "domain": "low-packaging.info", "idp_entity_id": "", "idp_sso_url": "https://black-and-white-secrecy.org/", "idp_certificate": "", "acs_url": "https://deafening-bonnet.net/", "sp_entity_id": "", "sp_metadata_url": "https://outrageous-resolve.org", "active": true, "provider": "", "user_count": 259629, "sync_user_attributes": true, "created_at": 230313, "updated_at": 211337} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} GetSAMLConnection: @@ -2282,7 +2374,7 @@ examples: saml_connection_id: "saml_conn_123" responses: "200": - application/json: {"object": "saml_connection", "id": "", "name": "", "domain": "whopping-offset.org", "idp_entity_id": "", "idp_sso_url": "https://hospitable-eyeliner.net/", "idp_certificate": "", "acs_url": "https://focused-marimba.org/", "sp_entity_id": "", "sp_metadata_url": "https://athletic-wriggler.name", "active": false, "provider": "", "user_count": 660557, "sync_user_attributes": false, "created_at": 503710, "updated_at": 338454} + application/json: {"object": "saml_connection", "id": "", "name": "", "domain": "rural-mathematics.name", "idp_entity_id": "", "idp_sso_url": "https://willing-impostor.info", "idp_certificate": "", "acs_url": "https://earnest-tuber.info/", "sp_entity_id": "", "sp_metadata_url": "https://boiling-dash.biz", "active": true, "provider": "", "user_count": 552582, "sync_user_attributes": false, "created_at": 380699, "updated_at": 746585} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} UpdateSAMLConnection: @@ -2294,7 +2386,7 @@ examples: application/json: {"name": "Example SAML Connection", "domain": "example.com", "idp_entity_id": "entity_123", "idp_sso_url": "https://idp.example.com/sso", "idp_certificate": "MIIDBTCCAe2gAwIBAgIQ...", "idp_metadata_url": "https://idp.example.com/metadata", "idp_metadata": "...", "attribute_mapping": {"user_id": "id123", "email_address": "user@example.com", "first_name": "Jane", "last_name": "Doe"}, "active": true, "sync_user_attributes": false, "allow_subdomains": true, "allow_idp_initiated": false} responses: "200": - application/json: {"object": "saml_connection", "id": "", "name": "", "domain": "bitter-cheetah.biz", "idp_entity_id": "", "idp_sso_url": "https://dual-pomelo.org", "idp_certificate": "", "acs_url": "https://paltry-middle.net", "sp_entity_id": "", "sp_metadata_url": "https://immediate-tune-up.info/", "active": true, "provider": "", "user_count": 910631, "sync_user_attributes": true, "created_at": 347299, "updated_at": 414806} + application/json: {"object": "saml_connection", "id": "", "name": "", "domain": "tinted-nectarine.info", "idp_entity_id": "", "idp_sso_url": "https://powerless-juggernaut.org", "idp_certificate": "", "acs_url": "https://unlucky-hydrolyze.biz/", "sp_entity_id": "", "sp_metadata_url": "https://cool-scout.org/", "active": true, "provider": "", "user_count": 464385, "sync_user_attributes": false, "created_at": 693508, "updated_at": 404265} "402": application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} DeleteSAMLConnection: @@ -2312,4 +2404,22 @@ examples: responses: "200": application/json: {"object": "testing_token", "token": "1713877200-c_2J2MvPu9PnXcuhbPZNao0LOXqK9A7YrnBn0HmIWxy", "expires_at": 1713880800} + ListWaitlistEntries: + speakeasy-default-list-waitlist-entries: + parameters: + query: + limit: 20 + offset: 10 + order_by: "-created_at" + responses: + "200": + application/json: {"data": [{"object": "waitlist_entry", "id": "", "email_address": "Jaylen_Daniel-Haag@yahoo.com", "status": "pending", "created_at": 543511, "updated_at": 155167, "invitation": {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}}, {"object": "waitlist_entry", "id": "", "email_address": "Enid.Bernhard5@gmail.com", "status": "pending", "created_at": 882329, "updated_at": 914872, "invitation": {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}}], "total_count": 843440} + CreateWaitlistEntry: + speakeasy-default-create-waitlist-entry: + responses: + "200": + application/json: {"object": "waitlist_entry", "id": "", "email_address": "Demond_Willms@hotmail.com", "status": "pending", "created_at": 469096, "updated_at": 843035, "invitation": {"object": "invitation", "id": "inv_f02930r3", "email_address": "invitee@example.com", "revoked": false, "status": "pending", "url": "https://example.com/invitations/accept?code=abcd1234", "created_at": 1622549600, "updated_at": 1622553200}} + "400": + application/json: {"errors": [{"message": "Error message", "long_message": "Longer error message with more details", "code": "error_code", "clerk_trace_id": "trace_id"}], "meta": {}} +examplesVersion: 1.0.0 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1895e2f..70338b0 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true csharp: - version: 0.2.4 + version: 0.3.0 additionalDependencies: - package: System.IdentityModel.Tokens.Jwt version: 8.2.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index ecdae8e..249d873 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.456.0 +speakeasyVersion: 1.473.0 sources: clerk-backend-api-OAS: sourceNamespace: clerk-openapi - sourceRevisionDigest: sha256:efdf986b92d6862a0b94ab2cfed73cb30d81a555892efb24fc6e378a2af4a577 - sourceBlobDigest: sha256:0a5ace726161fd961371da7a7e552954e4ffb456e1d3762ec2f551f5f14bc1f0 + sourceRevisionDigest: sha256:53525efdf49a8b28bf3c77fd74febf52f0f4e563cea7337d3f64ee7690ccf405 + sourceBlobDigest: sha256:3508bdedcc9af2c8f425007085f5fe060d7c0b32d0aa9502a44ca5bc6a9b6303 tags: - latest - - speakeasy-sdk-regen-1733789165 + - speakeasy-sdk-regen-1737669739 - v1 targets: clerk-backend-api: source: clerk-backend-api-OAS sourceNamespace: clerk-openapi - sourceRevisionDigest: sha256:efdf986b92d6862a0b94ab2cfed73cb30d81a555892efb24fc6e378a2af4a577 - sourceBlobDigest: sha256:0a5ace726161fd961371da7a7e552954e4ffb456e1d3762ec2f551f5f14bc1f0 + sourceRevisionDigest: sha256:53525efdf49a8b28bf3c77fd74febf52f0f4e563cea7337d3f64ee7690ccf405 + sourceBlobDigest: sha256:3508bdedcc9af2c8f425007085f5fe060d7c0b32d0aa9502a44ca5bc6a9b6303 codeSamplesNamespace: clerk-backend-api-oas-csharp-code-samples - codeSamplesRevisionDigest: sha256:96f7d941706af8b63df143e3a2ac81b4abdb797a5efb58ad2991bdc8ed2389f9 + codeSamplesRevisionDigest: sha256:1d74df474d1eb925efaae16c859fb2f289753caf9eef03ae34f75882f1c8249e workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/NUGET.md b/NUGET.md index 1108bed..7380860 100644 --- a/NUGET.md +++ b/NUGET.md @@ -8,7 +8,6 @@ ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -33,7 +32,6 @@ This SDK supports the following security scheme globally: To authenticate with the API the `BearerAuth` parameter must be set when initializing the SDK client instance. For example: ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -71,10 +69,9 @@ When custom error responses are specified for an operation, the SDK may also thr ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; -using System; using Clerk.BackendAPI.Models.Errors; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -112,8 +109,6 @@ catch (Exception ex) The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(serverUrl: "https://api.clerk.com/v1"); diff --git a/README.md b/README.md index ad304ac..0354737 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,6 @@ dotnet add reference src/Clerk/BackendAPI/Clerk.BackendAPI.csproj ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -94,7 +93,6 @@ This SDK supports the following security scheme globally: To authenticate with the API the `BearerAuth` parameter must be set when initializing the SDK client instance. For example: ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -207,6 +205,7 @@ If the request is correctly authenticated, the token's claims are made available ### [InstanceSettings](docs/sdks/instancesettings/README.md) +* [GetInstance](docs/sdks/instancesettings/README.md#getinstance) - Fetch the current instance * [Update](docs/sdks/instancesettings/README.md#update) - Update instance settings * [UpdateRestrictions](docs/sdks/instancesettings/README.md#updaterestrictions) - Update instance restrictions * [UpdateOrganization](docs/sdks/instancesettings/README.md#updateorganization) - Update instance organization settings @@ -215,6 +214,7 @@ If the request is correctly authenticated, the token's claims are made available * [Create](docs/sdks/invitations/README.md#create) - Create an invitation * [List](docs/sdks/invitations/README.md#list) - List all invitations +* [CreateBulkInvitations](docs/sdks/invitations/README.md#createbulkinvitations) - Create multiple invitations * [Revoke](docs/sdks/invitations/README.md#revoke) - Revokes an invitation ### [Jwks](docs/sdks/jwks/README.md) @@ -311,9 +311,11 @@ If the request is correctly authenticated, the token's claims are made available ### [Sessions](docs/sdks/sessions/README.md) * [List](docs/sdks/sessions/README.md#list) - List all sessions +* [CreateSession](docs/sdks/sessions/README.md#createsession) - Create a new active session * [Get](docs/sdks/sessions/README.md#get) - Retrieve a session * [Revoke](docs/sdks/sessions/README.md#revoke) - Revoke a session * [~~Verify~~](docs/sdks/sessions/README.md#verify) - Verify a session :warning: **Deprecated** +* [CreateSessionToken](docs/sdks/sessions/README.md#createsessiontoken) - Create a session token * [CreateToken](docs/sdks/sessions/README.md#createtoken) - Create a session token from a jwt template ### [SignInTokens](docs/sdks/signintokens/README.md) @@ -360,6 +362,11 @@ If the request is correctly authenticated, the token's claims are made available * [Delete](docs/sdks/userweb3wallets/README.md#delete) - Delete a user web3 wallet +### [WaitlistEntries](docs/sdks/waitlistentries/README.md) + +* [ListWaitlistEntries](docs/sdks/waitlistentries/README.md#listwaitlistentries) - List all waitlist entries +* [CreateWaitlistEntry](docs/sdks/waitlistentries/README.md#createwaitlistentry) - Create a waitlist entry + ### [Webhooks](docs/sdks/webhooks/README.md) * [CreateSvixApp](docs/sdks/webhooks/README.md#createsvixapp) - Create a Svix app @@ -393,10 +400,9 @@ When custom error responses are specified for an operation, the SDK may also thr ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; -using System; using Clerk.BackendAPI.Models.Errors; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -434,8 +440,6 @@ catch (Exception ex) The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(serverUrl: "https://api.clerk.com/v1"); diff --git a/RELEASES.md b/RELEASES.md index 573fc96..fe591da 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -28,4 +28,14 @@ Based on: ### Generated - [csharp v0.2.4] . ### Releases -- [NuGet v0.2.4] https://www.nuget.org/packages/Clerk.BackendAPI/0.2.4 - . \ No newline at end of file +- [NuGet v0.2.4] https://www.nuget.org/packages/Clerk.BackendAPI/0.2.4 - . + +## 2025-01-23 22:02:03 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.473.0 (2.495.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [csharp v0.3.0] . +### Releases +- [NuGet v0.3.0] https://www.nuget.org/packages/Clerk.BackendAPI/0.3.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index f7dec19..b4df281 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,7 +1,6 @@ ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/Models/Components/EmailAddress.md b/docs/Models/Components/EmailAddress.md index 3a735ca..60f6305 100644 --- a/docs/Models/Components/EmailAddress.md +++ b/docs/Models/Components/EmailAddress.md @@ -13,5 +13,6 @@ Success | `Reserved` | *bool* | :heavy_check_mark: | N/A | false | | `Verification` | [Verification](../../Models/Components/Verification.md) | :heavy_check_mark: | N/A | {
"status": "verified",
"strategy": "admin"
} | | `LinkedTo` | List<[IdentificationLink](../../Models/Components/IdentificationLink.md)> | :heavy_check_mark: | N/A | [
{
"type": "oauth_google",
"id": "link_12345"
}
] | +| `MatchesSsoConnection` | *bool* | :heavy_minus_sign: | Indicates whether this email address domain matches an active enterprise connection.
| | | `CreatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation
| 1615458901 | | `UpdatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation
| 1615459001 | \ No newline at end of file diff --git a/docs/Models/Components/FromOAuth.md b/docs/Models/Components/FromOAuth.md new file mode 100644 index 0000000..2b7fc01 --- /dev/null +++ b/docs/Models/Components/FromOAuth.md @@ -0,0 +1,12 @@ +# FromOAuth + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Status` | [FromOAuthVerificationStatus](../../Models/Components/FromOAuthVerificationStatus.md) | :heavy_check_mark: | N/A | +| `Strategy` | *string* | :heavy_check_mark: | N/A | +| `Error` | [Error](../../Models/Components/Error.md) | :heavy_minus_sign: | N/A | +| `ExpireAt` | *long* | :heavy_check_mark: | N/A | +| `Attempts` | *long* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/FromOAuthVerificationStatus.md b/docs/Models/Components/FromOAuthVerificationStatus.md new file mode 100644 index 0000000..69b568d --- /dev/null +++ b/docs/Models/Components/FromOAuthVerificationStatus.md @@ -0,0 +1,9 @@ +# FromOAuthVerificationStatus + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Unverified` | unverified | +| `Verified` | verified | \ No newline at end of file diff --git a/docs/Models/Components/Instance.md b/docs/Models/Components/Instance.md new file mode 100644 index 0000000..859050f --- /dev/null +++ b/docs/Models/Components/Instance.md @@ -0,0 +1,13 @@ +# Instance + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Object` | [InstanceObject](../../Models/Components/InstanceObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value. | | +| `Id` | *string* | :heavy_minus_sign: | N/A | | +| `EnvironmentType` | *string* | :heavy_minus_sign: | N/A | development | +| `AllowedOrigins` | List<*string*> | :heavy_minus_sign: | N/A | [
"http://localhost:3000",
"https://some-domain"
] | \ No newline at end of file diff --git a/docs/Models/Components/InstanceObject.md b/docs/Models/Components/InstanceObject.md new file mode 100644 index 0000000..c48bb84 --- /dev/null +++ b/docs/Models/Components/InstanceObject.md @@ -0,0 +1,10 @@ +# InstanceObject + +String representing the object's type. Objects of the same type share the same value. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Instance` | instance | \ No newline at end of file diff --git a/docs/Models/Components/WellKnownJWKS.md b/docs/Models/Components/Jwks.md similarity index 97% rename from docs/Models/Components/WellKnownJWKS.md rename to docs/Models/Components/Jwks.md index 2bbedbe..2bcd8ad 100644 --- a/docs/Models/Components/WellKnownJWKS.md +++ b/docs/Models/Components/Jwks.md @@ -1,4 +1,4 @@ -# WellKnownJWKS +# Jwks Get the JSON Web Key Set diff --git a/docs/Models/Components/Keys.md b/docs/Models/Components/Keys.md index 4f0b00e..c2fb811 100644 --- a/docs/Models/Components/Keys.md +++ b/docs/Models/Components/Keys.md @@ -10,4 +10,6 @@ | `Kid` | *string* | :heavy_minus_sign: | N/A | | `Alg` | *string* | :heavy_minus_sign: | N/A | | `N` | *string* | :heavy_minus_sign: | N/A | -| `E` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `E` | *string* | :heavy_minus_sign: | N/A | +| `X` | *string* | :heavy_minus_sign: | N/A | +| `Crv` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/OAuthApplication.md b/docs/Models/Components/OAuthApplication.md index 2ea826e..2a7288e 100644 --- a/docs/Models/Components/OAuthApplication.md +++ b/docs/Models/Components/OAuthApplication.md @@ -16,5 +16,7 @@ | `AuthorizeUrl` | *string* | :heavy_check_mark: | N/A | https://example.com/authorize | | `TokenFetchUrl` | *string* | :heavy_check_mark: | N/A | https://example.com/oauth/token | | `UserInfoUrl` | *string* | :heavy_check_mark: | N/A | https://example.com/userinfo | +| `DiscoveryUrl` | *string* | :heavy_check_mark: | N/A | | +| `TokenIntrospectionUrl` | *string* | :heavy_check_mark: | N/A | | | `CreatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| 1609459200 | | `UpdatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| 1612137600 | \ No newline at end of file diff --git a/docs/Models/Components/OAuthApplicationWithSecret.md b/docs/Models/Components/OAuthApplicationWithSecret.md index d447e32..6910655 100644 --- a/docs/Models/Components/OAuthApplicationWithSecret.md +++ b/docs/Models/Components/OAuthApplicationWithSecret.md @@ -16,6 +16,8 @@ | `AuthorizeUrl` | *string* | :heavy_check_mark: | N/A | https://example.com/authorize | | `TokenFetchUrl` | *string* | :heavy_check_mark: | N/A | https://example.com/oauth/token | | `UserInfoUrl` | *string* | :heavy_check_mark: | N/A | https://example.com/userinfo | +| `DiscoveryUrl` | *string* | :heavy_check_mark: | N/A | | +| `TokenIntrospectionUrl` | *string* | :heavy_check_mark: | N/A | | | `CreatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| 1609459200 | | `UpdatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| 1612137600 | | `ClientSecret` | *string* | :heavy_minus_sign: | Empty if public client.
| secretXYZ123 | \ No newline at end of file diff --git a/docs/Models/Components/Oauth.md b/docs/Models/Components/Oauth.md deleted file mode 100644 index f1d9c83..0000000 --- a/docs/Models/Components/Oauth.md +++ /dev/null @@ -1,13 +0,0 @@ -# Oauth - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `Status` | [OauthVerificationStatus](../../Models/Components/OauthVerificationStatus.md) | :heavy_check_mark: | N/A | verified | -| `Strategy` | [OauthVerificationStrategy](../../Models/Components/OauthVerificationStrategy.md) | :heavy_check_mark: | N/A | oauth_google | -| `ExternalVerificationRedirectUrl` | *string* | :heavy_minus_sign: | N/A | https://oauth.google.com/verify | -| `Error` | [Error](../../Models/Components/Error.md) | :heavy_minus_sign: | N/A | | -| `ExpireAt` | *long* | :heavy_check_mark: | N/A | 1615462399 | -| `Attempts` | *long* | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/Models/Components/OauthVerificationStatus.md b/docs/Models/Components/OauthVerificationStatus.md deleted file mode 100644 index f83bfc2..0000000 --- a/docs/Models/Components/OauthVerificationStatus.md +++ /dev/null @@ -1,12 +0,0 @@ -# OauthVerificationStatus - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `Unverified` | unverified | -| `Verified` | verified | -| `Failed` | failed | -| `Expired` | expired | -| `Transferable` | transferable | \ No newline at end of file diff --git a/docs/Models/Components/OauthVerificationStrategy.md b/docs/Models/Components/OauthVerificationStrategy.md deleted file mode 100644 index 44b7a40..0000000 --- a/docs/Models/Components/OauthVerificationStrategy.md +++ /dev/null @@ -1,17 +0,0 @@ -# OauthVerificationStrategy - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `OauthGoogle` | oauth_google | -| `OauthMock` | oauth_mock | -| `FromOauthGoogle` | from_oauth_google | -| `FromOauthDiscord` | from_oauth_discord | -| `FromOauthMicrosoft` | from_oauth_microsoft | -| `OauthApple` | oauth_apple | -| `OauthMicrosoft` | oauth_microsoft | -| `OauthGithub` | oauth_github | -| `EmailLink` | email_link | -| `Ticket` | ticket | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationInvitation.md b/docs/Models/Components/OrganizationInvitation.md index a3a0fbf..02761f4 100644 --- a/docs/Models/Components/OrganizationInvitation.md +++ b/docs/Models/Components/OrganizationInvitation.md @@ -16,5 +16,7 @@ An organization invitation | `Status` | *string* | :heavy_minus_sign: | N/A | pending | | `PublicMetadata` | Dictionary | :heavy_minus_sign: | N/A | {
"key": "value"
} | | `PrivateMetadata` | Dictionary | :heavy_minus_sign: | N/A | {
"private_key": "secret_value"
} | +| `Url` | *string* | :heavy_minus_sign: | N/A | | +| `ExpiresAt` | *long* | :heavy_minus_sign: | Unix timestamp of expiration.
| | | `CreatedAt` | *long* | :heavy_minus_sign: | Unix timestamp of creation. | 1622547600 | | `UpdatedAt` | *long* | :heavy_minus_sign: | Unix timestamp of last update. | 1622551200 | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationInvitationWithPublicOrganizationData.md b/docs/Models/Components/OrganizationInvitationWithPublicOrganizationData.md index 44b8039..89e2b45 100644 --- a/docs/Models/Components/OrganizationInvitationWithPublicOrganizationData.md +++ b/docs/Models/Components/OrganizationInvitationWithPublicOrganizationData.md @@ -16,6 +16,7 @@ An organization invitation with public organization data populated | `Status` | *string* | :heavy_minus_sign: | N/A | | `PublicMetadata` | Dictionary | :heavy_minus_sign: | N/A | | `PrivateMetadata` | Dictionary | :heavy_minus_sign: | N/A | +| `Url` | *string* | :heavy_minus_sign: | N/A | | `PublicOrganizationData` | [PublicOrganizationData](../../Models/Components/PublicOrganizationData.md) | :heavy_minus_sign: | N/A | | `CreatedAt` | *long* | :heavy_minus_sign: | Unix timestamp of creation. | | `UpdatedAt` | *long* | :heavy_minus_sign: | Unix timestamp of last update. | \ No newline at end of file diff --git a/docs/Models/Components/SchemasSAMLConnection.md b/docs/Models/Components/SchemasSAMLConnection.md index d055a05..cc7672c 100644 --- a/docs/Models/Components/SchemasSAMLConnection.md +++ b/docs/Models/Components/SchemasSAMLConnection.md @@ -17,6 +17,7 @@ | `AcsUrl` | *string* | :heavy_check_mark: | N/A | | `SpEntityId` | *string* | :heavy_check_mark: | N/A | | `SpMetadataUrl` | *string* | :heavy_check_mark: | N/A | +| `OrganizationId` | *string* | :heavy_minus_sign: | N/A | | `AttributeMapping` | [Models.Components.AttributeMapping](../../Models/Components/AttributeMapping.md) | :heavy_minus_sign: | N/A | | `Active` | *bool* | :heavy_check_mark: | N/A | | `Provider` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/SignUp.md b/docs/Models/Components/SignUp.md index 9fcedb3..2bc32e9 100644 --- a/docs/Models/Components/SignUp.md +++ b/docs/Models/Components/SignUp.md @@ -5,28 +5,29 @@ Success ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `Object` | [SignUpObject](../../Models/Components/SignUpObject.md) | :heavy_check_mark: | N/A | sign_up_attempt | -| `Id` | *string* | :heavy_check_mark: | N/A | signup_1234567890abcdef | -| `Status` | [SignUpStatus](../../Models/Components/SignUpStatus.md) | :heavy_check_mark: | N/A | complete | -| `RequiredFields` | List<*string*> | :heavy_minus_sign: | N/A | [
"email_address"
] | -| `OptionalFields` | List<*string*> | :heavy_minus_sign: | N/A | [
"first_name",
"last_name"
] | -| `MissingFields` | List<*string*> | :heavy_minus_sign: | N/A | [
"phone_number"
] | -| `UnverifiedFields` | List<*string*> | :heavy_minus_sign: | N/A | [
"email_address"
] | -| `Verifications` | [Verifications](../../Models/Components/Verifications.md) | :heavy_minus_sign: | N/A | | -| `Username` | *string* | :heavy_minus_sign: | N/A | user_123456 | -| `EmailAddress` | *string* | :heavy_minus_sign: | N/A | user@example.com | -| `PhoneNumber` | *string* | :heavy_minus_sign: | N/A | +1234567890 | -| `Web3Wallet` | *string* | :heavy_minus_sign: | N/A | 0x1234567890abcdef1234567890abcdef12345678 | -| `PasswordEnabled` | *bool* | :heavy_check_mark: | N/A | true | -| `FirstName` | *string* | :heavy_minus_sign: | N/A | John | -| `LastName` | *string* | :heavy_minus_sign: | N/A | Doe | -| `UnsafeMetadata` | Dictionary | :heavy_minus_sign: | N/A | | -| `PublicMetadata` | Dictionary | :heavy_minus_sign: | N/A | | -| `CustomAction` | *bool* | :heavy_check_mark: | N/A | false | -| `ExternalId` | *string* | :heavy_minus_sign: | N/A | ext_id_7890abcdef123456 | -| `CreatedSessionId` | *string* | :heavy_minus_sign: | N/A | sess_1234567890abcdef | -| `CreatedUserId` | *string* | :heavy_minus_sign: | N/A | user_1234567890abcdef | -| `AbandonAt` | *long* | :heavy_check_mark: | N/A | 1609459200 | -| `ExternalAccount` | [ExternalAccount](../../Models/Components/ExternalAccount.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Object` | [SignUpObject](../../Models/Components/SignUpObject.md) | :heavy_check_mark: | N/A | sign_up_attempt | +| `Id` | *string* | :heavy_check_mark: | N/A | signup_1234567890abcdef | +| `Status` | [SignUpStatus](../../Models/Components/SignUpStatus.md) | :heavy_check_mark: | N/A | complete | +| `RequiredFields` | List<*string*> | :heavy_minus_sign: | N/A | [
"email_address"
] | +| `OptionalFields` | List<*string*> | :heavy_minus_sign: | N/A | [
"first_name",
"last_name"
] | +| `MissingFields` | List<*string*> | :heavy_minus_sign: | N/A | [
"phone_number"
] | +| `UnverifiedFields` | List<*string*> | :heavy_minus_sign: | N/A | [
"email_address"
] | +| `Verifications` | [Verifications](../../Models/Components/Verifications.md) | :heavy_minus_sign: | N/A | | +| `Username` | *string* | :heavy_minus_sign: | N/A | user_123456 | +| `EmailAddress` | *string* | :heavy_minus_sign: | N/A | user@example.com | +| `PhoneNumber` | *string* | :heavy_minus_sign: | N/A | +1234567890 | +| `Web3Wallet` | *string* | :heavy_minus_sign: | N/A | 0x1234567890abcdef1234567890abcdef12345678 | +| `PasswordEnabled` | *bool* | :heavy_check_mark: | N/A | true | +| `FirstName` | *string* | :heavy_minus_sign: | N/A | John | +| `LastName` | *string* | :heavy_minus_sign: | N/A | Doe | +| `UnsafeMetadata` | Dictionary | :heavy_minus_sign: | N/A | | +| `PublicMetadata` | Dictionary | :heavy_minus_sign: | N/A | | +| `CustomAction` | *bool* | :heavy_check_mark: | N/A | false | +| `ExternalId` | *string* | :heavy_minus_sign: | N/A | ext_id_7890abcdef123456 | +| `CreatedSessionId` | *string* | :heavy_minus_sign: | N/A | sess_1234567890abcdef | +| `CreatedUserId` | *string* | :heavy_minus_sign: | N/A | user_1234567890abcdef | +| `AbandonAt` | *long* | :heavy_check_mark: | N/A | 1609459200 | +| `LegalAcceptedAt` | *long* | :heavy_minus_sign: | Unix timestamp at which the user accepted the legal requirements.
| 1700690400000 | +| `ExternalAccount` | [ExternalAccount](../../Models/Components/ExternalAccount.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/Type.md b/docs/Models/Components/Type.md index e759335..d0762fe 100644 --- a/docs/Models/Components/Type.md +++ b/docs/Models/Components/Type.md @@ -8,8 +8,7 @@ | `OauthGoogle` | oauth_google | | `OauthMock` | oauth_mock | | `Saml` | saml | -| `OauthMicrosoft` | oauth_microsoft | -| `EmailLink` | email_link | | `OauthApple` | oauth_apple | | `OauthDiscord` | oauth_discord | +| `OauthMicrosoft` | oauth_microsoft | | `OauthGithub` | oauth_github | \ No newline at end of file diff --git a/docs/Models/Components/Verification.md b/docs/Models/Components/Verification.md index dc98a44..baa5dfd 100644 --- a/docs/Models/Components/Verification.md +++ b/docs/Models/Components/Verification.md @@ -15,8 +15,8 @@ Verification.CreateOtp(/* values here */); Verification.CreateAdmin(/* values here */); ``` -### Oauth +### FromOAuth ```csharp -Verification.CreateOauth(/* values here */); +Verification.CreateFromOAuth(/* values here */); ``` diff --git a/docs/Models/Components/WaitlistEntries.md b/docs/Models/Components/WaitlistEntries.md new file mode 100644 index 0000000..9e0257a --- /dev/null +++ b/docs/Models/Components/WaitlistEntries.md @@ -0,0 +1,11 @@ +# WaitlistEntries + +List of waitlist entries + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Data` | List<[WaitlistEntry](../../Models/Components/WaitlistEntry.md)> | :heavy_check_mark: | N/A | +| `TotalCount` | *long* | :heavy_check_mark: | Total number of waitlist entries | \ No newline at end of file diff --git a/docs/Models/Components/WaitlistEntry.md b/docs/Models/Components/WaitlistEntry.md new file mode 100644 index 0000000..f0a9b39 --- /dev/null +++ b/docs/Models/Components/WaitlistEntry.md @@ -0,0 +1,15 @@ +# WaitlistEntry + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `Object` | [WaitlistEntryObject](../../Models/Components/WaitlistEntryObject.md) | :heavy_check_mark: | N/A | | +| `Id` | *string* | :heavy_check_mark: | N/A | | +| `EmailAddress` | *string* | :heavy_check_mark: | N/A | | +| `Status` | [WaitlistEntryStatus](../../Models/Components/WaitlistEntryStatus.md) | :heavy_check_mark: | N/A | pending | +| `IsLocked` | *bool* | :heavy_minus_sign: | Indicates if the waitlist entry is locked. Locked entries are being processed in a batch action and are unavailable for other actions.
| | +| `CreatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| | +| `UpdatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| | +| `Invitation` | [WaitlistEntryInvitation](../../Models/Components/WaitlistEntryInvitation.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/WaitlistEntryInvitation.md b/docs/Models/Components/WaitlistEntryInvitation.md new file mode 100644 index 0000000..9b043de --- /dev/null +++ b/docs/Models/Components/WaitlistEntryInvitation.md @@ -0,0 +1,17 @@ +# WaitlistEntryInvitation + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `Object` | [WaitlistEntryInvitationObject](../../Models/Components/WaitlistEntryInvitationObject.md) | :heavy_check_mark: | N/A | invitation | +| `Id` | *string* | :heavy_check_mark: | N/A | inv_f02930r3 | +| `EmailAddress` | *string* | :heavy_check_mark: | N/A | invitee@example.com | +| `PublicMetadata` | Dictionary | :heavy_minus_sign: | N/A | {} | +| `Revoked` | *bool* | :heavy_minus_sign: | N/A | false | +| `Status` | [WaitlistEntryInvitationStatus](../../Models/Components/WaitlistEntryInvitationStatus.md) | :heavy_check_mark: | N/A | pending | +| `Url` | *string* | :heavy_minus_sign: | N/A | https://example.com/invitations/accept?code=abcd1234 | +| `ExpiresAt` | *long* | :heavy_minus_sign: | Unix timestamp of expiration.
| | +| `CreatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| 1622549600 | +| `UpdatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| 1622553200 | \ No newline at end of file diff --git a/docs/Models/Components/WaitlistEntryInvitationObject.md b/docs/Models/Components/WaitlistEntryInvitationObject.md new file mode 100644 index 0000000..8c44a49 --- /dev/null +++ b/docs/Models/Components/WaitlistEntryInvitationObject.md @@ -0,0 +1,8 @@ +# WaitlistEntryInvitationObject + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Invitation` | invitation | \ No newline at end of file diff --git a/docs/Models/Components/WaitlistEntryInvitationStatus.md b/docs/Models/Components/WaitlistEntryInvitationStatus.md new file mode 100644 index 0000000..9b513e9 --- /dev/null +++ b/docs/Models/Components/WaitlistEntryInvitationStatus.md @@ -0,0 +1,11 @@ +# WaitlistEntryInvitationStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Pending` | pending | +| `Accepted` | accepted | +| `Revoked` | revoked | +| `Expired` | expired | \ No newline at end of file diff --git a/docs/Models/Components/WaitlistEntryObject.md b/docs/Models/Components/WaitlistEntryObject.md new file mode 100644 index 0000000..147d06b --- /dev/null +++ b/docs/Models/Components/WaitlistEntryObject.md @@ -0,0 +1,8 @@ +# WaitlistEntryObject + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `WaitlistEntry` | waitlist_entry | \ No newline at end of file diff --git a/docs/Models/Components/WaitlistEntryStatus.md b/docs/Models/Components/WaitlistEntryStatus.md new file mode 100644 index 0000000..2e31194 --- /dev/null +++ b/docs/Models/Components/WaitlistEntryStatus.md @@ -0,0 +1,11 @@ +# WaitlistEntryStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `Pending` | pending | +| `Invited` | invited | +| `Rejected` | rejected | +| `Completed` | completed | \ No newline at end of file diff --git a/docs/Models/Components/Web3SignatureVerificationStrategy.md b/docs/Models/Components/Web3SignatureVerificationStrategy.md index 92ca751..f7b9c5a 100644 --- a/docs/Models/Components/Web3SignatureVerificationStrategy.md +++ b/docs/Models/Components/Web3SignatureVerificationStrategy.md @@ -6,4 +6,5 @@ | Name | Value | | ------------------------------ | ------------------------------ | | `Web3MetamaskSignature` | web3_metamask_signature | -| `Web3CoinbaseWalletSignature` | web3_coinbase_wallet_signature | \ No newline at end of file +| `Web3CoinbaseWalletSignature` | web3_coinbase_wallet_signature | +| `Web3OkxWalletSignature` | web3_okx_wallet_signature | \ No newline at end of file diff --git a/docs/Models/Operations/CreateBulkInvitationsResponse.md b/docs/Models/Operations/CreateBulkInvitationsResponse.md new file mode 100644 index 0000000..ece9a3c --- /dev/null +++ b/docs/Models/Operations/CreateBulkInvitationsResponse.md @@ -0,0 +1,9 @@ +# CreateBulkInvitationsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `HttpMeta` | [HTTPMetadata](../../Models/Components/HTTPMetadata.md) | :heavy_check_mark: | N/A | +| `InvitationList` | List<[Invitation](../../Models/Components/Invitation.md)> | :heavy_minus_sign: | List of invitations | \ No newline at end of file diff --git a/docs/Models/Operations/CreateInvitationRequestBody.md b/docs/Models/Operations/CreateInvitationRequestBody.md index c53fa8d..d4d18ce 100644 --- a/docs/Models/Operations/CreateInvitationRequestBody.md +++ b/docs/Models/Operations/CreateInvitationRequestBody.md @@ -10,6 +10,7 @@ Required parameters | `EmailAddress` | *string* | :heavy_check_mark: | The email address the invitation will be sent to | user@example.com | | `PublicMetadata` | Dictionary | :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. | {} | | `RedirectUrl` | *string* | :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` | *bool* | :heavy_minus_sign: | Optional flag which denotes whether an email invitation should be sent to the given email address.
Defaults to true. | true | +| `Notify` | *bool* | :heavy_minus_sign: | Optional flag which denotes whether an email invitation should be sent to the given email address.
Defaults to `true`. | true | | `IgnoreExisting` | *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 | -| `ExpiresInDays` | *long* | :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 +| `ExpiresInDays` | *long* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation expires after 30 days. | | +| `TemplateSlug` | [TemplateSlug](../../Models/Operations/TemplateSlug.md) | :heavy_minus_sign: | The slug of the email template to use for the invitation email.
If not provided, the "invitation" template will be used. | | \ No newline at end of file diff --git a/docs/Models/Operations/CreateOAuthApplicationRequestBody.md b/docs/Models/Operations/CreateOAuthApplicationRequestBody.md index 315b6f3..e8bcdf3 100644 --- a/docs/Models/Operations/CreateOAuthApplicationRequestBody.md +++ b/docs/Models/Operations/CreateOAuthApplicationRequestBody.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Name` | *string* | :heavy_check_mark: | The name of the new OAuth application | Example App | -| `CallbackUrl` | *string* | :heavy_check_mark: | The callback URL of the new OAuth application | https://example.com/oauth/callback | +| `CallbackUrl` | *string* | :heavy_minus_sign: | The callback URL of the new OAuth application | https://example.com/oauth/callback | | `Scopes` | *string* | :heavy_minus_sign: | Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. | profile email public_metadata | | `Public` | *bool* | :heavy_minus_sign: | If true, this client is public and cannot securely store a client secret.
Only the authorization code flow with proof key for code exchange (PKCE) may be used.
Public clients cannot be updated to be confidential clients, and vice versa. | true | \ No newline at end of file diff --git a/docs/Models/Operations/CreateOrganizationInvitationBulkRequest.md b/docs/Models/Operations/CreateOrganizationInvitationBulkRequest.md index 2b55898..9971d39 100644 --- a/docs/Models/Operations/CreateOrganizationInvitationBulkRequest.md +++ b/docs/Models/Operations/CreateOrganizationInvitationBulkRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `OrganizationId` | *string* | :heavy_check_mark: | The organization ID. | org_12345 | -| `RequestBody` | List<[RequestBody](../../Models/Operations/RequestBody.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `OrganizationId` | *string* | :heavy_check_mark: | The organization ID. | org_12345 | +| `RequestBody` | List<[CreateOrganizationInvitationBulkRequestBody](../../Models/Operations/CreateOrganizationInvitationBulkRequestBody.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/CreateOrganizationInvitationBulkRequestBody.md b/docs/Models/Operations/CreateOrganizationInvitationBulkRequestBody.md new file mode 100644 index 0000000..373fef5 --- /dev/null +++ b/docs/Models/Operations/CreateOrganizationInvitationBulkRequestBody.md @@ -0,0 +1,13 @@ +# CreateOrganizationInvitationBulkRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `EmailAddress` | *string* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | newmember@example.com | +| `InviterUserId` | *string* | :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 | +| `Role` | *string* | :heavy_check_mark: | The role of the new member in the organization. | admin | +| `PublicMetadata` | Dictionary | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {} | +| `PrivateMetadata` | Dictionary | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {} | +| `RedirectUrl` | *string* | :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/Operations/CreateOrganizationInvitationRequest.md b/docs/Models/Operations/CreateOrganizationInvitationRequest.md index 3b6ab7d..cafeffd 100644 --- a/docs/Models/Operations/CreateOrganizationInvitationRequest.md +++ b/docs/Models/Operations/CreateOrganizationInvitationRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `OrganizationId` | *string* | :heavy_check_mark: | The ID of the organization for which to send the invitation | org_12345 | -| `RequestBody` | [CreateOrganizationInvitationRequestBody](../../Models/Operations/CreateOrganizationInvitationRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [CreateOrganizationInvitationRequestBody](../../Models/Operations/CreateOrganizationInvitationRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/CreateOrganizationInvitationRequestBody.md b/docs/Models/Operations/CreateOrganizationInvitationRequestBody.md index 10c3dbe..c3a9458 100644 --- a/docs/Models/Operations/CreateOrganizationInvitationRequestBody.md +++ b/docs/Models/Operations/CreateOrganizationInvitationRequestBody.md @@ -3,11 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `EmailAddress` | *string* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | user@example.com | -| `InviterUserId` | *string* | :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 | -| `Role` | *string* | :heavy_check_mark: | The role of the new member in the organization | admin | -| `PublicMetadata` | Dictionary | :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"
} | -| `PrivateMetadata` | Dictionary | :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"
} | -| `RedirectUrl` | *string* | :heavy_minus_sign: | Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. | https://example.com/welcome | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `EmailAddress` | *string* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | user@example.com | +| `InviterUserId` | *string* | :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 | +| `Role` | *string* | :heavy_check_mark: | The role of the new member in the organization | admin | +| `PublicMetadata` | Dictionary | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {
"key": "value"
} | +| `PrivateMetadata` | Dictionary | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.
When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. | {
"private_key": "secret_value"
} | +| `RedirectUrl` | *string* | :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 | +| `ExpiresInDays` | *long* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation has a 30 days expire. | | \ No newline at end of file diff --git a/docs/Models/Operations/CreateOrganizationRequestBody.md b/docs/Models/Operations/CreateOrganizationRequestBody.md index d0a5e62..3066217 100644 --- a/docs/Models/Operations/CreateOrganizationRequestBody.md +++ b/docs/Models/Operations/CreateOrganizationRequestBody.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `Name` | *string* | :heavy_check_mark: | The name of the new organization.
May not contain URLs or HTML. | NewOrg | -| `CreatedBy` | *string* | :heavy_check_mark: | The ID of the User who will become the administrator for the new organization | user_123 | +| `CreatedBy` | *string* | :heavy_minus_sign: | The ID of the User who will become the administrator for the new organization | user_123 | | `PrivateMetadata` | Dictionary | :heavy_minus_sign: | Metadata saved on the organization, accessible only from the Backend API | {
"internal_code": "ABC123"
} | | `PublicMetadata` | Dictionary | :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` | *string* | :heavy_minus_sign: | A slug for the new organization.
Can contain only lowercase alphanumeric characters and the dash "-".
Must be unique for the instance. | neworg | diff --git a/docs/Models/Operations/CreateSAMLConnectionRequestBody.md b/docs/Models/Operations/CreateSAMLConnectionRequestBody.md index ae699da..5b817ed 100644 --- a/docs/Models/Operations/CreateSAMLConnectionRequestBody.md +++ b/docs/Models/Operations/CreateSAMLConnectionRequestBody.md @@ -13,4 +13,5 @@ | `IdpCertificate` | *string* | :heavy_minus_sign: | The X.509 certificate as provided by the IdP | MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT... | | `IdpMetadataUrl` | *string* | :heavy_minus_sign: | The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties | http://idp.example.org/metadata.xml | | `IdpMetadata` | *string* | :heavy_minus_sign: | The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties | Defaults to `true`. | \ No newline at end of file diff --git a/docs/Models/Operations/CreateWaitlistEntryResponse.md b/docs/Models/Operations/CreateWaitlistEntryResponse.md new file mode 100644 index 0000000..c4d029b --- /dev/null +++ b/docs/Models/Operations/CreateWaitlistEntryResponse.md @@ -0,0 +1,9 @@ +# CreateWaitlistEntryResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `HttpMeta` | [HTTPMetadata](../../Models/Components/HTTPMetadata.md) | :heavy_check_mark: | N/A | +| `WaitlistEntry` | [WaitlistEntry](../../Models/Components/WaitlistEntry.md) | :heavy_minus_sign: | A Waitlist Entry | \ No newline at end of file diff --git a/docs/Models/Operations/GetInstanceResponse.md b/docs/Models/Operations/GetInstanceResponse.md new file mode 100644 index 0000000..8deb555 --- /dev/null +++ b/docs/Models/Operations/GetInstanceResponse.md @@ -0,0 +1,9 @@ +# GetInstanceResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `HttpMeta` | [HTTPMetadata](../../Models/Components/HTTPMetadata.md) | :heavy_check_mark: | N/A | +| `Instance` | [Instance](../../Models/Components/Instance.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/Models/Operations/GetJWKSResponse.md b/docs/Models/Operations/GetJWKSResponse.md index 262a836..82bc13f 100644 --- a/docs/Models/Operations/GetJWKSResponse.md +++ b/docs/Models/Operations/GetJWKSResponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | | `HttpMeta` | [HTTPMetadata](../../Models/Components/HTTPMetadata.md) | :heavy_check_mark: | N/A | -| `WellKnownJWKS` | [WellKnownJWKS](../../Models/Components/WellKnownJWKS.md) | :heavy_minus_sign: | Get the JSON Web Key Set | \ No newline at end of file +| `Jwks` | [Models.Components.Jwks](../../Models/Components/Jwks.md) | :heavy_minus_sign: | Get the JSON Web Key Set | \ No newline at end of file diff --git a/docs/Models/Operations/GetUserListRequest.md b/docs/Models/Operations/GetUserListRequest.md index 475332e..d28c665 100644 --- a/docs/Models/Operations/GetUserListRequest.md +++ b/docs/Models/Operations/GetUserListRequest.md @@ -13,7 +13,15 @@ | `UserId` | List<*string*> | :heavy_minus_sign: | Returns users with the user ids specified.
For each user id, the `+` and `-` can be
prepended to the id, which denote whether the
respective user id should be included or
excluded from the result set.
Accepts up to 100 user ids.
Any user ids not found are ignored. | [
"user-id-123"
] | | `OrganizationId` | List<*string*> | :heavy_minus_sign: | Returns users that have memberships to the
given organizations.
For each organization id, the `+` and `-` can be
prepended to the id, which denote whether the
respective organization should be included or
excluded from the result set.
Accepts up to 100 organization ids. | [
"org-id-123"
] | | `Query` | *string* | :heavy_minus_sign: | Returns users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | John | -| `LastActiveAtSince` | *long* | :heavy_minus_sign: | Returns users that had session activity since the given date, with day precision.
Providing a value with higher precision than day will result in an error.
Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. | 1700690400000 | +| `EmailAddressQuery` | *string* | :heavy_minus_sign: | Returns users with emails that match the given query, via case-insensitive partial match.
For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. | | +| `PhoneNumberQuery` | *string* | :heavy_minus_sign: | Returns users with phone numbers that match the given query, via case-insensitive partial match.
For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. | | +| `UsernameQuery` | *string* | :heavy_minus_sign: | Returns users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. | | +| `NameQuery` | *string* | :heavy_minus_sign: | Returns users with names that match the given query, via case-insensitive partial match. | | +| `LastActiveAtBefore` | *long* | :heavy_minus_sign: | Returns users whose last session activity was before the given date (with millisecond precision).
Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. | 1700690400000 | +| `LastActiveAtAfter` | *long* | :heavy_minus_sign: | Returns users whose last session activity was after the given date (with millisecond precision).
Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. | 1700690400000 | +| ~~`LastActiveAtSince`~~ | *long* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Returns users that had session activity since the given date.
Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day.
Deprecated in favor of `last_active_at_after`. | 1700690400000 | +| `CreatedAtBefore` | *long* | :heavy_minus_sign: | Returns users who have been created before the given date (with millisecond precision).
Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. | 1730160000000 | +| `CreatedAtAfter` | *long* | :heavy_minus_sign: | Returns users who have been created after the given date (with millisecond precision).
Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. | 1730160000000 | | `Limit` | *long* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | | `Offset` | *long* | :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 | | `OrderBy` | *string* | :heavy_minus_sign: | Allows to return users in a particular order.
At the moment, you can order the returned users by their `created_at`,`updated_at`,`email_address`,`web3wallet`,`first_name`,`last_name`,`phone_number`,`username`,`last_active_at`,`last_sign_in_at`.
In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by.
For example, if you want users to be returned in descending order according to their `created_at` property, you can use `-created_at`.
If you don't use `+` or `-`, then `+` is implied. We only support one `order_by` parameter, and if multiple `order_by` parameters are provided, we will only keep the first one. For example,
if you pass `order_by=username&order_by=created_at`, we will consider only the first `order_by` parameter, which is `username`. The `created_at` parameter will be ignored in this case. | | \ No newline at end of file diff --git a/docs/Models/Operations/GetUsersCountRequest.md b/docs/Models/Operations/GetUsersCountRequest.md index c89bf9c..37cdc93 100644 --- a/docs/Models/Operations/GetUsersCountRequest.md +++ b/docs/Models/Operations/GetUsersCountRequest.md @@ -11,4 +11,7 @@ | `Username` | List<*string*> | :heavy_minus_sign: | Counts users with the specified usernames.
Accepts up to 100 usernames.
Any usernames not found are ignored. | [
"username123"
] | | `Web3Wallet` | List<*string*> | :heavy_minus_sign: | Counts users with the specified web3 wallet addresses.
Accepts up to 100 web3 wallet addresses.
Any web3 wallet addressed not found are ignored. | [
"0x123456789abcdef"
] | | `UserId` | List<*string*> | :heavy_minus_sign: | Counts users with the user ids specified.
Accepts up to 100 user ids.
Any user ids not found are ignored. | [
"user-id-123"
] | -| `Query` | *string* | :heavy_minus_sign: | Counts users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | John Doe | \ No newline at end of file +| `Query` | *string* | :heavy_minus_sign: | Counts users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | John Doe | +| `EmailAddressQuery` | *string* | :heavy_minus_sign: | Counts users with emails that match the given query, via case-insensitive partial match.
For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`,
and will be included in the resulting count. | | +| `PhoneNumberQuery` | *string* | :heavy_minus_sign: | Counts users with phone numbers that match the given query, via case-insensitive partial match.
For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`,
and will be included in the resulting count. | | +| `UsernameQuery` | *string* | :heavy_minus_sign: | Counts users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`,
and will be included in the resulting count. | | \ No newline at end of file diff --git a/docs/Models/Operations/ListInvitationsRequest.md b/docs/Models/Operations/ListInvitationsRequest.md index 641df4c..732397f 100644 --- a/docs/Models/Operations/ListInvitationsRequest.md +++ b/docs/Models/Operations/ListInvitationsRequest.md @@ -7,4 +7,5 @@ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `Limit` | *long* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | | `Offset` | *long* | :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` | [ListInvitationsQueryParamStatus](../../Models/Operations/ListInvitationsQueryParamStatus.md) | :heavy_minus_sign: | Filter invitations based on their status | pending | \ No newline at end of file +| `Status` | [ListInvitationsQueryParamStatus](../../Models/Operations/ListInvitationsQueryParamStatus.md) | :heavy_minus_sign: | Filter invitations based on their status | pending | +| `Query` | *string* | :heavy_minus_sign: | Filter invitations based on their `email_address` or `id` | | \ No newline at end of file diff --git a/docs/Models/Operations/ListSAMLConnectionsRequest.md b/docs/Models/Operations/ListSAMLConnectionsRequest.md index fcd9c44..bc159c9 100644 --- a/docs/Models/Operations/ListSAMLConnectionsRequest.md +++ b/docs/Models/Operations/ListSAMLConnectionsRequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `Limit` | *long* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | -| `Offset` | *long* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Limit` | *long* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | +| `Offset` | *long* | :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 | +| `OrganizationId` | List<*string*> | :heavy_minus_sign: | Returns SAML connections that have an associated organization ID to the
given organizations.
For each organization id, the `+` and `-` can be
prepended to the id, which denote whether the
respective organization should be included or
excluded from the result set.
Accepts up to 100 organization ids. | | \ No newline at end of file diff --git a/docs/Models/Operations/ListWaitlistEntriesQueryParamStatus.md b/docs/Models/Operations/ListWaitlistEntriesQueryParamStatus.md new file mode 100644 index 0000000..d5e02e5 --- /dev/null +++ b/docs/Models/Operations/ListWaitlistEntriesQueryParamStatus.md @@ -0,0 +1,13 @@ +# ListWaitlistEntriesQueryParamStatus + +Filter waitlist entries by their status + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `Pending` | pending | +| `Invited` | invited | +| `Completed` | completed | +| `Rejected` | rejected | \ No newline at end of file diff --git a/docs/Models/Operations/ListWaitlistEntriesRequest.md b/docs/Models/Operations/ListWaitlistEntriesRequest.md new file mode 100644 index 0000000..69e7d29 --- /dev/null +++ b/docs/Models/Operations/ListWaitlistEntriesRequest.md @@ -0,0 +1,12 @@ +# ListWaitlistEntriesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Limit` | *long* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | +| `Offset` | *long* | :heavy_minus_sign: | Skip the first `offset` results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with `limit`. | 10 | +| `Query` | *string* | :heavy_minus_sign: | Filter waitlist entries by email address | | +| `Status` | [ListWaitlistEntriesQueryParamStatus](../../Models/Operations/ListWaitlistEntriesQueryParamStatus.md) | :heavy_minus_sign: | Filter waitlist entries by their status | | +| `OrderBy` | *string* | :heavy_minus_sign: | Specify the order of results. Supported values are:
- `created_at`
- `email_address`
- `invited_at`

Use `+` for ascending or `-` for descending order. Defaults to `-created_at`. | | \ No newline at end of file diff --git a/docs/Models/Operations/ListWaitlistEntriesResponse.md b/docs/Models/Operations/ListWaitlistEntriesResponse.md new file mode 100644 index 0000000..fbb3445 --- /dev/null +++ b/docs/Models/Operations/ListWaitlistEntriesResponse.md @@ -0,0 +1,9 @@ +# ListWaitlistEntriesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `HttpMeta` | [HTTPMetadata](../../Models/Components/HTTPMetadata.md) | :heavy_check_mark: | N/A | +| `WaitlistEntries` | [Models.Components.WaitlistEntries](../../Models/Components/WaitlistEntries.md) | :heavy_minus_sign: | List of waitlist entries | \ No newline at end of file diff --git a/docs/Models/Operations/RequestBody.md b/docs/Models/Operations/RequestBody.md index 311f5b8..8f4a3f6 100644 --- a/docs/Models/Operations/RequestBody.md +++ b/docs/Models/Operations/RequestBody.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `EmailAddress` | *string* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | newmember@example.com | -| `InviterUserId` | *string* | :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 | -| `Role` | *string* | :heavy_check_mark: | The role of the new member in the organization. | admin | -| `PublicMetadata` | Dictionary | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. | {} | -| `PrivateMetadata` | Dictionary | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. | {} | -| `RedirectUrl` | *string* | :heavy_minus_sign: | Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. | https://example.com/welcome | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `EmailAddress` | *string* | :heavy_check_mark: | The email address the invitation will be sent to | +| `PublicMetadata` | Dictionary | :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. | +| `RedirectUrl` | *string* | :heavy_minus_sign: | The URL where the user is redirected upon visiting the invitation link, where they can accept the invitation. Required if you have implemented a [custom flow for handling application invitations](/docs/custom-flows/invitations). | +| `Notify` | *bool* | :heavy_minus_sign: | Optional flag which denotes whether an email invitation should be sent to the given email address.
Defaults to true. | +| `IgnoreExisting` | *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. | +| `ExpiresInDays` | *long* | :heavy_minus_sign: | The number of days the invitation will be valid for. By default, the invitation expires after 30 days. | \ No newline at end of file diff --git a/docs/Models/Operations/ResponseBody.md b/docs/Models/Operations/ResponseBody.md index 5e75747..3959828 100644 --- a/docs/Models/Operations/ResponseBody.md +++ b/docs/Models/Operations/ResponseBody.md @@ -13,4 +13,5 @@ | `PublicMetadata` | Dictionary | :heavy_minus_sign: | N/A | {} | | `Label` | *string* | :heavy_minus_sign: | N/A | Primary account | | `Scopes` | List<*string*> | :heavy_minus_sign: | The list of scopes that the token is valid for.
Only present for OAuth 2.0 tokens. | [
"email",
"profile"
] | -| `TokenSecret` | *string* | :heavy_minus_sign: | The token secret. Only present for OAuth 1.0 tokens. | token_secret_xyz | \ No newline at end of file +| `TokenSecret` | *string* | :heavy_minus_sign: | The token secret. Only present for OAuth 1.0 tokens. | token_secret_xyz | +| `ExpiresAt` | *long* | :heavy_minus_sign: | Unix timestamp of the access token expiration. | | \ No newline at end of file diff --git a/docs/Models/Operations/TemplateSlug.md b/docs/Models/Operations/TemplateSlug.md new file mode 100644 index 0000000..32a5889 --- /dev/null +++ b/docs/Models/Operations/TemplateSlug.md @@ -0,0 +1,12 @@ +# TemplateSlug + +The slug of the email template to use for the invitation email. +If not provided, the "invitation" template will be used. + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `Invitation` | invitation | +| `WaitlistInvitation` | waitlist_invitation | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateEmailAddressRequest.md b/docs/Models/Operations/UpdateEmailAddressRequest.md index 0686c00..5631c8a 100644 --- a/docs/Models/Operations/UpdateEmailAddressRequest.md +++ b/docs/Models/Operations/UpdateEmailAddressRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | `EmailAddressId` | *string* | :heavy_check_mark: | The ID of the email address to update | email_address_id_example | -| `RequestBody` | [UpdateEmailAddressRequestBody](../../Models/Operations/UpdateEmailAddressRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [UpdateEmailAddressRequestBody](../../Models/Operations/UpdateEmailAddressRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateJWTTemplateRequest.md b/docs/Models/Operations/UpdateJWTTemplateRequest.md index b2c6496..798da3c 100644 --- a/docs/Models/Operations/UpdateJWTTemplateRequest.md +++ b/docs/Models/Operations/UpdateJWTTemplateRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | `TemplateId` | *string* | :heavy_check_mark: | The ID of the JWT template to update | -| `RequestBody` | [UpdateJWTTemplateRequestBody](../../Models/Operations/UpdateJWTTemplateRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| `RequestBody` | [UpdateJWTTemplateRequestBody](../../Models/Operations/UpdateJWTTemplateRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateOrganizationMembershipMetadataRequest.md b/docs/Models/Operations/UpdateOrganizationMembershipMetadataRequest.md index 4c53fac..d2ca8da 100644 --- a/docs/Models/Operations/UpdateOrganizationMembershipMetadataRequest.md +++ b/docs/Models/Operations/UpdateOrganizationMembershipMetadataRequest.md @@ -7,4 +7,4 @@ | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `OrganizationId` | *string* | :heavy_check_mark: | The ID of the organization the membership belongs to | org_123456 | | `UserId` | *string* | :heavy_check_mark: | The ID of the user that this membership belongs to | user_654321 | -| `RequestBody` | [UpdateOrganizationMembershipMetadataRequestBody](../../Models/Operations/UpdateOrganizationMembershipMetadataRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [UpdateOrganizationMembershipMetadataRequestBody](../../Models/Operations/UpdateOrganizationMembershipMetadataRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdatePhoneNumberRequest.md b/docs/Models/Operations/UpdatePhoneNumberRequest.md index f16052c..71ab133 100644 --- a/docs/Models/Operations/UpdatePhoneNumberRequest.md +++ b/docs/Models/Operations/UpdatePhoneNumberRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | `PhoneNumberId` | *string* | :heavy_check_mark: | The ID of the phone number to update | phone_12345 | -| `RequestBody` | [UpdatePhoneNumberRequestBody](../../Models/Operations/UpdatePhoneNumberRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [UpdatePhoneNumberRequestBody](../../Models/Operations/UpdatePhoneNumberRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateSAMLConnectionRequestBody.md b/docs/Models/Operations/UpdateSAMLConnectionRequestBody.md index e7c7c56..1c249d1 100644 --- a/docs/Models/Operations/UpdateSAMLConnectionRequestBody.md +++ b/docs/Models/Operations/UpdateSAMLConnectionRequestBody.md @@ -12,6 +12,7 @@ | `IdpCertificate` | *string* | :heavy_minus_sign: | The x509 certificated as provided by the IdP | MIIDBTCCAe2gAwIBAgIQ... | | `IdpMetadataUrl` | *string* | :heavy_minus_sign: | The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them | https://idp.example.com/metadata | | `IdpMetadata` | *string* | :heavy_minus_sign: | The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties | ... | +| `OrganizationId` | *string* | :heavy_minus_sign: | The ID of the organization to which users of this SAML Connection will be added | | | `AttributeMapping` | [UpdateSAMLConnectionAttributeMapping](../../Models/Operations/UpdateSAMLConnectionAttributeMapping.md) | :heavy_minus_sign: | Define the atrtibute name mapping between Identity Provider and Clerk's user properties | | | `Active` | *bool* | :heavy_minus_sign: | Activate or de-activate the SAML Connection | true | | `SyncUserAttributes` | *bool* | :heavy_minus_sign: | Controls whether to update the user's attributes in each sign-in | false | diff --git a/docs/Models/Operations/UpdateSignUpRequest.md b/docs/Models/Operations/UpdateSignUpRequest.md index 312a6fd..bf51137 100644 --- a/docs/Models/Operations/UpdateSignUpRequest.md +++ b/docs/Models/Operations/UpdateSignUpRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `Id` | *string* | :heavy_check_mark: | The ID of the sign-up to update | signup_1234567890abcdef | -| `RequestBody` | [UpdateSignUpRequestBody](../../Models/Operations/UpdateSignUpRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [UpdateSignUpRequestBody](../../Models/Operations/UpdateSignUpRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateUserMetadataRequest.md b/docs/Models/Operations/UpdateUserMetadataRequest.md index 901c756..57b1580 100644 --- a/docs/Models/Operations/UpdateUserMetadataRequest.md +++ b/docs/Models/Operations/UpdateUserMetadataRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | `UserId` | *string* | :heavy_check_mark: | The ID of the user whose metadata will be updated and merged | user_123456789 | -| `RequestBody` | [UpdateUserMetadataRequestBody](../../Models/Operations/UpdateUserMetadataRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [UpdateUserMetadataRequestBody](../../Models/Operations/UpdateUserMetadataRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UploadOrganizationLogoRequest.md b/docs/Models/Operations/UploadOrganizationLogoRequest.md index 8c12c79..1740c2e 100644 --- a/docs/Models/Operations/UploadOrganizationLogoRequest.md +++ b/docs/Models/Operations/UploadOrganizationLogoRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `OrganizationId` | *string* | :heavy_check_mark: | The ID of the organization for which to upload a logo | org_12345 | -| `RequestBody` | [UploadOrganizationLogoRequestBody](../../Models/Operations/UploadOrganizationLogoRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [UploadOrganizationLogoRequestBody](../../Models/Operations/UploadOrganizationLogoRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/VerifyClientRequestBody.md b/docs/Models/Operations/VerifyClientRequestBody.md index 26fce8f..bf56ed3 100644 --- a/docs/Models/Operations/VerifyClientRequestBody.md +++ b/docs/Models/Operations/VerifyClientRequestBody.md @@ -1,5 +1,7 @@ # VerifyClientRequestBody +Parameters. + ## Fields diff --git a/docs/Models/Operations/VerifyPasswordRequest.md b/docs/Models/Operations/VerifyPasswordRequest.md index 5572fff..a123fdd 100644 --- a/docs/Models/Operations/VerifyPasswordRequest.md +++ b/docs/Models/Operations/VerifyPasswordRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `UserId` | *string* | :heavy_check_mark: | The ID of the user for whom to verify the password | user_123 | -| `RequestBody` | [VerifyPasswordRequestBody](../../Models/Operations/VerifyPasswordRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [VerifyPasswordRequestBody](../../Models/Operations/VerifyPasswordRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/VerifyTOTPRequest.md b/docs/Models/Operations/VerifyTOTPRequest.md index 9cc4771..4fdadda 100644 --- a/docs/Models/Operations/VerifyTOTPRequest.md +++ b/docs/Models/Operations/VerifyTOTPRequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | `UserId` | *string* | :heavy_check_mark: | The ID of the user for whom to verify the TOTP | usr_1a2b3c | -| `RequestBody` | [VerifyTOTPRequestBody](../../Models/Operations/VerifyTOTPRequestBody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `RequestBody` | [VerifyTOTPRequestBody](../../Models/Operations/VerifyTOTPRequestBody.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 52ee2ae..b016127 100644 --- a/docs/sdks/actortokens/README.md +++ b/docs/sdks/actortokens/README.md @@ -17,8 +17,8 @@ The `actor` parameter needs to include at least a "sub" key whose value is the I ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -59,7 +59,6 @@ Revokes a pending actor token. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/allowblocklist/README.md b/docs/sdks/allowblocklist/README.md index aa0d5e1..858ab7d 100644 --- a/docs/sdks/allowblocklist/README.md +++ b/docs/sdks/allowblocklist/README.md @@ -15,7 +15,6 @@ Delete an identifier from the instance block-list ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/allowlistidentifiers/README.md b/docs/sdks/allowlistidentifiers/README.md index d87a80a..c0d422a 100644 --- a/docs/sdks/allowlistidentifiers/README.md +++ b/docs/sdks/allowlistidentifiers/README.md @@ -45,8 +45,8 @@ Create an identifier allowed to sign up to an instance ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -85,7 +85,6 @@ Delete an identifier from the instance allow-list ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/betafeatures/README.md b/docs/sdks/betafeatures/README.md index 9d5db19..9b92894 100644 --- a/docs/sdks/betafeatures/README.md +++ b/docs/sdks/betafeatures/README.md @@ -17,8 +17,8 @@ Updates the settings of an instance ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -67,8 +67,8 @@ WARNING: Changing your domain will invalidate all current user sessions (i.e. us ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -110,8 +110,8 @@ WARNING: Changing your domain will invalidate all current user sessions (i.e. us ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/blocklistidentifiers/README.md b/docs/sdks/blocklistidentifiers/README.md index 36abaff..876e929 100644 --- a/docs/sdks/blocklistidentifiers/README.md +++ b/docs/sdks/blocklistidentifiers/README.md @@ -15,8 +15,8 @@ Create an identifier that is blocked from accessing an instance ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index b9ef1fc..04baa02 100644 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -24,7 +24,6 @@ Warning: the endpoint is being deprecated and will be removed in future versions ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -63,8 +62,8 @@ Verifies the client in the provided token ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -102,7 +101,6 @@ Returns the details of a client. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/domains/README.md b/docs/sdks/domains/README.md index fb3b6d6..212c52c 100644 --- a/docs/sdks/domains/README.md +++ b/docs/sdks/domains/README.md @@ -52,8 +52,8 @@ If you're planning to configure the new satellite domain to run behind a proxy, ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -94,7 +94,6 @@ It is currently not possible to delete the instance's primary domain. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -136,8 +135,8 @@ update the instance's home origin, affecting the default application paths. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/emailaddresses/README.md b/docs/sdks/emailaddresses/README.md index 34656cb..85aaab5 100644 --- a/docs/sdks/emailaddresses/README.md +++ b/docs/sdks/emailaddresses/README.md @@ -18,8 +18,8 @@ Create a new email address ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -60,7 +60,6 @@ Returns the details of an email address. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -95,7 +94,6 @@ Delete the email address with the given ID ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -130,8 +128,8 @@ Updates an email address. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -151,7 +149,7 @@ var res = await sdk.EmailAddresses.UpdateAsync( | Parameter | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | `EmailAddressId` | *string* | :heavy_check_mark: | The ID of the email address to update | email_address_id_example | -| `RequestBody` | [UpdateEmailAddressRequestBody](../../Models/Operations/UpdateEmailAddressRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [UpdateEmailAddressRequestBody](../../Models/Operations/UpdateEmailAddressRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response diff --git a/docs/sdks/emailandsmstemplates/README.md b/docs/sdks/emailandsmstemplates/README.md index d8c371a..9c94656 100644 --- a/docs/sdks/emailandsmstemplates/README.md +++ b/docs/sdks/emailandsmstemplates/README.md @@ -19,13 +19,13 @@ Updates the existing template of the given type and slug ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); var res = await sdk.EmailAndSmsTemplates.UpsertAsync( - templateType: Clerk.BackendAPI.Models.Operations.UpsertTemplatePathParamTemplateType.Sms, + templateType: UpsertTemplatePathParamTemplateType.Sms, slug: "verification-code", requestBody: new UpsertTemplateRequestBody() { Name = "Verification Code", @@ -70,13 +70,13 @@ Reverts an updated template to its default state ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); var res = await sdk.EmailAndSmsTemplates.RevertAsync( - templateType: Clerk.BackendAPI.Models.Operations.RevertTemplatePathParamTemplateType.Email, + templateType: RevertTemplatePathParamTemplateType.Email, slug: "welcome-email" ); @@ -111,8 +111,8 @@ Returns a preview of a template for a given template_type, slug and body ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/emailsmstemplates/README.md b/docs/sdks/emailsmstemplates/README.md index 6013c2f..b478c69 100644 --- a/docs/sdks/emailsmstemplates/README.md +++ b/docs/sdks/emailsmstemplates/README.md @@ -20,12 +20,12 @@ The templates are returned sorted by position. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); -var res = await sdk.EmailSmsTemplates.ListAsync(templateType: Clerk.BackendAPI.Models.Operations.TemplateType.Email); +var res = await sdk.EmailSmsTemplates.ListAsync(templateType: TemplateType.Email); // handle response ``` @@ -57,13 +57,13 @@ Returns the details of a template ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); var res = await sdk.EmailSmsTemplates.GetAsync( - templateType: Clerk.BackendAPI.Models.Operations.PathParamTemplateType.Email, + templateType: PathParamTemplateType.Email, slug: "welcome-email" ); @@ -100,13 +100,13 @@ The app developer will need to listen to the `email.created` or `sms.created` we ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); var res = await sdk.EmailSmsTemplates.ToggleDeliveryAsync( - templateType: Clerk.BackendAPI.Models.Operations.ToggleTemplateDeliveryPathParamTemplateType.Email, + templateType: ToggleTemplateDeliveryPathParamTemplateType.Email, slug: "welcome-email", requestBody: new ToggleTemplateDeliveryRequestBody() { DeliveredByClerk = true, diff --git a/docs/sdks/instancesettings/README.md b/docs/sdks/instancesettings/README.md index 3f2b621..4226239 100644 --- a/docs/sdks/instancesettings/README.md +++ b/docs/sdks/instancesettings/README.md @@ -5,10 +5,38 @@ ### Available Operations +* [GetInstance](#getinstance) - Fetch the current instance * [Update](#update) - Update instance settings * [UpdateRestrictions](#updaterestrictions) - Update instance restrictions * [UpdateOrganization](#updateorganization) - Update instance organization settings +## GetInstance + +Fetches the current instance + +### Example Usage + +```csharp +using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; + +var sdk = new ClerkBackendApi(bearerAuth: ""); + +var res = await sdk.InstanceSettings.GetInstanceAsync(); + +// handle response +``` + +### Response + +**[GetInstanceResponse](../../Models/Operations/GetInstanceResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | + ## Update Updates the settings of an instance @@ -17,9 +45,9 @@ Updates the settings of an instance ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -68,8 +96,8 @@ Updates the restriction settings of an instance ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -111,9 +139,9 @@ Updates the organization settings of the instance ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -149,5 +177,5 @@ var res = await sdk.InstanceSettings.UpdateOrganizationAsync(req); | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 402, 404, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 402, 404, 422 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/invitations/README.md b/docs/sdks/invitations/README.md index 6604c19..7c93702 100644 --- a/docs/sdks/invitations/README.md +++ b/docs/sdks/invitations/README.md @@ -10,6 +10,7 @@ Invitations allow you to invite someone to sign up to your application, via emai * [Create](#create) - Create an invitation * [List](#list) - List all invitations +* [CreateBulkInvitations](#createbulkinvitations) - Create multiple invitations * [Revoke](#revoke) - Revokes an invitation ## Create @@ -22,9 +23,9 @@ Also, trying to create an invitation for an email address that already exists in ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -68,15 +69,16 @@ Returns all non-revoked invitations for your application, sorted by creation dat ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); var res = await sdk.Invitations.ListAsync( limit: 20, offset: 10, - status: Clerk.BackendAPI.Models.Operations.ListInvitationsQueryParamStatus.Pending + status: ListInvitationsQueryParamStatus.Pending, + query: "" ); // handle response @@ -89,6 +91,7 @@ var res = await sdk.Invitations.ListAsync( | `Limit` | *long* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | | `Offset` | *long* | :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` | [ListInvitationsQueryParamStatus](../../Models/Operations/ListInvitationsQueryParamStatus.md) | :heavy_minus_sign: | Filter invitations based on their status | pending | +| `Query` | *string* | :heavy_minus_sign: | Filter invitations based on their `email_address` or `id` | | ### Response @@ -100,6 +103,51 @@ var res = await sdk.Invitations.ListAsync( | --------------------------------------- | --------------------------------------- | --------------------------------------- | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | +## CreateBulkInvitations + +Use this API operation to create multiple invitations for the provided email addresses. You can choose to send the +invitations as emails by setting the `notify` parameter to `true`. There cannot be an existing invitation for any +of the email addresses you provide unless you set `ignore_existing` to `true` for specific email addresses. Please +note that there must be no existing user for any of the email addresses you provide, and this rule cannot be bypassed. + +### Example Usage + +```csharp +using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; +using System.Collections.Generic; + +var sdk = new ClerkBackendApi(bearerAuth: ""); + +List req = new List() { + new RequestBody() { + EmailAddress = "Era_Pouros@yahoo.com", + }, +}; + +var res = await sdk.Invitations.CreateBulkInvitationsAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `request` | List<[RequestBody](../../Models/Operations/RequestBody.md)> | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[CreateBulkInvitationsResponse](../../Models/Operations/CreateBulkInvitationsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | + ## Revoke Revokes the given invitation. @@ -111,7 +159,6 @@ Only active (i.e. non-revoked) invitations can be revoked. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/jwttemplates/README.md b/docs/sdks/jwttemplates/README.md index e2d4cd7..351a7db 100644 --- a/docs/sdks/jwttemplates/README.md +++ b/docs/sdks/jwttemplates/README.md @@ -46,8 +46,8 @@ Create a new JWT template ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -91,7 +91,6 @@ Retrieve the details of a given JWT template ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -126,8 +125,8 @@ Updates an existing JWT template ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -144,7 +143,7 @@ var res = await sdk.JwtTemplates.UpdateAsync( | Parameter | Type | Required | Description | | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | `TemplateId` | *string* | :heavy_check_mark: | The ID of the JWT template to update | -| `RequestBody` | [UpdateJWTTemplateRequestBody](../../Models/Operations/UpdateJWTTemplateRequestBody.md) | :heavy_check_mark: | N/A | +| `RequestBody` | [UpdateJWTTemplateRequestBody](../../Models/Operations/UpdateJWTTemplateRequestBody.md) | :heavy_minus_sign: | N/A | ### Response @@ -165,7 +164,6 @@ Delete a Template ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/miscellaneous/README.md b/docs/sdks/miscellaneous/README.md index 63ba538..c4df16d 100644 --- a/docs/sdks/miscellaneous/README.md +++ b/docs/sdks/miscellaneous/README.md @@ -18,8 +18,6 @@ It is used by Clerk SDKs when the user's authentication state cannot be immediat ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(); diff --git a/docs/sdks/oauthapplications/README.md b/docs/sdks/oauthapplications/README.md index 36ba26f..386907c 100644 --- a/docs/sdks/oauthapplications/README.md +++ b/docs/sdks/oauthapplications/README.md @@ -23,7 +23,6 @@ Most recent OAuth applications will be returned first. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -64,8 +63,8 @@ All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -106,7 +105,6 @@ Fetches the OAuth application whose ID matches the provided `id` in the path. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -141,8 +139,8 @@ Updates an existing OAuth application ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -185,7 +183,6 @@ This is not reversible. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -221,7 +218,6 @@ When the client secret is rotated, make sure to update it in authorized OAuth cl ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/organizationdomain/README.md b/docs/sdks/organizationdomain/README.md index 657e71b..4e597f4 100644 --- a/docs/sdks/organizationdomain/README.md +++ b/docs/sdks/organizationdomain/README.md @@ -15,8 +15,8 @@ Updates the properties of an existing organization domain. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/organizationdomains/README.md b/docs/sdks/organizationdomains/README.md index a638f29..67343e9 100644 --- a/docs/sdks/organizationdomains/README.md +++ b/docs/sdks/organizationdomains/README.md @@ -17,8 +17,8 @@ Creates a new organization domain. By default the domain is verified, but can be ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -56,8 +56,8 @@ Get a list of all domains of an organization. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -97,7 +97,6 @@ Removes the given domain from the organization. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/organizationinvitations/README.md b/docs/sdks/organizationinvitations/README.md index e06989a..866b960 100644 --- a/docs/sdks/organizationinvitations/README.md +++ b/docs/sdks/organizationinvitations/README.md @@ -26,8 +26,8 @@ The organization invitations are ordered by descending creation date by default. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -55,7 +55,8 @@ var res = await sdk.OrganizationInvitations.ListForInstanceAsync(req); | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 404, 422, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 404, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## Create @@ -81,9 +82,9 @@ When the organization invitation is accepted, the metadata will be transferred t ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -111,7 +112,7 @@ var res = await sdk.OrganizationInvitations.CreateAsync( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `OrganizationId` | *string* | :heavy_check_mark: | The ID of the organization for which to send the invitation | org_12345 | -| `RequestBody` | [CreateOrganizationInvitationRequestBody](../../Models/Operations/CreateOrganizationInvitationRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [CreateOrganizationInvitationRequestBody](../../Models/Operations/CreateOrganizationInvitationRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response @@ -137,8 +138,8 @@ Any invitations created as a result of an Organization Domain are not included i ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -146,7 +147,7 @@ var res = await sdk.OrganizationInvitations.ListAsync( organizationId: "org_12345", limit: 20, offset: 10, - status: Clerk.BackendAPI.Models.Operations.ListOrganizationInvitationsQueryParamStatus.Pending + status: ListOrganizationInvitationsQueryParamStatus.Pending ); // handle response @@ -192,16 +193,16 @@ When the organization invitation is accepted, the metadata will be transferred t ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); var res = await sdk.OrganizationInvitations.CreateBulkAsync( organizationId: "org_12345", - requestBody: new List() { - new RequestBody() { + requestBody: new List() { + new CreateOrganizationInvitationBulkRequestBody() { EmailAddress = "newmember@example.com", InviterUserId = "user_67890", Role = "admin", @@ -221,10 +222,10 @@ var res = await sdk.OrganizationInvitations.CreateBulkAsync( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `OrganizationId` | *string* | :heavy_check_mark: | The organization ID. | org_12345 | -| `RequestBody` | List<[RequestBody](../../Models/Operations/RequestBody.md)> | :heavy_check_mark: | N/A | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `OrganizationId` | *string* | :heavy_check_mark: | The organization ID. | org_12345 | +| `RequestBody` | List<[CreateOrganizationInvitationBulkRequestBody](../../Models/Operations/CreateOrganizationInvitationBulkRequestBody.md)> | :heavy_check_mark: | N/A | | ### Response @@ -252,7 +253,6 @@ Any invitations created as a result of an Organization Domain are not included i ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -293,7 +293,6 @@ Use this request to get an existing organization invitation by ID. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -336,8 +335,8 @@ Only users with "admin" role can revoke invitations. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/organizationmemberships/README.md b/docs/sdks/organizationmemberships/README.md index fd99fd5..3608f4b 100644 --- a/docs/sdks/organizationmemberships/README.md +++ b/docs/sdks/organizationmemberships/README.md @@ -20,8 +20,8 @@ Adds a user as a member to the given organization. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -62,7 +62,6 @@ Retrieves all user memberships for the given organization ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -105,8 +104,8 @@ Updates the properties of an existing organization membership ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -137,7 +136,7 @@ var res = await sdk.OrganizationMemberships.UpdateAsync( | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 404, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 404, 422 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## Delete @@ -148,7 +147,6 @@ Removes the given membership from the organization ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -176,7 +174,7 @@ var res = await sdk.OrganizationMemberships.DeleteAsync( | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 401, 404 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## UpdateMetadata @@ -189,9 +187,9 @@ You can remove metadata keys at any level by setting their value to `null`. ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -217,7 +215,7 @@ var res = await sdk.OrganizationMemberships.UpdateMetadataAsync( | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `OrganizationId` | *string* | :heavy_check_mark: | The ID of the organization the membership belongs to | org_123456 | | `UserId` | *string* | :heavy_check_mark: | The ID of the user that this membership belongs to | user_654321 | -| `RequestBody` | [UpdateOrganizationMembershipMetadataRequestBody](../../Models/Operations/UpdateOrganizationMembershipMetadataRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [UpdateOrganizationMembershipMetadataRequestBody](../../Models/Operations/UpdateOrganizationMembershipMetadataRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response @@ -238,7 +236,6 @@ Retrieves all organization user memberships for the given instance. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -268,5 +265,6 @@ var res = await sdk.OrganizationMemberships.ListForInstanceAsync( | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 422, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index c915da6..aef624f 100644 --- a/docs/sdks/organizations/README.md +++ b/docs/sdks/organizations/README.md @@ -28,8 +28,8 @@ Most recent organizations will be returned first. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -66,7 +66,6 @@ var res = await sdk.Organizations.ListAsync(req); ## Create Creates a new organization with the given name for an instance. -In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash "-". Organization slugs must be unique for the instance. @@ -81,9 +80,9 @@ the next time they create a session, presuming they don't explicitly set a diffe ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -130,7 +129,6 @@ Fetches the organization whose ID or slug matches the provided `id_or_slug` URL ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -169,9 +167,9 @@ Updates an existing organization ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -222,7 +220,6 @@ This is not reversible. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -260,9 +257,9 @@ You can remove metadata keys at any level by setting their value to `null`. ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -310,8 +307,9 @@ Only the following file content types are supported: `image/jpeg`, `image/png`, ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; +using System; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -334,7 +332,7 @@ var res = await sdk.Organizations.UploadLogoAsync( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `OrganizationId` | *string* | :heavy_check_mark: | The ID of the organization for which to upload a logo | org_12345 | -| `RequestBody` | [UploadOrganizationLogoRequestBody](../../Models/Operations/UploadOrganizationLogoRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [UploadOrganizationLogoRequestBody](../../Models/Operations/UploadOrganizationLogoRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response @@ -355,7 +353,6 @@ Delete the organization's logo. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/phonenumbers/README.md b/docs/sdks/phonenumbers/README.md index c48a4a6..585a629 100644 --- a/docs/sdks/phonenumbers/README.md +++ b/docs/sdks/phonenumbers/README.md @@ -18,8 +18,8 @@ Create a new phone number ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -61,7 +61,6 @@ Returns the details of a phone number ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -96,7 +95,6 @@ Delete the phone number with the given ID ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -131,8 +129,8 @@ Updates a phone number ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -153,7 +151,7 @@ var res = await sdk.PhoneNumbers.UpdateAsync( | Parameter | Type | Required | Description | Example | | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | `PhoneNumberId` | *string* | :heavy_check_mark: | The ID of the phone number to update | phone_12345 | -| `RequestBody` | [UpdatePhoneNumberRequestBody](../../Models/Operations/UpdatePhoneNumberRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [UpdatePhoneNumberRequestBody](../../Models/Operations/UpdatePhoneNumberRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response diff --git a/docs/sdks/proxychecks/README.md b/docs/sdks/proxychecks/README.md index 2944ed3..f6160f2 100644 --- a/docs/sdks/proxychecks/README.md +++ b/docs/sdks/proxychecks/README.md @@ -22,8 +22,8 @@ a different proxy URL than the one provided. It can also be used to re-validate ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/redirecturls/README.md b/docs/sdks/redirecturls/README.md index 4e452f4..750efe4 100644 --- a/docs/sdks/redirecturls/README.md +++ b/docs/sdks/redirecturls/README.md @@ -45,8 +45,8 @@ Create a redirect URL ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -84,7 +84,6 @@ Retrieve the details of the redirect URL with the given ID ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -119,7 +118,6 @@ Remove the selected redirect URL from the whitelist of the instance ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/samlconnections/README.md b/docs/sdks/samlconnections/README.md index 2d32fd4..6d443df 100644 --- a/docs/sdks/samlconnections/README.md +++ b/docs/sdks/samlconnections/README.md @@ -21,14 +21,17 @@ The SAML Connections are ordered by descending creation date and the most recent ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using System.Collections.Generic; var sdk = new ClerkBackendApi(bearerAuth: ""); var res = await sdk.SamlConnections.ListAsync( limit: 20, - offset: 10 + offset: 10, + organizationId: new List() { + "", + } ); // handle response @@ -36,10 +39,11 @@ var res = await sdk.SamlConnections.ListAsync( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `Limit` | *long* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | -| `Offset` | *long* | :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 | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Limit` | *long* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | 20 | +| `Offset` | *long* | :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 | +| `OrganizationId` | List<*string*> | :heavy_minus_sign: | Returns SAML connections that have an associated organization ID to the
given organizations.
For each organization id, the `+` and `-` can be
prepended to the id, which denote whether the
respective organization should be included or
excluded from the result set.
Accepts up to 100 organization ids. | | ### Response @@ -60,15 +64,15 @@ Create a new SAML Connection. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); CreateSAMLConnectionRequestBody req = new CreateSAMLConnectionRequestBody() { Name = "My SAML Connection", Domain = "example.org", - Provider = Clerk.BackendAPI.Models.Operations.Provider.SamlCustom, + Provider = Provider.SamlCustom, IdpEntityId = "http://idp.example.org/", IdpSsoUrl = "http://idp.example.org/sso", IdpCertificate = "MIIDdzCCAl+gAwIBAgIJAKcyBaiiz+DT...", @@ -101,7 +105,7 @@ var res = await sdk.SamlConnections.CreateAsync(req); | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 402, 403, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 402, 403, 404, 422 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## Get @@ -112,7 +116,6 @@ Fetches the SAML Connection whose ID matches the provided `saml_connection_id` i ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -147,8 +150,8 @@ Updates the SAML Connection whose ID matches the provided `id` in the path. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -204,7 +207,6 @@ Deletes the SAML Connection whose ID matches the provided `id` in the path. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index 91565cd..d8785c6 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -11,9 +11,11 @@ Sessions are created when a user successfully goes through the sign in or sign u ### Available Operations * [List](#list) - List all sessions +* [CreateSession](#createsession) - Create a new active session * [Get](#get) - Retrieve a session * [Revoke](#revoke) - Revoke a session * [~~Verify~~](#verify) - Verify a session :warning: **Deprecated** +* [CreateSessionToken](#createsessiontoken) - Create a session token * [CreateToken](#createtoken) - Create a session token from a jwt template ## List @@ -27,15 +29,15 @@ moving forward at least one of `client_id` or `user_id` parameters should be pro ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); GetSessionListRequest req = new GetSessionListRequest() { ClientId = "client_123", UserId = "user_456", - Status = Clerk.BackendAPI.Models.Operations.Status.Active, + Status = Status.Active, Limit = 20, Offset = 10, }; @@ -62,6 +64,45 @@ var res = await sdk.Sessions.ListAsync(req); | Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 422 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | +## CreateSession + +Create a new active session for the provided user ID. + +This operation is only available for Clerk Development instances. + +### Example Usage + +```csharp +using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; + +var sdk = new ClerkBackendApi(bearerAuth: ""); + +CreateSessionRequestBody req = new CreateSessionRequestBody() {}; + +var res = await sdk.Sessions.CreateSessionAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `request` | [CreateSessionRequestBody](../../Models/Operations/CreateSessionRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[CreateSessionResponse](../../Models/Operations/CreateSessionResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | + ## Get Retrieve the details of a session @@ -70,7 +111,6 @@ Retrieve the details of a session ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -106,7 +146,6 @@ In multi-session mode, a revoked session will still be returned along with its c ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -146,8 +185,8 @@ WARNING: This endpoint is deprecated and will be removed in future versions. We ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -179,6 +218,45 @@ var res = await sdk.Sessions.VerifyAsync( | Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404, 410 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | +## CreateSessionToken + +Creates a session JSON Web Token (JWT) based on a session. + +### Example Usage + +```csharp +using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; + +var sdk = new ClerkBackendApi(bearerAuth: ""); + +var res = await sdk.Sessions.CreateSessionTokenAsync( + sessionId: "", + requestBody: new CreateSessionTokenRequestBody() {} +); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `SessionId` | *string* | :heavy_check_mark: | The ID of the session | +| `RequestBody` | [CreateSessionTokenRequestBody](../../Models/Operations/CreateSessionTokenRequestBody.md) | :heavy_minus_sign: | N/A | + +### Response + +**[CreateSessionTokenResponse](../../Models/Operations/CreateSessionTokenResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 401, 404 | application/json | +| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | + ## CreateToken Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined for your instance @@ -187,14 +265,15 @@ Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); var res = await sdk.Sessions.CreateTokenAsync( sessionId: "ses_123abcd4567", - templateName: "custom_hasura" + templateName: "custom_hasura", + requestBody: new CreateSessionTokenFromTemplateRequestBody() {} ); // handle response @@ -202,10 +281,11 @@ var res = await sdk.Sessions.CreateTokenAsync( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `SessionId` | *string* | :heavy_check_mark: | The ID of the session | ses_123abcd4567 | -| `TemplateName` | *string* | :heavy_check_mark: | The name of the JWT Template defined in your instance (e.g. `custom_hasura`). | custom_hasura | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `SessionId` | *string* | :heavy_check_mark: | The ID of the session | ses_123abcd4567 | +| `TemplateName` | *string* | :heavy_check_mark: | The name of the JWT Template defined in your instance (e.g. `custom_hasura`). | custom_hasura | +| `RequestBody` | [CreateSessionTokenFromTemplateRequestBody](../../Models/Operations/CreateSessionTokenFromTemplateRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response diff --git a/docs/sdks/signintokens/README.md b/docs/sdks/signintokens/README.md index 10f8efc..b074eda 100644 --- a/docs/sdks/signintokens/README.md +++ b/docs/sdks/signintokens/README.md @@ -18,8 +18,8 @@ You can optionally supply a different duration in seconds using the `expires_in_ ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -58,7 +58,6 @@ Revokes a pending sign-in token ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); diff --git a/docs/sdks/signups/README.md b/docs/sdks/signups/README.md index 80f1f7a..9baa06b 100644 --- a/docs/sdks/signups/README.md +++ b/docs/sdks/signups/README.md @@ -15,8 +15,8 @@ Update the sign-up with the given ID ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -35,7 +35,7 @@ var res = await sdk.SignUps.UpdateAsync( | Parameter | Type | Required | Description | Example | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `Id` | *string* | :heavy_check_mark: | The ID of the sign-up to update | signup_1234567890abcdef | -| `RequestBody` | [UpdateSignUpRequestBody](../../Models/Operations/UpdateSignUpRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [UpdateSignUpRequestBody](../../Models/Operations/UpdateSignUpRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response diff --git a/docs/sdks/testingtokens/README.md b/docs/sdks/testingtokens/README.md index fb62cd7..f9d4e03 100644 --- a/docs/sdks/testingtokens/README.md +++ b/docs/sdks/testingtokens/README.md @@ -9,7 +9,7 @@ ## Create -Retrieve a new testing token. Only available for development instances. +Retrieve a new testing token. ### Example Usage diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index 66353a3..8ee4840 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -42,9 +42,9 @@ The users are returned sorted by creation date, with the newest users appearing ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -71,7 +71,10 @@ GetUserListRequest req = new GetUserListRequest() { "org-id-123", }, Query = "John", - LastActiveAtSince = 1700690400000, + LastActiveAtBefore = 1700690400000, + LastActiveAtAfter = 1700690400000, + CreatedAtBefore = 1730160000000, + CreatedAtAfter = 1730160000000, Limit = 20, Offset = 10, }; @@ -112,9 +115,9 @@ A rate limit rule of 20 requests per 10 seconds is applied to this endpoint. ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -185,9 +188,9 @@ Returns a total count of all users that match the given filtering criteria. ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -243,7 +246,6 @@ Retrieve the details of a user ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -289,9 +291,9 @@ You can also choose to sign the user out of all their active sessions on any dev ```csharp using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Operations; using System.Collections.Generic; -using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -360,7 +362,6 @@ Delete the specified user ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -395,7 +396,6 @@ Marks the given user as banned, which means that all their sessions are revoked ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -430,7 +430,6 @@ Removes the ban mark from the given user. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -466,7 +465,6 @@ Lock duration can be configured in the instance's restrictions settings. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -501,7 +499,6 @@ Removes the lock from the given user. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -536,8 +533,8 @@ Update a user's profile image ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -575,7 +572,6 @@ Delete a user's profile image ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -617,9 +613,8 @@ You can remove metadata keys at any level by setting their value to `null`. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; -using System.Collections.Generic; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -636,7 +631,7 @@ var res = await sdk.Users.UpdateMetadataAsync( | Parameter | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | `UserId` | *string* | :heavy_check_mark: | The ID of the user whose metadata will be updated and merged | user_123456789 | -| `RequestBody` | [UpdateUserMetadataRequestBody](../../Models/Operations/UpdateUserMetadataRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [UpdateUserMetadataRequestBody](../../Models/Operations/UpdateUserMetadataRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response @@ -658,7 +653,6 @@ For OAuth 2.0, if the access token has expired and we have a corresponding refre ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -686,7 +680,7 @@ var res = await sdk.Users.GetOAuthAccessTokenAsync( | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 404, 422 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## GetOrganizationMemberships @@ -697,7 +691,6 @@ Retrieve a paginated list of the user's organization memberships ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -738,8 +731,8 @@ Retrieve a paginated list of the user's organization invitations ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -747,7 +740,7 @@ var res = await sdk.Users.GetOrganizationInvitationsAsync( userId: "", limit: 20, offset: 10, - status: Clerk.BackendAPI.Models.Operations.QueryParamStatus.Pending + status: QueryParamStatus.Pending ); // handle response @@ -782,8 +775,8 @@ Useful for custom auth flows and re-verification. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -802,7 +795,7 @@ var res = await sdk.Users.VerifyPasswordAsync( | Parameter | Type | Required | Description | Example | | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `UserId` | *string* | :heavy_check_mark: | The ID of the user for whom to verify the password | user_123 | -| `RequestBody` | [VerifyPasswordRequestBody](../../Models/Operations/VerifyPasswordRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [VerifyPasswordRequestBody](../../Models/Operations/VerifyPasswordRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response @@ -826,8 +819,8 @@ Useful for custom auth flows and re-verification. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -846,7 +839,7 @@ var res = await sdk.Users.VerifyTotpAsync( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | `UserId` | *string* | :heavy_check_mark: | The ID of the user for whom to verify the TOTP | usr_1a2b3c | -| `RequestBody` | [VerifyTOTPRequestBody](../../Models/Operations/VerifyTOTPRequestBody.md) | :heavy_check_mark: | N/A | | +| `RequestBody` | [VerifyTOTPRequestBody](../../Models/Operations/VerifyTOTPRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response @@ -867,7 +860,6 @@ Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP on their authen ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -891,7 +883,8 @@ var res = await sdk.Users.DisableMfaAsync(userId: "user_123456"); | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 404, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 404 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## DeleteBackupCode @@ -902,7 +895,6 @@ Disable all of a user's backup codes. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -926,7 +918,8 @@ var res = await sdk.Users.DeleteBackupCodeAsync(userId: ""); | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 404, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 404 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## DeletePasskey @@ -937,7 +930,6 @@ Delete the passkey identification for a given user and notify them through email ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -965,7 +957,8 @@ var res = await sdk.Users.DeletePasskeyAsync( | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 403, 404, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 403, 404 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## CreateTotp @@ -977,7 +970,6 @@ Creates a TOTP (Time-based One-Time Password) for a given user, returning both t ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -1001,7 +993,8 @@ var res = await sdk.Users.CreateTotpAsync(userId: ""); | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 403, 404, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 403, 404 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## DeleteTOTP @@ -1012,7 +1005,6 @@ Deletes all of the user's TOTPs. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -1036,7 +1028,8 @@ var res = await sdk.Users.DeleteTOTPAsync(userId: ""); | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 404, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 404 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | ## DeleteExternalAccount @@ -1047,7 +1040,6 @@ Delete an external account by ID. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -1075,5 +1067,6 @@ var res = await sdk.Users.DeleteExternalAccountAsync( | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 403, 404, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 403, 404 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/userweb3wallets/README.md b/docs/sdks/userweb3wallets/README.md index 3286054..d96c773 100644 --- a/docs/sdks/userweb3wallets/README.md +++ b/docs/sdks/userweb3wallets/README.md @@ -15,7 +15,6 @@ Delete the web3 wallet identification for a given user. ```csharp using Clerk.BackendAPI; -using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Models.Components; var sdk = new ClerkBackendApi(bearerAuth: ""); @@ -43,5 +42,6 @@ var res = await sdk.UserWeb3Wallets.DeleteAsync( | Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 403, 404, 500 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 403, 404 | application/json | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json | | Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/waitlistentries/README.md b/docs/sdks/waitlistentries/README.md new file mode 100644 index 0000000..e93b18e --- /dev/null +++ b/docs/sdks/waitlistentries/README.md @@ -0,0 +1,90 @@ +# WaitlistEntries +(*WaitlistEntries*) + +## Overview + +### Available Operations + +* [ListWaitlistEntries](#listwaitlistentries) - List all waitlist entries +* [CreateWaitlistEntry](#createwaitlistentry) - Create a waitlist entry + +## ListWaitlistEntries + +Retrieve a list of waitlist entries for the instance. +Entries are ordered by creation date in descending order by default. +Supports filtering by email address or status and pagination with limit and offset parameters. + +### Example Usage + +```csharp +using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; + +var sdk = new ClerkBackendApi(bearerAuth: ""); + +ListWaitlistEntriesRequest req = new ListWaitlistEntriesRequest() { + Limit = 20, + Offset = 10, +}; + +var res = await sdk.WaitlistEntries.ListWaitlistEntriesAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `request` | [ListWaitlistEntriesRequest](../../Models/Operations/ListWaitlistEntriesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[ListWaitlistEntriesResponse](../../Models/Operations/ListWaitlistEntriesResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | + +## CreateWaitlistEntry + +Creates a new waitlist entry for the given email address. +If the email address is already on the waitlist, no new entry will be created and the existing waitlist entry will be returned. + +### Example Usage + +```csharp +using Clerk.BackendAPI; +using Clerk.BackendAPI.Models.Components; +using Clerk.BackendAPI.Models.Operations; + +var sdk = new ClerkBackendApi(bearerAuth: ""); + +CreateWaitlistEntryRequestBody req = new CreateWaitlistEntryRequestBody() { + EmailAddress = "Demond_Willms@hotmail.com", +}; + +var res = await sdk.WaitlistEntries.CreateWaitlistEntryAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `request` | [CreateWaitlistEntryRequestBody](../../Models/Operations/CreateWaitlistEntryRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[CreateWaitlistEntryResponse](../../Models/Operations/CreateWaitlistEntryResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 422 | application/json | +| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/src/Clerk/BackendAPI/ActorTokens.cs b/src/Clerk/BackendAPI/ActorTokens.cs index a71378c..5029359 100644 --- a/src/Clerk/BackendAPI/ActorTokens.cs +++ b/src/Clerk/BackendAPI/ActorTokens.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IActorTokens { @@ -33,7 +33,7 @@ public interface IActorTokens /// The `actor` parameter needs to include at least a "sub" key whose value is the ID of the actor (impersonating) user. /// /// - Task CreateAsync(CreateActorTokenRequestBody request); + Task CreateAsync(CreateActorTokenRequestBody? request = null); /// /// Revoke actor token @@ -49,10 +49,10 @@ public class ActorTokens: IActorTokens { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -65,7 +65,7 @@ public ActorTokens(ISpeakeasyHttpClient client, Func CreateAsync(CreateActorTokenRequestBody request) + public async Task CreateAsync(CreateActorTokenRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -74,7 +74,7 @@ public async Task CreateAsync(CreateActorTokenRequestB var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -125,7 +125,7 @@ public async Task CreateAsync(CreateActorTokenRequestB { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var response = new CreateActorTokenResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -144,13 +144,17 @@ public async Task CreateAsync(CreateActorTokenRequestB { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); throw obj!; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -240,7 +244,11 @@ public async Task RevokeAsync(string actorTokenId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/AllowBlockList.cs b/src/Clerk/BackendAPI/AllowBlockList.cs index 059dbc2..79e918d 100644 --- a/src/Clerk/BackendAPI/AllowBlockList.cs +++ b/src/Clerk/BackendAPI/AllowBlockList.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IAllowBlockList { @@ -39,10 +39,10 @@ public class AllowBlockList: IAllowBlockList { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -137,7 +137,11 @@ public async Task DeleteIdentifierAsync(strin throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/AllowListBlockList.cs b/src/Clerk/BackendAPI/AllowListBlockList.cs index c6a6fce..f1d5c6e 100644 --- a/src/Clerk/BackendAPI/AllowListBlockList.cs +++ b/src/Clerk/BackendAPI/AllowListBlockList.cs @@ -13,13 +13,13 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; - using System; public interface IAllowListBlockList { @@ -38,10 +38,10 @@ public class AllowListBlockList: IAllowListBlockList { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -133,7 +133,11 @@ public async Task ListBlocklistIdentifiersAsyn throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/AllowlistIdentifiers.cs b/src/Clerk/BackendAPI/AllowlistIdentifiers.cs index 1a05baa..bae162e 100644 --- a/src/Clerk/BackendAPI/AllowlistIdentifiers.cs +++ b/src/Clerk/BackendAPI/AllowlistIdentifiers.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IAllowlistIdentifiers { @@ -41,7 +41,7 @@ public interface IAllowlistIdentifiers /// Create an identifier allowed to sign up to an instance /// /// - Task CreateAsync(CreateAllowlistIdentifierRequestBody request); + Task CreateAsync(CreateAllowlistIdentifierRequestBody? request = null); /// /// Delete identifier from allow-list @@ -57,10 +57,10 @@ public class AllowlistIdentifiers: IAllowlistIdentifiers { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -152,7 +152,11 @@ public async Task ListAsync() throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -160,7 +164,7 @@ public async Task ListAsync() throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task CreateAsync(CreateAllowlistIdentifierRequestBody request) + public async Task CreateAsync(CreateAllowlistIdentifierRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -169,7 +173,7 @@ public async Task CreateAsync(CreateAllowlist var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -220,7 +224,7 @@ public async Task CreateAsync(CreateAllowlist { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var response = new CreateAllowlistIdentifierResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -239,13 +243,17 @@ public async Task CreateAsync(CreateAllowlist { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); throw obj!; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -335,7 +343,11 @@ public async Task DeleteAsync(string identifi throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/BetaFeatures.cs b/src/Clerk/BackendAPI/BetaFeatures.cs index 9b85732..f1e068a 100644 --- a/src/Clerk/BackendAPI/BetaFeatures.cs +++ b/src/Clerk/BackendAPI/BetaFeatures.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IBetaFeatures { @@ -65,10 +65,10 @@ public class BetaFeatures: IBetaFeatures { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -166,7 +166,11 @@ public async Task UpdateInstanceSettingsAsync( throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -252,7 +256,11 @@ public async Task UpdateDomainAsync(Upda throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -337,7 +345,11 @@ public async Task ChangeProductionInstan throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/BlocklistIdentifiers.cs b/src/Clerk/BackendAPI/BlocklistIdentifiers.cs index e78897f..dd52ef8 100644 --- a/src/Clerk/BackendAPI/BlocklistIdentifiers.cs +++ b/src/Clerk/BackendAPI/BlocklistIdentifiers.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IBlocklistIdentifiers { @@ -32,17 +32,17 @@ public interface IBlocklistIdentifiers /// Create an identifier that is blocked from accessing an instance /// /// - Task CreateAsync(CreateBlocklistIdentifierRequestBody request); + Task CreateAsync(CreateBlocklistIdentifierRequestBody? request = null); } public class BlocklistIdentifiers: IBlocklistIdentifiers { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -55,7 +55,7 @@ public BlocklistIdentifiers(ISpeakeasyHttpClient client, Func CreateAsync(CreateBlocklistIdentifierRequestBody request) + public async Task CreateAsync(CreateBlocklistIdentifierRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -64,7 +64,7 @@ public async Task CreateAsync(CreateBlocklist var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -115,7 +115,7 @@ public async Task CreateAsync(CreateBlocklist { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var response = new CreateBlocklistIdentifierResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -134,13 +134,17 @@ public async Task CreateAsync(CreateBlocklist { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); throw obj!; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Clerk.BackendAPI.csproj b/src/Clerk/BackendAPI/Clerk.BackendAPI.csproj index faf7f7e..cf82590 100644 --- a/src/Clerk/BackendAPI/Clerk.BackendAPI.csproj +++ b/src/Clerk/BackendAPI/Clerk.BackendAPI.csproj @@ -3,10 +3,10 @@ true Clerk.BackendAPI - 0.2.4 + 0.3.0 net8.0 Clerk - Copyright (c) Clerk 2024 + Copyright (c) Clerk 2025 https://github.com/clerk/clerk-sdk-csharp.git git Clerk SDK diff --git a/src/Clerk/BackendAPI/ClerkBackendApi.cs b/src/Clerk/BackendAPI/ClerkBackendApi.cs index 9b4293e..f224e66 100644 --- a/src/Clerk/BackendAPI/ClerkBackendApi.cs +++ b/src/Clerk/BackendAPI/ClerkBackendApi.cs @@ -12,13 +12,13 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Hooks; using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; - using System; /// /// Clerk Backend API: The Clerk REST Backend API, meant to be accessed by backend
@@ -121,6 +121,7 @@ public interface IClerkBackendApi public IOauthApplications OauthApplications { get; } public ISamlConnections SamlConnections { get; } public ITestingTokens TestingTokens { get; } + public IWaitlistEntries WaitlistEntries { get; } } public class SDKConfig @@ -180,10 +181,10 @@ public class ClerkBackendApi: IClerkBackendApi public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private int _serverIndex = 0; private ISpeakeasyHttpClient _client; @@ -221,6 +222,7 @@ public class ClerkBackendApi: IClerkBackendApi public IOauthApplications OauthApplications { get; private set; } public ISamlConnections SamlConnections { get; private set; } public ITestingTokens TestingTokens { get; private set; } + public IWaitlistEntries WaitlistEntries { get; private set; } public ClerkBackendApi(string? bearerAuth = null, Func? bearerAuthSource = null, int? serverIndex = null, string? serverUrl = null, Dictionary? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null) { @@ -360,6 +362,9 @@ public ClerkBackendApi(string? bearerAuth = null, Func? bearerAuthSource TestingTokens = new TestingTokens(_client, _securitySource, _serverUrl, SDKConfiguration); + + + WaitlistEntries = new WaitlistEntries(_client, _securitySource, _serverUrl, SDKConfiguration); } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Clients.cs b/src/Clerk/BackendAPI/Clients.cs index ff1b9f6..650f291 100644 --- a/src/Clerk/BackendAPI/Clients.cs +++ b/src/Clerk/BackendAPI/Clients.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// The Client object tracks sessions, as well as the state of any sign in and sign up attempts, for a given device. @@ -39,7 +39,7 @@ public interface IClients /// Warning: the endpoint is being deprecated and will be removed in future versions. /// /// - Task ListAsync(long? limit = null, long? offset = null); + Task ListAsync(long? limit = 10, long? offset = 0); /// /// Verify a client @@ -69,10 +69,10 @@ public class Clients: IClients { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -86,7 +86,7 @@ public Clients(ISpeakeasyHttpClient client, Func ListAsync(long? limit = null, long? offset = null) + public async Task ListAsync(long? limit = 10, long? offset = 0) { var request = new GetClientListRequest() { @@ -169,7 +169,11 @@ public async Task ListAsync(long? limit = null, long? off throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -262,7 +266,11 @@ public async Task VerifyAsync(VerifyClientRequestBody? req throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -352,7 +360,11 @@ public async Task GetAsync(string clientId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Domains.cs b/src/Clerk/BackendAPI/Domains.cs index d344399..4dc2d9d 100644 --- a/src/Clerk/BackendAPI/Domains.cs +++ b/src/Clerk/BackendAPI/Domains.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Domains represent each instance's URLs and DNS setup. @@ -49,7 +49,7 @@ public interface IDomains /// If you're planning to configure the new satellite domain to run behind a proxy, pass the `proxy_url` parameter accordingly. /// /// - Task AddAsync(AddDomainRequestBody request); + Task AddAsync(AddDomainRequestBody? request = null); /// /// Delete a satellite domain @@ -85,10 +85,10 @@ public class Domains: IDomains { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -170,7 +170,11 @@ public async Task ListAsync() throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -178,7 +182,7 @@ public async Task ListAsync() throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task AddAsync(AddDomainRequestBody request) + public async Task AddAsync(AddDomainRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -187,7 +191,7 @@ public async Task AddAsync(AddDomainRequestBody request) var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -238,7 +242,7 @@ public async Task AddAsync(AddDomainRequestBody request) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var response = new AddDomainResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -257,13 +261,17 @@ public async Task AddAsync(AddDomainRequestBody request) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); throw obj!; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -353,7 +361,11 @@ public async Task DeleteAsync(string domainId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -450,7 +462,11 @@ public async Task UpdateAsync(string domainId, UpdateDomai throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/EmailAddresses.cs b/src/Clerk/BackendAPI/EmailAddresses.cs index 21a7d24..c26a3e0 100644 --- a/src/Clerk/BackendAPI/EmailAddresses.cs +++ b/src/Clerk/BackendAPI/EmailAddresses.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IEmailAddresses { @@ -59,17 +59,17 @@ public interface IEmailAddresses /// Updates an email address. /// /// - Task UpdateAsync(string emailAddressId, UpdateEmailAddressRequestBody requestBody); + Task UpdateAsync(string emailAddressId, UpdateEmailAddressRequestBody? requestBody = null); } public class EmailAddresses: IEmailAddresses { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -167,7 +167,11 @@ public async Task CreateAsync(CreateEmailAddressRequ throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -257,7 +261,11 @@ public async Task GetAsync(string emailAddressId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -347,7 +355,11 @@ public async Task DeleteAsync(string emailAddressId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -355,7 +367,7 @@ public async Task DeleteAsync(string emailAddressId) throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task UpdateAsync(string emailAddressId, UpdateEmailAddressRequestBody requestBody) + public async Task UpdateAsync(string emailAddressId, UpdateEmailAddressRequestBody? requestBody = null) { var request = new UpdateEmailAddressRequest() { @@ -368,7 +380,7 @@ public async Task UpdateAsync(string emailAddressId, var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -444,7 +456,11 @@ public async Task UpdateAsync(string emailAddressId, throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/EmailAndSmsTemplates.cs b/src/Clerk/BackendAPI/EmailAndSmsTemplates.cs index 8de44d1..b607bb5 100644 --- a/src/Clerk/BackendAPI/EmailAndSmsTemplates.cs +++ b/src/Clerk/BackendAPI/EmailAndSmsTemplates.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IEmailAndSmsTemplates { @@ -57,10 +57,10 @@ public class EmailAndSmsTemplates: IEmailAndSmsTemplates { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -164,7 +164,11 @@ public async Task UpsertAsync(UpsertTemplatePathParamTem throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -256,7 +260,11 @@ public async Task RevertAsync(RevertTemplatePathParamTem throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -355,7 +363,11 @@ public async Task PreviewAsync(string templateType, str throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/EmailSmsTemplates.cs b/src/Clerk/BackendAPI/EmailSmsTemplates.cs index 3ffa295..2554137 100644 --- a/src/Clerk/BackendAPI/EmailSmsTemplates.cs +++ b/src/Clerk/BackendAPI/EmailSmsTemplates.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IEmailSmsTemplates { @@ -60,10 +60,10 @@ public class EmailSmsTemplates: IEmailSmsTemplates { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -159,7 +159,11 @@ public async Task ListAsync(TemplateType templateType) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -251,7 +255,11 @@ public async Task GetAsync(PathParamTemplateType templateTy throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -350,7 +358,11 @@ public async Task ToggleDeliveryAsync(ToggleTemp throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/InstanceSettings.cs b/src/Clerk/BackendAPI/InstanceSettings.cs index 8be48a0..13b8adb 100644 --- a/src/Clerk/BackendAPI/InstanceSettings.cs +++ b/src/Clerk/BackendAPI/InstanceSettings.cs @@ -13,18 +13,27 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IInstanceSettings { + /// + /// Fetch the current instance + /// + /// + /// Fetches the current instance + /// + /// + Task GetInstanceAsync(); + /// /// Update instance settings /// @@ -57,10 +66,10 @@ public class InstanceSettings: IInstanceSettings { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -73,6 +82,87 @@ public InstanceSettings(ISpeakeasyHttpClient client, Func GetInstanceAsync() + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/instance"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("GetInstance", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var response = new GetInstanceResponse() + { + HttpMeta = new Models.Components.HTTPMetadata() + { + Response = httpResponse, + Request = httpRequest + } + }; + response.Instance = obj; + return response; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + + throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); + } + public async Task UpdateAsync(UpdateInstanceRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -150,7 +240,11 @@ public async Task UpdateAsync(UpdateInstanceRequestBody? throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -243,7 +337,11 @@ public async Task UpdateRestrictionsAsync(Up throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -281,7 +379,7 @@ public async Task UpdateOrganization httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 402 || _statusCode == 404 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode == 400 || _statusCode == 402 || _statusCode == 404 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -326,7 +424,7 @@ public async Task UpdateOrganization throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{402, 404, 422}.Contains(responseStatusCode)) + else if(new List{400, 402, 404, 422}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -336,7 +434,11 @@ public async Task UpdateOrganization throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Invitations.cs b/src/Clerk/BackendAPI/Invitations.cs index 47f11d8..2e3788f 100644 --- a/src/Clerk/BackendAPI/Invitations.cs +++ b/src/Clerk/BackendAPI/Invitations.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Invitations allow you to invite someone to sign up to your application, via email. @@ -39,7 +39,7 @@ public interface IInvitations /// Also, trying to create an invitation for an email address that already exists in your application will result to an error. /// /// - Task CreateAsync(CreateInvitationRequestBody request); + Task CreateAsync(CreateInvitationRequestBody? request = null); /// /// List all invitations @@ -48,7 +48,19 @@ public interface IInvitations /// Returns all non-revoked invitations for your application, sorted by creation date /// /// - Task ListAsync(long? limit = null, long? offset = null, ListInvitationsQueryParamStatus? status = null); + Task ListAsync(long? limit = 10, long? offset = 0, ListInvitationsQueryParamStatus? status = null, string? query = null); + + /// + /// Create multiple invitations + /// + /// + /// Use this API operation to create multiple invitations for the provided email addresses. You can choose to send the
+ /// invitations as emails by setting the `notify` parameter to `true`. There cannot be an existing invitation for any
+ /// of the email addresses you provide unless you set `ignore_existing` to `true` for specific email addresses. Please
+ /// note that there must be no existing user for any of the email addresses you provide, and this rule cannot be bypassed. + ///
+ ///
+ Task CreateBulkInvitationsAsync(List? request = null); /// /// Revokes an invitation @@ -72,10 +84,10 @@ public class Invitations: IInvitations { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -88,7 +100,7 @@ public Invitations(ISpeakeasyHttpClient client, Func CreateAsync(CreateInvitationRequestBody request) + public async Task CreateAsync(CreateInvitationRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -97,7 +109,7 @@ public async Task CreateAsync(CreateInvitationRequestB var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -148,7 +160,7 @@ public async Task CreateAsync(CreateInvitationRequestB { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var response = new CreateInvitationResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -167,13 +179,17 @@ public async Task CreateAsync(CreateInvitationRequestB { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); throw obj!; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -181,13 +197,14 @@ public async Task CreateAsync(CreateInvitationRequestB throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task ListAsync(long? limit = null, long? offset = null, ListInvitationsQueryParamStatus? status = null) + public async Task ListAsync(long? limit = 10, long? offset = 0, ListInvitationsQueryParamStatus? status = null, string? query = null) { var request = new ListInvitationsRequest() { Limit = limit, Offset = offset, Status = status, + Query = query, }; string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/invitations", request); @@ -255,7 +272,108 @@ public async Task ListAsync(long? limit = null, long? o throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + + throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); + } + + public async Task CreateBulkInvitationsAsync(List? request = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/invitations/bulk"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("CreateBulkInvitations", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode == 400 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var response = new CreateBulkInvitationsResponse() + { + HttpMeta = new Models.Components.HTTPMetadata() + { + Response = httpResponse, + Request = httpRequest + } + }; + response.InvitationList = obj; + return response; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(new List{400, 422}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -345,7 +463,11 @@ public async Task RevokeAsync(string invitationId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Jwks.cs b/src/Clerk/BackendAPI/Jwks.cs index bc79209..322ad76 100644 --- a/src/Clerk/BackendAPI/Jwks.cs +++ b/src/Clerk/BackendAPI/Jwks.cs @@ -13,13 +13,13 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; - using System; public interface IJwks { @@ -38,10 +38,10 @@ public class Jwks: IJwks { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -108,7 +108,7 @@ public async Task GetAsync() { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var response = new GetJWKSResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -117,13 +117,17 @@ public async Task GetAsync() Request = httpRequest } }; - response.WellKnownJWKS = obj; + response.Jwks = obj; return response; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/JwtTemplates.cs b/src/Clerk/BackendAPI/JwtTemplates.cs index 26604bf..eab4f91 100644 --- a/src/Clerk/BackendAPI/JwtTemplates.cs +++ b/src/Clerk/BackendAPI/JwtTemplates.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IJwtTemplates { @@ -55,7 +55,7 @@ public interface IJwtTemplates /// Updates an existing JWT template /// /// - Task UpdateAsync(string templateId, UpdateJWTTemplateRequestBody requestBody); + Task UpdateAsync(string templateId, UpdateJWTTemplateRequestBody? requestBody = null); /// /// Delete a Template @@ -67,10 +67,10 @@ public class JwtTemplates: IJwtTemplates { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -152,7 +152,11 @@ public async Task ListAsync() throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -245,7 +249,11 @@ public async Task CreateAsync(CreateJWTTemplateReques throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -335,7 +343,11 @@ public async Task GetAsync(string templateId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -343,7 +355,7 @@ public async Task GetAsync(string templateId) throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task UpdateAsync(string templateId, UpdateJWTTemplateRequestBody requestBody) + public async Task UpdateAsync(string templateId, UpdateJWTTemplateRequestBody? requestBody = null) { var request = new UpdateJWTTemplateRequest() { @@ -356,7 +368,7 @@ public async Task UpdateAsync(string templateId, Upda var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -432,7 +444,11 @@ public async Task UpdateAsync(string templateId, Upda throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -522,7 +538,11 @@ public async Task DeleteAsync(string templateId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Miscellaneous.cs b/src/Clerk/BackendAPI/Miscellaneous.cs index 050b346..51e0996 100644 --- a/src/Clerk/BackendAPI/Miscellaneous.cs +++ b/src/Clerk/BackendAPI/Miscellaneous.cs @@ -13,13 +13,13 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Various endpoints that do not belong in any particular category. @@ -45,10 +45,10 @@ public class Miscellaneous: IMiscellaneous { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -121,7 +121,11 @@ public async Task GetPublicInterstitialAsync(stri } }; } - else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode == 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode == 500 || responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Models/Components/EmailAddress.cs b/src/Clerk/BackendAPI/Models/Components/EmailAddress.cs index 9b8e8cd..23bf8c6 100644 --- a/src/Clerk/BackendAPI/Models/Components/EmailAddress.cs +++ b/src/Clerk/BackendAPI/Models/Components/EmailAddress.cs @@ -45,6 +45,16 @@ public class EmailAddress [JsonProperty("linked_to")] public List LinkedTo { get; set; } = default!; + /// + /// Indicates whether this email address domain matches an active enterprise connection.
+ /// + /// + /// + /// + ///
+ [JsonProperty("matches_sso_connection")] + public bool? MatchesSsoConnection { get; set; } + /// /// Unix timestamp of creation
/// diff --git a/src/Clerk/BackendAPI/Models/Components/Error.cs b/src/Clerk/BackendAPI/Models/Components/Error.cs index 681483a..147d503 100644 --- a/src/Clerk/BackendAPI/Models/Components/Error.cs +++ b/src/Clerk/BackendAPI/Models/Components/Error.cs @@ -11,12 +11,12 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; - using Newtonsoft.Json.Linq; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; - using System; public class ErrorType diff --git a/src/Clerk/BackendAPI/Models/Components/Oauth.cs b/src/Clerk/BackendAPI/Models/Components/FromOAuth.cs similarity index 68% rename from src/Clerk/BackendAPI/Models/Components/Oauth.cs rename to src/Clerk/BackendAPI/Models/Components/FromOAuth.cs index 33887eb..678ae86 100644 --- a/src/Clerk/BackendAPI/Models/Components/Oauth.cs +++ b/src/Clerk/BackendAPI/Models/Components/FromOAuth.cs @@ -13,23 +13,20 @@ namespace Clerk.BackendAPI.Models.Components using Clerk.BackendAPI.Utils; using Newtonsoft.Json; - public class Oauth + public class FromOAuth { [JsonProperty("status")] - public OauthVerificationStatus Status { get; set; } = default!; + public FromOAuthVerificationStatus Status { get; set; } = default!; [JsonProperty("strategy")] - public OauthVerificationStrategy Strategy { get; set; } = default!; - - [JsonProperty("external_verification_redirect_url")] - public string? ExternalVerificationRedirectUrl { get; set; } + public string Strategy { get; set; } = default!; [JsonProperty("error")] public Error? Error { get; set; } = null; - [JsonProperty("expire_at")] - public long ExpireAt { get; set; } = default!; + [JsonProperty("expire_at", NullValueHandling = NullValueHandling.Include)] + public long? ExpireAt { get; set; } [JsonProperty("attempts")] public long? Attempts { get; set; } = null; diff --git a/src/Clerk/BackendAPI/Models/Components/OauthVerificationStatus.cs b/src/Clerk/BackendAPI/Models/Components/FromOAuthVerificationStatus.cs similarity index 70% rename from src/Clerk/BackendAPI/Models/Components/OauthVerificationStatus.cs rename to src/Clerk/BackendAPI/Models/Components/FromOAuthVerificationStatus.cs index 43fa38e..240045a 100644 --- a/src/Clerk/BackendAPI/Models/Components/OauthVerificationStatus.cs +++ b/src/Clerk/BackendAPI/Models/Components/FromOAuthVerificationStatus.cs @@ -13,30 +13,24 @@ namespace Clerk.BackendAPI.Models.Components using Newtonsoft.Json; using System; - public enum OauthVerificationStatus + public enum FromOAuthVerificationStatus { [JsonProperty("unverified")] Unverified, [JsonProperty("verified")] Verified, - [JsonProperty("failed")] - Failed, - [JsonProperty("expired")] - Expired, - [JsonProperty("transferable")] - Transferable, } - public static class OauthVerificationStatusExtension + public static class FromOAuthVerificationStatusExtension { - public static string Value(this OauthVerificationStatus value) + public static string Value(this FromOAuthVerificationStatus value) { return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); } - public static OauthVerificationStatus ToEnum(this string value) + public static FromOAuthVerificationStatus ToEnum(this string value) { - foreach(var field in typeof(OauthVerificationStatus).GetFields()) + foreach(var field in typeof(FromOAuthVerificationStatus).GetFields()) { var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); if (attributes.Length == 0) @@ -49,14 +43,14 @@ public static OauthVerificationStatus ToEnum(this string value) { var enumVal = field.GetValue(null); - if (enumVal is OauthVerificationStatus) + if (enumVal is FromOAuthVerificationStatus) { - return (OauthVerificationStatus)enumVal; + return (FromOAuthVerificationStatus)enumVal; } } } - throw new Exception($"Unknown value {value} for enum OauthVerificationStatus"); + throw new Exception($"Unknown value {value} for enum FromOAuthVerificationStatus"); } } diff --git a/src/Clerk/BackendAPI/Models/Components/HTTPMetadata.cs b/src/Clerk/BackendAPI/Models/Components/HTTPMetadata.cs index 1ad2b67..c718756 100644 --- a/src/Clerk/BackendAPI/Models/Components/HTTPMetadata.cs +++ b/src/Clerk/BackendAPI/Models/Components/HTTPMetadata.cs @@ -11,8 +11,8 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Utils; using Newtonsoft.Json; - using System.Net.Http; using System; + using System.Net.Http; public class HTTPMetadata { diff --git a/src/Clerk/BackendAPI/Models/Components/Instance.cs b/src/Clerk/BackendAPI/Models/Components/Instance.cs new file mode 100644 index 0000000..775eeea --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Components/Instance.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Components +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System.Collections.Generic; + + /// + /// Success + /// + public class Instance + { + + /// + /// String representing the object's type. Objects of the same type share the same value. + /// + [JsonProperty("object")] + public InstanceObject? Object { get; set; } + + [JsonProperty("id")] + public string? Id { get; set; } + + [JsonProperty("environment_type")] + public string? EnvironmentType { get; set; } + + [JsonProperty("allowed_origins")] + public List? AllowedOrigins { get; set; } = null; + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/OauthVerificationStrategy.cs b/src/Clerk/BackendAPI/Models/Components/InstanceObject.cs similarity index 55% rename from src/Clerk/BackendAPI/Models/Components/OauthVerificationStrategy.cs rename to src/Clerk/BackendAPI/Models/Components/InstanceObject.cs index e527d4e..494eb98 100644 --- a/src/Clerk/BackendAPI/Models/Components/OauthVerificationStrategy.cs +++ b/src/Clerk/BackendAPI/Models/Components/InstanceObject.cs @@ -13,40 +13,25 @@ namespace Clerk.BackendAPI.Models.Components using Newtonsoft.Json; using System; - public enum OauthVerificationStrategy + /// + /// String representing the object's type. Objects of the same type share the same value. + /// + public enum InstanceObject { - [JsonProperty("oauth_google")] - OauthGoogle, - [JsonProperty("oauth_mock")] - OauthMock, - [JsonProperty("from_oauth_google")] - FromOauthGoogle, - [JsonProperty("from_oauth_discord")] - FromOauthDiscord, - [JsonProperty("from_oauth_microsoft")] - FromOauthMicrosoft, - [JsonProperty("oauth_apple")] - OauthApple, - [JsonProperty("oauth_microsoft")] - OauthMicrosoft, - [JsonProperty("oauth_github")] - OauthGithub, - [JsonProperty("email_link")] - EmailLink, - [JsonProperty("ticket")] - Ticket, + [JsonProperty("instance")] + Instance, } - public static class OauthVerificationStrategyExtension + public static class InstanceObjectExtension { - public static string Value(this OauthVerificationStrategy value) + public static string Value(this InstanceObject value) { return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); } - public static OauthVerificationStrategy ToEnum(this string value) + public static InstanceObject ToEnum(this string value) { - foreach(var field in typeof(OauthVerificationStrategy).GetFields()) + foreach(var field in typeof(InstanceObject).GetFields()) { var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); if (attributes.Length == 0) @@ -59,14 +44,14 @@ public static OauthVerificationStrategy ToEnum(this string value) { var enumVal = field.GetValue(null); - if (enumVal is OauthVerificationStrategy) + if (enumVal is InstanceObject) { - return (OauthVerificationStrategy)enumVal; + return (InstanceObject)enumVal; } } } - throw new Exception($"Unknown value {value} for enum OauthVerificationStrategy"); + throw new Exception($"Unknown value {value} for enum InstanceObject"); } } diff --git a/src/Clerk/BackendAPI/Models/Components/WellKnownJWKS.cs b/src/Clerk/BackendAPI/Models/Components/Jwks.cs similarity index 96% rename from src/Clerk/BackendAPI/Models/Components/WellKnownJWKS.cs rename to src/Clerk/BackendAPI/Models/Components/Jwks.cs index 609d468..491313f 100644 --- a/src/Clerk/BackendAPI/Models/Components/WellKnownJWKS.cs +++ b/src/Clerk/BackendAPI/Models/Components/Jwks.cs @@ -17,7 +17,7 @@ namespace Clerk.BackendAPI.Models.Components /// /// Get the JSON Web Key Set /// - public class WellKnownJWKS + public class Jwks { [JsonProperty("keys")] diff --git a/src/Clerk/BackendAPI/Models/Components/Keys.cs b/src/Clerk/BackendAPI/Models/Components/Keys.cs index 2378783..9051dd2 100644 --- a/src/Clerk/BackendAPI/Models/Components/Keys.cs +++ b/src/Clerk/BackendAPI/Models/Components/Keys.cs @@ -32,5 +32,11 @@ public class Keys [JsonProperty("e")] public string? E { get; set; } + + [JsonProperty("x")] + public string? X { get; set; } + + [JsonProperty("crv")] + public string? Crv { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/OAuthApplication.cs b/src/Clerk/BackendAPI/Models/Components/OAuthApplication.cs index 1c09aa0..fa200cb 100644 --- a/src/Clerk/BackendAPI/Models/Components/OAuthApplication.cs +++ b/src/Clerk/BackendAPI/Models/Components/OAuthApplication.cs @@ -49,6 +49,12 @@ public class OAuthApplication [JsonProperty("user_info_url")] public string UserInfoUrl { get; set; } = default!; + [JsonProperty("discovery_url")] + public string DiscoveryUrl { get; set; } = default!; + + [JsonProperty("token_introspection_url")] + public string TokenIntrospectionUrl { get; set; } = default!; + /// /// Unix timestamp of creation.
/// diff --git a/src/Clerk/BackendAPI/Models/Components/OAuthApplicationWithSecret.cs b/src/Clerk/BackendAPI/Models/Components/OAuthApplicationWithSecret.cs index c866168..c4c2d09 100644 --- a/src/Clerk/BackendAPI/Models/Components/OAuthApplicationWithSecret.cs +++ b/src/Clerk/BackendAPI/Models/Components/OAuthApplicationWithSecret.cs @@ -49,6 +49,12 @@ public class OAuthApplicationWithSecret [JsonProperty("user_info_url")] public string UserInfoUrl { get; set; } = default!; + [JsonProperty("discovery_url")] + public string DiscoveryUrl { get; set; } = default!; + + [JsonProperty("token_introspection_url")] + public string TokenIntrospectionUrl { get; set; } = default!; + /// /// Unix timestamp of creation.
/// diff --git a/src/Clerk/BackendAPI/Models/Components/Organization.cs b/src/Clerk/BackendAPI/Models/Components/Organization.cs index 409070b..a49c68f 100644 --- a/src/Clerk/BackendAPI/Models/Components/Organization.cs +++ b/src/Clerk/BackendAPI/Models/Components/Organization.cs @@ -45,7 +45,7 @@ public class Organization public Dictionary PrivateMetadata { get; set; } = default!; [JsonProperty("created_by")] - public string? CreatedBy { get; set; } + public string? CreatedBy { get; set; } = null; /// /// Unix timestamp of creation.
diff --git a/src/Clerk/BackendAPI/Models/Components/OrganizationInvitation.cs b/src/Clerk/BackendAPI/Models/Components/OrganizationInvitation.cs index 8186d06..bae0217 100644 --- a/src/Clerk/BackendAPI/Models/Components/OrganizationInvitation.cs +++ b/src/Clerk/BackendAPI/Models/Components/OrganizationInvitation.cs @@ -54,6 +54,19 @@ public class OrganizationInvitation [JsonProperty("private_metadata")] public Dictionary? PrivateMetadata { get; set; } + [JsonProperty("url")] + public string? Url { get; set; } = null; + + /// + /// Unix timestamp of expiration.
+ /// + /// + /// + /// + ///
+ [JsonProperty("expires_at")] + public long? ExpiresAt { get; set; } = null; + /// /// Unix timestamp of creation. /// diff --git a/src/Clerk/BackendAPI/Models/Components/OrganizationInvitationWithPublicOrganizationData.cs b/src/Clerk/BackendAPI/Models/Components/OrganizationInvitationWithPublicOrganizationData.cs index 361af78..cb4c7b5 100644 --- a/src/Clerk/BackendAPI/Models/Components/OrganizationInvitationWithPublicOrganizationData.cs +++ b/src/Clerk/BackendAPI/Models/Components/OrganizationInvitationWithPublicOrganizationData.cs @@ -54,6 +54,9 @@ public class OrganizationInvitationWithPublicOrganizationData [JsonProperty("private_metadata")] public Dictionary? PrivateMetadata { get; set; } + [JsonProperty("url")] + public string? Url { get; set; } = null; + [JsonProperty("public_organization_data")] public PublicOrganizationData? PublicOrganizationData { get; set; } diff --git a/src/Clerk/BackendAPI/Models/Components/OrganizationMembershipOrganization.cs b/src/Clerk/BackendAPI/Models/Components/OrganizationMembershipOrganization.cs index 63ccf85..9893116 100644 --- a/src/Clerk/BackendAPI/Models/Components/OrganizationMembershipOrganization.cs +++ b/src/Clerk/BackendAPI/Models/Components/OrganizationMembershipOrganization.cs @@ -45,7 +45,7 @@ public class OrganizationMembershipOrganization public Dictionary PrivateMetadata { get; set; } = default!; [JsonProperty("created_by")] - public string? CreatedBy { get; set; } + public string? CreatedBy { get; set; } = null; /// /// Unix timestamp of creation.
diff --git a/src/Clerk/BackendAPI/Models/Components/OrganizationWithLogo.cs b/src/Clerk/BackendAPI/Models/Components/OrganizationWithLogo.cs index 02fe795..c230f35 100644 --- a/src/Clerk/BackendAPI/Models/Components/OrganizationWithLogo.cs +++ b/src/Clerk/BackendAPI/Models/Components/OrganizationWithLogo.cs @@ -12,8 +12,8 @@ namespace Clerk.BackendAPI.Models.Components using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; using Newtonsoft.Json; - using System.Collections.Generic; using System; + using System.Collections.Generic; public class OrganizationWithLogo { @@ -46,7 +46,7 @@ public class OrganizationWithLogo public Dictionary PrivateMetadata { get; set; } = default!; [JsonProperty("created_by")] - public string? CreatedBy { get; set; } + public string? CreatedBy { get; set; } = null; /// /// Unix timestamp of creation.
diff --git a/src/Clerk/BackendAPI/Models/Components/PhoneNumberVerification.cs b/src/Clerk/BackendAPI/Models/Components/PhoneNumberVerification.cs index 2873d03..3230d71 100644 --- a/src/Clerk/BackendAPI/Models/Components/PhoneNumberVerification.cs +++ b/src/Clerk/BackendAPI/Models/Components/PhoneNumberVerification.cs @@ -11,12 +11,12 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; - using Newtonsoft.Json.Linq; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; - using System; public class PhoneNumberVerificationType diff --git a/src/Clerk/BackendAPI/Models/Components/SAMLAccountVerification.cs b/src/Clerk/BackendAPI/Models/Components/SAMLAccountVerification.cs index fdbca01..9f1ec81 100644 --- a/src/Clerk/BackendAPI/Models/Components/SAMLAccountVerification.cs +++ b/src/Clerk/BackendAPI/Models/Components/SAMLAccountVerification.cs @@ -11,12 +11,12 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; - using Newtonsoft.Json.Linq; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; - using System; public class SAMLAccountVerificationType diff --git a/src/Clerk/BackendAPI/Models/Components/SamlConnection.cs b/src/Clerk/BackendAPI/Models/Components/SamlConnection.cs index 115f8ca..502283e 100644 --- a/src/Clerk/BackendAPI/Models/Components/SamlConnection.cs +++ b/src/Clerk/BackendAPI/Models/Components/SamlConnection.cs @@ -11,12 +11,12 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; - using Newtonsoft.Json.Linq; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; - using System; public class SamlConnectionType diff --git a/src/Clerk/BackendAPI/Models/Components/SchemasPasskeyVerification.cs b/src/Clerk/BackendAPI/Models/Components/SchemasPasskeyVerification.cs index fc6c0b3..e8eae2b 100644 --- a/src/Clerk/BackendAPI/Models/Components/SchemasPasskeyVerification.cs +++ b/src/Clerk/BackendAPI/Models/Components/SchemasPasskeyVerification.cs @@ -11,12 +11,12 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; - using Newtonsoft.Json.Linq; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; - using System; public class SchemasPasskeyVerificationType diff --git a/src/Clerk/BackendAPI/Models/Components/SchemasSAMLConnection.cs b/src/Clerk/BackendAPI/Models/Components/SchemasSAMLConnection.cs index 3d01f40..1735f0e 100644 --- a/src/Clerk/BackendAPI/Models/Components/SchemasSAMLConnection.cs +++ b/src/Clerk/BackendAPI/Models/Components/SchemasSAMLConnection.cs @@ -52,6 +52,9 @@ public class SchemasSAMLConnection [JsonProperty("sp_metadata_url")] public string SpMetadataUrl { get; set; } = default!; + [JsonProperty("organization_id")] + public string? OrganizationId { get; set; } = null; + [JsonProperty("attribute_mapping")] public Models.Components.AttributeMapping? AttributeMapping { get; set; } diff --git a/src/Clerk/BackendAPI/Models/Components/SignUp.cs b/src/Clerk/BackendAPI/Models/Components/SignUp.cs index 354483e..1ce0aa7 100644 --- a/src/Clerk/BackendAPI/Models/Components/SignUp.cs +++ b/src/Clerk/BackendAPI/Models/Components/SignUp.cs @@ -86,6 +86,16 @@ public class SignUp [JsonProperty("abandon_at")] public long AbandonAt { get; set; } = default!; + /// + /// Unix timestamp at which the user accepted the legal requirements.
+ /// + /// + /// + /// + ///
+ [JsonProperty("legal_accepted_at")] + public long? LegalAcceptedAt { get; set; } = null; + [JsonProperty("external_account")] public ExternalAccount? ExternalAccount { get; set; } } diff --git a/src/Clerk/BackendAPI/Models/Components/Type.cs b/src/Clerk/BackendAPI/Models/Components/Type.cs index c89c41d..6644469 100644 --- a/src/Clerk/BackendAPI/Models/Components/Type.cs +++ b/src/Clerk/BackendAPI/Models/Components/Type.cs @@ -21,14 +21,12 @@ public enum Type OauthMock, [JsonProperty("saml")] Saml, - [JsonProperty("oauth_microsoft")] - OauthMicrosoft, - [JsonProperty("email_link")] - EmailLink, [JsonProperty("oauth_apple")] OauthApple, [JsonProperty("oauth_discord")] OauthDiscord, + [JsonProperty("oauth_microsoft")] + OauthMicrosoft, [JsonProperty("oauth_github")] OauthGithub, } diff --git a/src/Clerk/BackendAPI/Models/Components/User.cs b/src/Clerk/BackendAPI/Models/Components/User.cs index 5989cf6..ff5fa63 100644 --- a/src/Clerk/BackendAPI/Models/Components/User.cs +++ b/src/Clerk/BackendAPI/Models/Components/User.cs @@ -12,8 +12,8 @@ namespace Clerk.BackendAPI.Models.Components using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; using Newtonsoft.Json; - using System.Collections.Generic; using System; + using System.Collections.Generic; /// /// Success diff --git a/src/Clerk/BackendAPI/Models/Components/Verification.cs b/src/Clerk/BackendAPI/Models/Components/Verification.cs index eeec9c4..5e4f8d9 100644 --- a/src/Clerk/BackendAPI/Models/Components/Verification.cs +++ b/src/Clerk/BackendAPI/Models/Components/Verification.cs @@ -11,12 +11,12 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; - using Newtonsoft.Json.Linq; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; - using System; public class VerificationType @@ -28,7 +28,7 @@ public class VerificationType public static VerificationType Admin { get { return new VerificationType("Admin"); } } - public static VerificationType Oauth { get { return new VerificationType("Oauth"); } } + public static VerificationType FromOAuth { get { return new VerificationType("FromOAuth"); } } public static VerificationType Null { get { return new VerificationType("null"); } } @@ -38,7 +38,7 @@ public static VerificationType FromString(string v) { switch(v) { case "OTP": return Otp; case "Admin": return Admin; - case "Oauth": return Oauth; + case "FromOAuth": return FromOAuth; case "null": return Null; default: throw new ArgumentException("Invalid value for VerificationType"); } @@ -72,7 +72,7 @@ public Verification(VerificationType type) { public Admin? Admin { get; set; } [SpeakeasyMetadata("form:explode=true")] - public Oauth? Oauth { get; set; } + public FromOAuth? FromOAuth { get; set; } public VerificationType Type { get; set; } @@ -93,11 +93,11 @@ public static Verification CreateAdmin(Admin admin) { return res; } - public static Verification CreateOauth(Oauth oauth) { - VerificationType typ = VerificationType.Oauth; + public static Verification CreateFromOAuth(FromOAuth fromOAuth) { + VerificationType typ = VerificationType.FromOAuth; Verification res = new Verification(typ); - res.Oauth = oauth; + res.FromOAuth = fromOAuth; return res; } @@ -165,14 +165,14 @@ public class VerificationConverter : JsonConverter try { - return new Verification(VerificationType.Oauth) + return new Verification(VerificationType.FromOAuth) { - Oauth = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember(json) + FromOAuth = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember(json) }; } catch (ResponseBodyDeserializer.MissingMemberException) { - fallbackCandidates.Add((typeof(Oauth), new Verification(VerificationType.Oauth), "Oauth")); + fallbackCandidates.Add((typeof(FromOAuth), new Verification(VerificationType.FromOAuth), "FromOAuth")); } catch (ResponseBodyDeserializer.DeserializationException) { @@ -228,9 +228,9 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer writer.WriteRawValue(Utilities.SerializeJSON(res.Admin)); return; } - if (res.Oauth != null) + if (res.FromOAuth != null) { - writer.WriteRawValue(Utilities.SerializeJSON(res.Oauth)); + writer.WriteRawValue(Utilities.SerializeJSON(res.FromOAuth)); return; } diff --git a/src/Clerk/BackendAPI/Models/Components/VerificationError.cs b/src/Clerk/BackendAPI/Models/Components/VerificationError.cs index 0dc429e..4011a32 100644 --- a/src/Clerk/BackendAPI/Models/Components/VerificationError.cs +++ b/src/Clerk/BackendAPI/Models/Components/VerificationError.cs @@ -11,12 +11,12 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; - using Newtonsoft.Json.Linq; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; - using System; public class VerificationErrorType diff --git a/src/Clerk/BackendAPI/Models/Components/WaitlistEntries.cs b/src/Clerk/BackendAPI/Models/Components/WaitlistEntries.cs new file mode 100644 index 0000000..56d0256 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Components/WaitlistEntries.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Components +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System.Collections.Generic; + + /// + /// List of waitlist entries + /// + public class WaitlistEntries + { + + [JsonProperty("data")] + public List Data { get; set; } = default!; + + /// + /// Total number of waitlist entries + /// + [JsonProperty("total_count")] + public long TotalCount { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/WaitlistEntry.cs b/src/Clerk/BackendAPI/Models/Components/WaitlistEntry.cs new file mode 100644 index 0000000..d41142a --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Components/WaitlistEntry.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Components +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class WaitlistEntry + { + + [JsonProperty("object")] + public WaitlistEntryObject Object { get; set; } = default!; + + [JsonProperty("id")] + public string Id { get; set; } = default!; + + [JsonProperty("email_address")] + public string EmailAddress { get; set; } = default!; + + [JsonProperty("status")] + public WaitlistEntryStatus Status { get; set; } = default!; + + /// + /// Indicates if the waitlist entry is locked. Locked entries are being processed in a batch action and are unavailable for other actions.
+ /// + /// + /// + /// + ///
+ [JsonProperty("is_locked")] + public bool? IsLocked { get; set; } + + /// + /// Unix timestamp of creation.
+ /// + /// + /// + /// + ///
+ [JsonProperty("created_at")] + public long CreatedAt { get; set; } = default!; + + /// + /// Unix timestamp of last update.
+ /// + /// + /// + /// + ///
+ [JsonProperty("updated_at")] + public long UpdatedAt { get; set; } = default!; + + [JsonProperty("invitation")] + public WaitlistEntryInvitation? Invitation { get; set; } = null; + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitation.cs b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitation.cs new file mode 100644 index 0000000..045b46e --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitation.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Components +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System.Collections.Generic; + + public class WaitlistEntryInvitation + { + + [JsonProperty("object")] + public WaitlistEntryInvitationObject Object { get; set; } = default!; + + [JsonProperty("id")] + public string Id { get; set; } = default!; + + [JsonProperty("email_address")] + public string EmailAddress { get; set; } = default!; + + [JsonProperty("public_metadata")] + public Dictionary? PublicMetadata { get; set; } + + [JsonProperty("revoked")] + public bool? Revoked { get; set; } + + [JsonProperty("status")] + public WaitlistEntryInvitationStatus Status { get; set; } = default!; + + [JsonProperty("url")] + public string? Url { get; set; } = null; + + /// + /// Unix timestamp of expiration.
+ /// + /// + /// + /// + ///
+ [JsonProperty("expires_at")] + public long? ExpiresAt { get; set; } = null; + + /// + /// Unix timestamp of creation.
+ /// + /// + /// + /// + ///
+ [JsonProperty("created_at")] + public long CreatedAt { get; set; } = default!; + + /// + /// Unix timestamp of last update.
+ /// + /// + /// + /// + ///
+ [JsonProperty("updated_at")] + public long UpdatedAt { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitationObject.cs b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitationObject.cs new file mode 100644 index 0000000..86a5c79 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitationObject.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Components +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System; + + public enum WaitlistEntryInvitationObject + { + [JsonProperty("invitation")] + Invitation, + } + + public static class WaitlistEntryInvitationObjectExtension + { + public static string Value(this WaitlistEntryInvitationObject value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static WaitlistEntryInvitationObject ToEnum(this string value) + { + foreach(var field in typeof(WaitlistEntryInvitationObject).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is WaitlistEntryInvitationObject) + { + return (WaitlistEntryInvitationObject)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum WaitlistEntryInvitationObject"); + } + } + +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitationStatus.cs b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitationStatus.cs new file mode 100644 index 0000000..cec9be8 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryInvitationStatus.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Components +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System; + + public enum WaitlistEntryInvitationStatus + { + [JsonProperty("pending")] + Pending, + [JsonProperty("accepted")] + Accepted, + [JsonProperty("revoked")] + Revoked, + [JsonProperty("expired")] + Expired, + } + + public static class WaitlistEntryInvitationStatusExtension + { + public static string Value(this WaitlistEntryInvitationStatus value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static WaitlistEntryInvitationStatus ToEnum(this string value) + { + foreach(var field in typeof(WaitlistEntryInvitationStatus).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is WaitlistEntryInvitationStatus) + { + return (WaitlistEntryInvitationStatus)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum WaitlistEntryInvitationStatus"); + } + } + +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/WaitlistEntryObject.cs b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryObject.cs new file mode 100644 index 0000000..c7a4ad1 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryObject.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Components +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System; + + public enum WaitlistEntryObject + { + [JsonProperty("waitlist_entry")] + WaitlistEntry, + } + + public static class WaitlistEntryObjectExtension + { + public static string Value(this WaitlistEntryObject value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static WaitlistEntryObject ToEnum(this string value) + { + foreach(var field in typeof(WaitlistEntryObject).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is WaitlistEntryObject) + { + return (WaitlistEntryObject)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum WaitlistEntryObject"); + } + } + +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/WaitlistEntryStatus.cs b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryStatus.cs new file mode 100644 index 0000000..fc4919f --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Components/WaitlistEntryStatus.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Components +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System; + + public enum WaitlistEntryStatus + { + [JsonProperty("pending")] + Pending, + [JsonProperty("invited")] + Invited, + [JsonProperty("rejected")] + Rejected, + [JsonProperty("completed")] + Completed, + } + + public static class WaitlistEntryStatusExtension + { + public static string Value(this WaitlistEntryStatus value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static WaitlistEntryStatus ToEnum(this string value) + { + foreach(var field in typeof(WaitlistEntryStatus).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is WaitlistEntryStatus) + { + return (WaitlistEntryStatus)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum WaitlistEntryStatus"); + } + } + +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Components/Web3SignatureVerificationStrategy.cs b/src/Clerk/BackendAPI/Models/Components/Web3SignatureVerificationStrategy.cs index ff05c6d..5e9ea95 100644 --- a/src/Clerk/BackendAPI/Models/Components/Web3SignatureVerificationStrategy.cs +++ b/src/Clerk/BackendAPI/Models/Components/Web3SignatureVerificationStrategy.cs @@ -19,6 +19,8 @@ public enum Web3SignatureVerificationStrategy Web3MetamaskSignature, [JsonProperty("web3_coinbase_wallet_signature")] Web3CoinbaseWalletSignature, + [JsonProperty("web3_okx_wallet_signature")] + Web3OkxWalletSignature, } public static class Web3SignatureVerificationStrategyExtension diff --git a/src/Clerk/BackendAPI/Models/Components/Web3WalletVerification.cs b/src/Clerk/BackendAPI/Models/Components/Web3WalletVerification.cs index 85ab485..c7f4996 100644 --- a/src/Clerk/BackendAPI/Models/Components/Web3WalletVerification.cs +++ b/src/Clerk/BackendAPI/Models/Components/Web3WalletVerification.cs @@ -11,12 +11,12 @@ namespace Clerk.BackendAPI.Models.Components { using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Utils; - using Newtonsoft.Json.Linq; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; - using System; public class Web3WalletVerificationType diff --git a/src/Clerk/BackendAPI/Models/Errors/ClerkErrors.cs b/src/Clerk/BackendAPI/Models/Errors/ClerkErrors.cs index e19c667..91525ed 100644 --- a/src/Clerk/BackendAPI/Models/Errors/ClerkErrors.cs +++ b/src/Clerk/BackendAPI/Models/Errors/ClerkErrors.cs @@ -13,8 +13,8 @@ namespace Clerk.BackendAPI.Models.Errors using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Utils; using Newtonsoft.Json; - using System.Collections.Generic; using System; + using System.Collections.Generic; /// /// Request was not successful diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateBulkInvitationsResponse.cs b/src/Clerk/BackendAPI/Models/Operations/CreateBulkInvitationsResponse.cs new file mode 100644 index 0000000..3ec234b --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateBulkInvitationsResponse.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System.Collections.Generic; + + public class CreateBulkInvitationsResponse + { + + [JsonProperty("-")] + public HTTPMetadata HttpMeta { get; set; } = default!; + + /// + /// List of invitations + /// + public List? InvitationList { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateInvitationRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateInvitationRequestBody.cs index e871cd3..2bfb593 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateInvitationRequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateInvitationRequestBody.cs @@ -9,6 +9,7 @@ #nullable enable namespace Clerk.BackendAPI.Models.Operations { + using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -50,7 +51,7 @@ public class CreateInvitationRequestBody /// Optional flag which denotes whether an email invitation should be sent to the given email address.
/// /// - /// Defaults to true. + /// Defaults to `true`. /// ///
[JsonProperty("notify")] @@ -63,9 +64,19 @@ public class CreateInvitationRequestBody public bool? IgnoreExisting { get; set; } = false; /// - /// The number of days the invitation will be valid for. By default, the invitation does not expire. + /// The number of days the invitation will be valid for. By default, the invitation expires after 30 days. /// [JsonProperty("expires_in_days")] public long? ExpiresInDays { get; set; } = null; + + /// + /// The slug of the email template to use for the invitation email.
+ /// + /// + /// If not provided, the "invitation" template will be used. + /// + ///
+ [JsonProperty("template_slug")] + public TemplateSlug? TemplateSlug { get; set; } = null; } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateOAuthApplicationRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateOAuthApplicationRequestBody.cs index c4adde6..4f5f078 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateOAuthApplicationRequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateOAuthApplicationRequestBody.cs @@ -25,7 +25,7 @@ public class CreateOAuthApplicationRequestBody /// The callback URL of the new OAuth application ///
[JsonProperty("callback_url")] - public string CallbackUrl { get; set; } = default!; + public string? CallbackUrl { get; set; } /// /// Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequest.cs b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequest.cs index f7dcc74..fe7194f 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequest.cs @@ -23,6 +23,6 @@ public class CreateOrganizationInvitationBulkRequest public string OrganizationId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public List RequestBody { get; set; } = default!; + public List RequestBody { get; set; } = default!; } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequestBody.cs new file mode 100644 index 0000000..8a52fbe --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationBulkRequestBody.cs @@ -0,0 +1,67 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System.Collections.Generic; + + public class CreateOrganizationInvitationBulkRequestBody + { + + /// + /// The email address of the new member that is going to be invited to the organization + /// + [JsonProperty("email_address")] + public string EmailAddress { get; set; } = default!; + + /// + /// The ID of the user that invites the new member to the organization.
+ /// + /// + /// Must be an administrator in the organization. + /// + ///
+ [JsonProperty("inviter_user_id")] + public string? InviterUserId { get; set; } = null; + + /// + /// The role of the new member in the organization. + /// + [JsonProperty("role")] + public string Role { get; set; } = default!; + + /// + /// Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.
+ /// + /// + /// When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + /// + ///
+ [JsonProperty("public_metadata")] + public Dictionary? PublicMetadata { get; set; } + + /// + /// Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.
+ /// + /// + /// When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + /// + ///
+ [JsonProperty("private_metadata")] + public Dictionary? PrivateMetadata { get; set; } + + /// + /// Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + /// + [JsonProperty("redirect_url")] + public string? RedirectUrl { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequest.cs b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequest.cs index b909152..40f3e4f 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequest.cs @@ -22,6 +22,6 @@ public class CreateOrganizationInvitationRequest public string OrganizationId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public CreateOrganizationInvitationRequestBody RequestBody { get; set; } = default!; + public CreateOrganizationInvitationRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequestBody.cs index a998ac6..1fe4d6d 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationInvitationRequestBody.cs @@ -39,13 +39,21 @@ public class CreateOrganizationInvitationRequestBody public string Role { get; set; } = default!; /// - /// Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + /// Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.
+ /// + /// + /// When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + /// ///
[JsonProperty("public_metadata")] public Dictionary? PublicMetadata { get; set; } /// - /// Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + /// Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.
+ /// + /// + /// When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + /// ///
[JsonProperty("private_metadata")] public Dictionary? PrivateMetadata { get; set; } @@ -55,5 +63,11 @@ public class CreateOrganizationInvitationRequestBody ///
[JsonProperty("redirect_url")] public string? RedirectUrl { get; set; } + + /// + /// The number of days the invitation will be valid for. By default, the invitation has a 30 days expire. + /// + [JsonProperty("expires_in_days")] + public long? ExpiresInDays { get; set; } = null; } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationRequestBody.cs index ed6091a..eae547f 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationRequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateOrganizationRequestBody.cs @@ -30,7 +30,7 @@ public class CreateOrganizationRequestBody /// The ID of the User who will become the administrator for the new organization ///
[JsonProperty("created_by")] - public string CreatedBy { get; set; } = default!; + public string? CreatedBy { get; set; } /// /// Metadata saved on the organization, accessible only from the Backend API diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSAMLConnectionRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSAMLConnectionRequestBody.cs index f57d3fc..a47e307 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateSAMLConnectionRequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSAMLConnectionRequestBody.cs @@ -64,6 +64,12 @@ public class CreateSAMLConnectionRequestBody [JsonProperty("idp_metadata")] public string? IdpMetadata { get; set; } = null; + /// + /// The ID of the organization to which users of this SAML Connection will be added + /// + [JsonProperty("organization_id")] + public string? OrganizationId { get; set; } = null; + /// /// Define the attribute name mapping between Identity Provider and Clerk's user properties /// diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionRequestBody.cs new file mode 100644 index 0000000..6e313ce --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionRequestBody.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class CreateSessionRequestBody + { + + /// + /// The ID representing the user + /// + [JsonProperty("user_id")] + public string? UserId { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionResponse.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionResponse.cs new file mode 100644 index 0000000..f156898 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionResponse.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class CreateSessionResponse + { + + [JsonProperty("-")] + public HTTPMetadata HttpMeta { get; set; } = default!; + + /// + /// Success + /// + public Session? Session { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateObject.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateObject.cs new file mode 100644 index 0000000..495fdef --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateObject.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System; + + public enum CreateSessionTokenFromTemplateObject + { + [JsonProperty("token")] + Token, + } + + public static class CreateSessionTokenFromTemplateObjectExtension + { + public static string Value(this CreateSessionTokenFromTemplateObject value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static CreateSessionTokenFromTemplateObject ToEnum(this string value) + { + foreach(var field in typeof(CreateSessionTokenFromTemplateObject).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is CreateSessionTokenFromTemplateObject) + { + return (CreateSessionTokenFromTemplateObject)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum CreateSessionTokenFromTemplateObject"); + } + } + +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequest.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequest.cs index 4c8e471..0f91ba4 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequest.cs @@ -9,6 +9,7 @@ #nullable enable namespace Clerk.BackendAPI.Models.Operations { + using Clerk.BackendAPI.Models.Operations; using Clerk.BackendAPI.Utils; public class CreateSessionTokenFromTemplateRequest @@ -25,5 +26,8 @@ public class CreateSessionTokenFromTemplateRequest /// [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_name")] public string TemplateName { get; set; } = default!; + + [SpeakeasyMetadata("request:mediaType=application/json")] + public CreateSessionTokenFromTemplateRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequestBody.cs new file mode 100644 index 0000000..04da99c --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateRequestBody.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class CreateSessionTokenFromTemplateRequestBody + { + + /// + /// Use this parameter to override the JWT token lifetime. + /// + [JsonProperty("expires_in_seconds")] + public double? ExpiresInSeconds { get; set; } = null; + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateResponseBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateResponseBody.cs index 80db6c9..0388c75 100644 --- a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateResponseBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenFromTemplateResponseBody.cs @@ -20,7 +20,7 @@ public class CreateSessionTokenFromTemplateResponseBody { [JsonProperty("object")] - public Models.Operations.Object? Object { get; set; } + public CreateSessionTokenFromTemplateObject? Object { get; set; } [JsonProperty("jwt")] public string? Jwt { get; set; } diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenRequest.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenRequest.cs new file mode 100644 index 0000000..645252b --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenRequest.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Operations; + using Clerk.BackendAPI.Utils; + + public class CreateSessionTokenRequest + { + + /// + /// The ID of the session + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=session_id")] + public string SessionId { get; set; } = default!; + + [SpeakeasyMetadata("request:mediaType=application/json")] + public CreateSessionTokenRequestBody? RequestBody { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenRequestBody.cs new file mode 100644 index 0000000..648414c --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenRequestBody.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class CreateSessionTokenRequestBody + { + + /// + /// Use this parameter to override the default session token lifetime. + /// + [JsonProperty("expires_in_seconds")] + public double? ExpiresInSeconds { get; set; } = null; + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenResponse.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenResponse.cs new file mode 100644 index 0000000..9a7cf1b --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenResponse.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Models.Operations; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class CreateSessionTokenResponse + { + + [JsonProperty("-")] + public HTTPMetadata HttpMeta { get; set; } = default!; + + /// + /// OK + /// + public CreateSessionTokenResponseBody? Object { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenResponseBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenResponseBody.cs new file mode 100644 index 0000000..52c5ced --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateSessionTokenResponseBody.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Operations; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + /// + /// OK + /// + public class CreateSessionTokenResponseBody + { + + [JsonProperty("object")] + public Models.Operations.Object? Object { get; set; } + + [JsonProperty("jwt")] + public string? Jwt { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateWaitlistEntryRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/CreateWaitlistEntryRequestBody.cs new file mode 100644 index 0000000..2205dd5 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateWaitlistEntryRequestBody.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class CreateWaitlistEntryRequestBody + { + + /// + /// The email address to add to the waitlist + /// + [JsonProperty("email_address")] + public string EmailAddress { get; set; } = default!; + + /// + /// Optional flag which denotes whether an email invitation should be sent to the given email address.
+ /// + /// + /// Defaults to `true`. + /// + ///
+ [JsonProperty("notify")] + public bool? Notify { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/CreateWaitlistEntryResponse.cs b/src/Clerk/BackendAPI/Models/Operations/CreateWaitlistEntryResponse.cs new file mode 100644 index 0000000..4966705 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/CreateWaitlistEntryResponse.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class CreateWaitlistEntryResponse + { + + [JsonProperty("-")] + public HTTPMetadata HttpMeta { get; set; } = default!; + + /// + /// A Waitlist Entry + /// + public WaitlistEntry? WaitlistEntry { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/GetInstanceResponse.cs b/src/Clerk/BackendAPI/Models/Operations/GetInstanceResponse.cs new file mode 100644 index 0000000..81df46a --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/GetInstanceResponse.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class GetInstanceResponse + { + + [JsonProperty("-")] + public HTTPMetadata HttpMeta { get; set; } = default!; + + /// + /// Success + /// + public Instance? Instance { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/GetJWKSResponse.cs b/src/Clerk/BackendAPI/Models/Operations/GetJWKSResponse.cs index ed3216a..153520f 100644 --- a/src/Clerk/BackendAPI/Models/Operations/GetJWKSResponse.cs +++ b/src/Clerk/BackendAPI/Models/Operations/GetJWKSResponse.cs @@ -22,6 +22,6 @@ public class GetJWKSResponse /// /// Get the JSON Web Key Set /// - public WellKnownJWKS? WellKnownJWKS { get; set; } + public Models.Components.Jwks? Jwks { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/GetUserListRequest.cs b/src/Clerk/BackendAPI/Models/Operations/GetUserListRequest.cs index 51ec58c..50edd46 100644 --- a/src/Clerk/BackendAPI/Models/Operations/GetUserListRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/GetUserListRequest.cs @@ -10,6 +10,7 @@ namespace Clerk.BackendAPI.Models.Operations { using Clerk.BackendAPI.Utils; + using System; using System.Collections.Generic; public class GetUserListRequest @@ -116,16 +117,93 @@ public class GetUserListRequest public string? Query { get; set; } /// - /// Returns users that had session activity since the given date, with day precision.
+ /// Returns users with emails that match the given query, via case-insensitive partial match.
/// /// - /// Providing a value with higher precision than day will result in an error.
- /// Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. + /// For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`. ///
///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=email_address_query")] + public string? EmailAddressQuery { get; set; } + + /// + /// Returns users with phone numbers that match the given query, via case-insensitive partial match.
+ /// + /// + /// For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. + /// + ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=phone_number_query")] + public string? PhoneNumberQuery { get; set; } + + /// + /// Returns users with usernames that match the given query, via case-insensitive partial match.
+ /// + /// + /// For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. + /// + ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=username_query")] + public string? UsernameQuery { get; set; } + + /// + /// Returns users with names that match the given query, via case-insensitive partial match. + /// + [SpeakeasyMetadata("queryParam:style=form,explode=true,name=name_query")] + public string? NameQuery { get; set; } + + /// + /// Returns users whose last session activity was before the given date (with millisecond precision).
+ /// + /// + /// Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. + /// + ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=last_active_at_before")] + public long? LastActiveAtBefore { get; set; } + + /// + /// Returns users whose last session activity was after the given date (with millisecond precision).
+ /// + /// + /// Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. + /// + ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=last_active_at_after")] + public long? LastActiveAtAfter { get; set; } + + /// + /// Returns users that had session activity since the given date.
+ /// + /// + /// Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day.
+ /// Deprecated in favor of `last_active_at_after`. + ///
+ ///
+ [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=last_active_at_since")] public long? LastActiveAtSince { get; set; } + /// + /// Returns users who have been created before the given date (with millisecond precision).
+ /// + /// + /// Example: use 1730160000000 to retrieve users who have been created before 2024-10-29. + /// + ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=created_at_before")] + public long? CreatedAtBefore { get; set; } + + /// + /// Returns users who have been created after the given date (with millisecond precision).
+ /// + /// + /// Example: use 1730160000000 to retrieve users who have been created after 2024-10-29. + /// + ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=created_at_after")] + public long? CreatedAtAfter { get; set; } + /// /// Applies a limit to the number of results returned.
/// diff --git a/src/Clerk/BackendAPI/Models/Operations/GetUsersCountRequest.cs b/src/Clerk/BackendAPI/Models/Operations/GetUsersCountRequest.cs index b3fd091..28fe411 100644 --- a/src/Clerk/BackendAPI/Models/Operations/GetUsersCountRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/GetUsersCountRequest.cs @@ -91,5 +91,38 @@ public class GetUsersCountRequest ///
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")] public string? Query { get; set; } + + /// + /// Counts users with emails that match the given query, via case-insensitive partial match.
+ /// + /// + /// For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`,
+ /// and will be included in the resulting count. + ///
+ ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=email_address_query")] + public string? EmailAddressQuery { get; set; } + + /// + /// Counts users with phone numbers that match the given query, via case-insensitive partial match.
+ /// + /// + /// For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`,
+ /// and will be included in the resulting count. + ///
+ ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=phone_number_query")] + public string? PhoneNumberQuery { get; set; } + + /// + /// Counts users with usernames that match the given query, via case-insensitive partial match.
+ /// + /// + /// For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`,
+ /// and will be included in the resulting count. + ///
+ ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=username_query")] + public string? UsernameQuery { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/ListInvitationsRequest.cs b/src/Clerk/BackendAPI/Models/Operations/ListInvitationsRequest.cs index cd237c6..78fdae6 100644 --- a/src/Clerk/BackendAPI/Models/Operations/ListInvitationsRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/ListInvitationsRequest.cs @@ -41,5 +41,11 @@ public class ListInvitationsRequest ///
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=status")] public ListInvitationsQueryParamStatus? Status { get; set; } + + /// + /// Filter invitations based on their `email_address` or `id` + /// + [SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")] + public string? Query { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/ListSAMLConnectionsRequest.cs b/src/Clerk/BackendAPI/Models/Operations/ListSAMLConnectionsRequest.cs index 907da6c..9905e80 100644 --- a/src/Clerk/BackendAPI/Models/Operations/ListSAMLConnectionsRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/ListSAMLConnectionsRequest.cs @@ -10,6 +10,7 @@ namespace Clerk.BackendAPI.Models.Operations { using Clerk.BackendAPI.Utils; + using System.Collections.Generic; public class ListSAMLConnectionsRequest { @@ -34,5 +35,20 @@ public class ListSAMLConnectionsRequest ///
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=offset")] public long? Offset { get; set; } = 0; + + /// + /// Returns SAML connections that have an associated organization ID to the
+ /// + /// + /// given organizations.
+ /// For each organization id, the `+` and `-` can be
+ /// prepended to the id, which denote whether the
+ /// respective organization should be included or
+ /// excluded from the result set.
+ /// Accepts up to 100 organization ids. + ///
+ ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=organization_id")] + public List? OrganizationId { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesQueryParamStatus.cs b/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesQueryParamStatus.cs new file mode 100644 index 0000000..3d6bb55 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesQueryParamStatus.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System; + + /// + /// Filter waitlist entries by their status + /// + public enum ListWaitlistEntriesQueryParamStatus + { + [JsonProperty("pending")] + Pending, + [JsonProperty("invited")] + Invited, + [JsonProperty("completed")] + Completed, + [JsonProperty("rejected")] + Rejected, + } + + public static class ListWaitlistEntriesQueryParamStatusExtension + { + public static string Value(this ListWaitlistEntriesQueryParamStatus value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static ListWaitlistEntriesQueryParamStatus ToEnum(this string value) + { + foreach(var field in typeof(ListWaitlistEntriesQueryParamStatus).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is ListWaitlistEntriesQueryParamStatus) + { + return (ListWaitlistEntriesQueryParamStatus)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum ListWaitlistEntriesQueryParamStatus"); + } + } + +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesRequest.cs b/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesRequest.cs new file mode 100644 index 0000000..8398689 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesRequest.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Operations; + using Clerk.BackendAPI.Utils; + + public class ListWaitlistEntriesRequest + { + + /// + /// Applies a limit to the number of results returned.
+ /// + /// + /// Can be used for paginating the results together with `offset`. + /// + ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit")] + public long? Limit { get; set; } = 10; + + /// + /// Skip the first `offset` results when paginating.
+ /// + /// + /// Needs to be an integer greater or equal to zero.
+ /// To be used in conjunction with `limit`. + ///
+ ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=offset")] + public long? Offset { get; set; } = 0; + + /// + /// Filter waitlist entries by email address + /// + [SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")] + public string? Query { get; set; } + + /// + /// Filter waitlist entries by their status + /// + [SpeakeasyMetadata("queryParam:style=form,explode=true,name=status")] + public ListWaitlistEntriesQueryParamStatus? Status { get; set; } + + /// + /// Specify the order of results. Supported values are:
+ /// + /// + /// - `created_at`
+ /// - `email_address`
+ /// - `invited_at`
+ ///
+ /// Use `+` for ascending or `-` for descending order. Defaults to `-created_at`. + ///
+ ///
+ [SpeakeasyMetadata("queryParam:style=form,explode=true,name=order_by")] + public string? OrderBy { get; set; } = "-created_at"; + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesResponse.cs b/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesResponse.cs new file mode 100644 index 0000000..c4d7ef9 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/ListWaitlistEntriesResponse.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + + public class ListWaitlistEntriesResponse + { + + [JsonProperty("-")] + public HTTPMetadata HttpMeta { get; set; } = default!; + + /// + /// List of waitlist entries + /// + public Models.Components.WaitlistEntries? WaitlistEntries { get; set; } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/RequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/RequestBody.cs index 613dede..6d7802e 100644 --- a/src/Clerk/BackendAPI/Models/Operations/RequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/RequestBody.cs @@ -17,43 +17,52 @@ public class RequestBody { /// - /// The email address of the new member that is going to be invited to the organization + /// The email address the invitation will be sent to /// [JsonProperty("email_address")] public string EmailAddress { get; set; } = default!; /// - /// The ID of the user that invites the new member to the organization.
+ /// Metadata that will be attached to the newly created invitation.
/// /// - /// Must be an administrator in the organization. + /// 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. ///
///
- [JsonProperty("inviter_user_id")] - public string? InviterUserId { get; set; } = null; + [JsonProperty("public_metadata")] + public Dictionary? PublicMetadata { get; set; } /// - /// The role of the new member in the organization. + /// The URL where the user is redirected upon visiting the invitation link, where they can accept the invitation. Required if you have implemented a custom flow for handling application invitations. /// - [JsonProperty("role")] - public string Role { get; set; } = default!; + [JsonProperty("redirect_url")] + public string? RedirectUrl { get; set; } /// - /// Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + /// Optional flag which denotes whether an email invitation should be sent to the given email address.
+ /// + /// + /// Defaults to true. + /// ///
- [JsonProperty("public_metadata")] - public Dictionary? PublicMetadata { get; set; } + [JsonProperty("notify")] + public bool? Notify { get; set; } = true; /// - /// Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + /// Whether an invitation should be created if there is already an existing invitation for this email
+ /// + /// + /// address, or it's claimed by another user. + /// ///
- [JsonProperty("private_metadata")] - public Dictionary? PrivateMetadata { get; set; } + [JsonProperty("ignore_existing")] + public bool? IgnoreExisting { get; set; } = false; /// - /// Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + /// The number of days the invitation will be valid for. By default, the invitation expires after 30 days. /// - [JsonProperty("redirect_url")] - public string? RedirectUrl { get; set; } + [JsonProperty("expires_in_days")] + public long? ExpiresInDays { get; set; } = null; } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/ResponseBody.cs b/src/Clerk/BackendAPI/Models/Operations/ResponseBody.cs index 7d322b9..2921618 100644 --- a/src/Clerk/BackendAPI/Models/Operations/ResponseBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/ResponseBody.cs @@ -64,5 +64,11 @@ public class ResponseBody ///
[JsonProperty("token_secret")] public string? TokenSecret { get; set; } + + /// + /// Unix timestamp of the access token expiration. + /// + [JsonProperty("expires_at")] + public long? ExpiresAt { get; set; } = null; } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/TemplateSlug.cs b/src/Clerk/BackendAPI/Models/Operations/TemplateSlug.cs new file mode 100644 index 0000000..2dc1593 --- /dev/null +++ b/src/Clerk/BackendAPI/Models/Operations/TemplateSlug.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI.Models.Operations +{ + using Clerk.BackendAPI.Utils; + using Newtonsoft.Json; + using System; + + /// + /// The slug of the email template to use for the invitation email.
+ /// + /// + /// If not provided, the "invitation" template will be used. + /// + ///
+ public enum TemplateSlug + { + [JsonProperty("invitation")] + Invitation, + [JsonProperty("waitlist_invitation")] + WaitlistInvitation, + } + + public static class TemplateSlugExtension + { + public static string Value(this TemplateSlug value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static TemplateSlug ToEnum(this string value) + { + foreach(var field in typeof(TemplateSlug).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is TemplateSlug) + { + return (TemplateSlug)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum TemplateSlug"); + } + } + +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/UpdateEmailAddressRequest.cs b/src/Clerk/BackendAPI/Models/Operations/UpdateEmailAddressRequest.cs index 76892e3..2c8c728 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UpdateEmailAddressRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UpdateEmailAddressRequest.cs @@ -22,6 +22,6 @@ public class UpdateEmailAddressRequest public string EmailAddressId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public UpdateEmailAddressRequestBody RequestBody { get; set; } = default!; + public UpdateEmailAddressRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/UpdateInstanceRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/UpdateInstanceRequestBody.cs index e506fa2..75f6bfb 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UpdateInstanceRequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UpdateInstanceRequestBody.cs @@ -11,8 +11,8 @@ namespace Clerk.BackendAPI.Models.Operations { using Clerk.BackendAPI.Utils; using Newtonsoft.Json; - using System.Collections.Generic; using System; + using System.Collections.Generic; public class UpdateInstanceRequestBody { diff --git a/src/Clerk/BackendAPI/Models/Operations/UpdateJWTTemplateRequest.cs b/src/Clerk/BackendAPI/Models/Operations/UpdateJWTTemplateRequest.cs index 981e7cd..5dbfc3b 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UpdateJWTTemplateRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UpdateJWTTemplateRequest.cs @@ -22,6 +22,6 @@ public class UpdateJWTTemplateRequest public string TemplateId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public UpdateJWTTemplateRequestBody RequestBody { get; set; } = default!; + public UpdateJWTTemplateRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/UpdateOrganizationMembershipMetadataRequest.cs b/src/Clerk/BackendAPI/Models/Operations/UpdateOrganizationMembershipMetadataRequest.cs index 820714a..d68ca74 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UpdateOrganizationMembershipMetadataRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UpdateOrganizationMembershipMetadataRequest.cs @@ -28,6 +28,6 @@ public class UpdateOrganizationMembershipMetadataRequest public string UserId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public UpdateOrganizationMembershipMetadataRequestBody RequestBody { get; set; } = default!; + public UpdateOrganizationMembershipMetadataRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/UpdatePhoneNumberRequest.cs b/src/Clerk/BackendAPI/Models/Operations/UpdatePhoneNumberRequest.cs index bb81f24..2597bcd 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UpdatePhoneNumberRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UpdatePhoneNumberRequest.cs @@ -22,6 +22,6 @@ public class UpdatePhoneNumberRequest public string PhoneNumberId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public UpdatePhoneNumberRequestBody RequestBody { get; set; } = default!; + public UpdatePhoneNumberRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/UpdateSAMLConnectionRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/UpdateSAMLConnectionRequestBody.cs index c9ca88d..7ed330a 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UpdateSAMLConnectionRequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UpdateSAMLConnectionRequestBody.cs @@ -58,6 +58,12 @@ public class UpdateSAMLConnectionRequestBody [JsonProperty("idp_metadata")] public string? IdpMetadata { get; set; } = null; + /// + /// The ID of the organization to which users of this SAML Connection will be added + /// + [JsonProperty("organization_id")] + public string? OrganizationId { get; set; } = null; + /// /// Define the atrtibute name mapping between Identity Provider and Clerk's user properties /// diff --git a/src/Clerk/BackendAPI/Models/Operations/UpdateSignUpRequest.cs b/src/Clerk/BackendAPI/Models/Operations/UpdateSignUpRequest.cs index 0451607..3776da4 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UpdateSignUpRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UpdateSignUpRequest.cs @@ -22,6 +22,6 @@ public class UpdateSignUpRequest public string Id { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public UpdateSignUpRequestBody RequestBody { get; set; } = default!; + public UpdateSignUpRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/UpdateUserMetadataRequest.cs b/src/Clerk/BackendAPI/Models/Operations/UpdateUserMetadataRequest.cs index eae8a36..51e95c5 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UpdateUserMetadataRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UpdateUserMetadataRequest.cs @@ -22,6 +22,6 @@ public class UpdateUserMetadataRequest public string UserId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public UpdateUserMetadataRequestBody RequestBody { get; set; } = default!; + public UpdateUserMetadataRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/UploadOrganizationLogoRequest.cs b/src/Clerk/BackendAPI/Models/Operations/UploadOrganizationLogoRequest.cs index d0bd8dd..98415e7 100644 --- a/src/Clerk/BackendAPI/Models/Operations/UploadOrganizationLogoRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/UploadOrganizationLogoRequest.cs @@ -22,6 +22,6 @@ public class UploadOrganizationLogoRequest public string OrganizationId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=multipart/form-data")] - public UploadOrganizationLogoRequestBody RequestBody { get; set; } = default!; + public UploadOrganizationLogoRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/VerifyClientRequestBody.cs b/src/Clerk/BackendAPI/Models/Operations/VerifyClientRequestBody.cs index 069e763..281399b 100644 --- a/src/Clerk/BackendAPI/Models/Operations/VerifyClientRequestBody.cs +++ b/src/Clerk/BackendAPI/Models/Operations/VerifyClientRequestBody.cs @@ -12,6 +12,9 @@ namespace Clerk.BackendAPI.Models.Operations using Clerk.BackendAPI.Utils; using Newtonsoft.Json; + /// + /// Parameters. + /// public class VerifyClientRequestBody { diff --git a/src/Clerk/BackendAPI/Models/Operations/VerifyPasswordRequest.cs b/src/Clerk/BackendAPI/Models/Operations/VerifyPasswordRequest.cs index 32e7297..dc8393f 100644 --- a/src/Clerk/BackendAPI/Models/Operations/VerifyPasswordRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/VerifyPasswordRequest.cs @@ -22,6 +22,6 @@ public class VerifyPasswordRequest public string UserId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public VerifyPasswordRequestBody RequestBody { get; set; } = default!; + public VerifyPasswordRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Models/Operations/VerifyTOTPRequest.cs b/src/Clerk/BackendAPI/Models/Operations/VerifyTOTPRequest.cs index 4b9bbd9..11f013d 100644 --- a/src/Clerk/BackendAPI/Models/Operations/VerifyTOTPRequest.cs +++ b/src/Clerk/BackendAPI/Models/Operations/VerifyTOTPRequest.cs @@ -22,6 +22,6 @@ public class VerifyTOTPRequest public string UserId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public VerifyTOTPRequestBody RequestBody { get; set; } = default!; + public VerifyTOTPRequestBody? RequestBody { get; set; } } } \ No newline at end of file diff --git a/src/Clerk/BackendAPI/OauthApplications.cs b/src/Clerk/BackendAPI/OauthApplications.cs index 16ef1b5..26c02b7 100644 --- a/src/Clerk/BackendAPI/OauthApplications.cs +++ b/src/Clerk/BackendAPI/OauthApplications.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IOauthApplications { @@ -35,7 +35,7 @@ public interface IOauthApplications /// Most recent OAuth applications will be returned first. /// ///
- Task ListAsync(long? limit = null, long? offset = null); + Task ListAsync(long? limit = 10, long? offset = 0); /// /// Create an OAuth application @@ -46,7 +46,7 @@ public interface IOauthApplications /// All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... /// /// - Task CreateAsync(CreateOAuthApplicationRequestBody request); + Task CreateAsync(CreateOAuthApplicationRequestBody? request = null); /// /// Retrieve an OAuth application by ID @@ -91,10 +91,10 @@ public class OauthApplications: IOauthApplications { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -107,7 +107,7 @@ public OauthApplications(ISpeakeasyHttpClient client, Func ListAsync(long? limit = null, long? offset = null) + public async Task ListAsync(long? limit = 10, long? offset = 0) { var request = new ListOAuthApplicationsRequest() { @@ -190,7 +190,11 @@ public async Task ListAsync(long? limit = null, l throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -198,7 +202,7 @@ public async Task ListAsync(long? limit = null, l throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task CreateAsync(CreateOAuthApplicationRequestBody request) + public async Task CreateAsync(CreateOAuthApplicationRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -207,7 +211,7 @@ public async Task CreateAsync(CreateOAuthApplica var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -258,7 +262,7 @@ public async Task CreateAsync(CreateOAuthApplica { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var response = new CreateOAuthApplicationResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -277,13 +281,17 @@ public async Task CreateAsync(CreateOAuthApplica { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); throw obj!; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -373,7 +381,11 @@ public async Task GetAsync(string oauthApplicationI throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -470,7 +482,11 @@ public async Task UpdateAsync(string oauthApplic throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -560,7 +576,11 @@ public async Task DeleteAsync(string oauthApplic throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -650,7 +670,11 @@ public async Task RotateSecretAsync(string throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/OrganizationDomain.cs b/src/Clerk/BackendAPI/OrganizationDomain.cs index 19809a4..62d5483 100644 --- a/src/Clerk/BackendAPI/OrganizationDomain.cs +++ b/src/Clerk/BackendAPI/OrganizationDomain.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IOrganizationDomain { @@ -39,10 +39,10 @@ public class OrganizationDomain: IOrganizationDomain { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -145,7 +145,11 @@ public async Task UpdateAsync(string organizat throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/OrganizationDomains.cs b/src/Clerk/BackendAPI/OrganizationDomains.cs index 3b3d791..77ffec7 100644 --- a/src/Clerk/BackendAPI/OrganizationDomains.cs +++ b/src/Clerk/BackendAPI/OrganizationDomains.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IOrganizationDomains { @@ -57,10 +57,10 @@ public class OrganizationDomains: IOrganizationDomains { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -162,7 +162,11 @@ public async Task CreateAsync(string organizat throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -248,7 +252,11 @@ public async Task ListAsync(ListOrganizationDom throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -339,7 +347,11 @@ public async Task DeleteAsync(string organizat throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/OrganizationInvitations.cs b/src/Clerk/BackendAPI/OrganizationInvitations.cs index 7ae222a..844d0e5 100644 --- a/src/Clerk/BackendAPI/OrganizationInvitations.cs +++ b/src/Clerk/BackendAPI/OrganizationInvitations.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IOrganizationInvitations { @@ -61,7 +61,7 @@ public interface IOrganizationInvitations /// When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. /// /// - Task CreateAsync(string organizationId, CreateOrganizationInvitationRequestBody requestBody); + Task CreateAsync(string organizationId, CreateOrganizationInvitationRequestBody? requestBody = null); /// /// Get a list of organization invitations @@ -75,7 +75,7 @@ public interface IOrganizationInvitations /// Any invitations created as a result of an Organization Domain are not included in the results. /// /// - Task ListAsync(string organizationId, long? limit = null, long? offset = null, ListOrganizationInvitationsQueryParamStatus? status = null); + Task ListAsync(string organizationId, long? limit = 10, long? offset = 0, ListOrganizationInvitationsQueryParamStatus? status = null); /// /// Bulk create and send organization invitations @@ -96,7 +96,7 @@ public interface IOrganizationInvitations /// When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. /// /// - Task CreateBulkAsync(string organizationId, List requestBody); + Task CreateBulkAsync(string organizationId, List requestBody); /// /// Get a list of pending organization invitations @@ -110,7 +110,7 @@ public interface IOrganizationInvitations /// Any invitations created as a result of an Organization Domain are not included in the results. /// /// - Task ListPendingAsync(string organizationId, long? limit = null, long? offset = null); + Task ListPendingAsync(string organizationId, long? limit = 10, long? offset = 0); /// /// Retrieve an organization invitation by ID @@ -139,10 +139,10 @@ public class OrganizationInvitations: IOrganizationInvitations { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -223,7 +223,7 @@ public async Task ListForInstanceAs throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{400, 404, 422, 500}.Contains(responseStatusCode)) + else if(new List{400, 404, 422}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -233,7 +233,21 @@ public async Task ListForInstanceAs throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode == 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -241,7 +255,7 @@ public async Task ListForInstanceAs throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task CreateAsync(string organizationId, CreateOrganizationInvitationRequestBody requestBody) + public async Task CreateAsync(string organizationId, CreateOrganizationInvitationRequestBody? requestBody = null) { var request = new CreateOrganizationInvitationRequest() { @@ -254,7 +268,7 @@ public async Task CreateAsync(string organ var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -330,7 +344,11 @@ public async Task CreateAsync(string organ throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -338,7 +356,7 @@ public async Task CreateAsync(string organ throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task ListAsync(string organizationId, long? limit = null, long? offset = null, ListOrganizationInvitationsQueryParamStatus? status = null) + public async Task ListAsync(string organizationId, long? limit = 10, long? offset = 0, ListOrganizationInvitationsQueryParamStatus? status = null) { var request = new ListOrganizationInvitationsRequest() { @@ -423,7 +441,11 @@ public async Task ListAsync(string organiza throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -431,7 +453,7 @@ public async Task ListAsync(string organiza throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task CreateBulkAsync(string organizationId, List requestBody) + public async Task CreateBulkAsync(string organizationId, List requestBody) { var request = new CreateOrganizationInvitationBulkRequest() { @@ -520,7 +542,11 @@ public async Task CreateBulkAsync(stri throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -529,7 +555,7 @@ public async Task CreateBulkAsync(stri } [Obsolete("This method will be removed in a future release, please migrate away from it as soon as possible")] - public async Task ListPendingAsync(string organizationId, long? limit = null, long? offset = null) + public async Task ListPendingAsync(string organizationId, long? limit = 10, long? offset = 0) { var request = new ListPendingOrganizationInvitationsRequest() { @@ -613,7 +639,11 @@ public async Task ListPendingAsync(s throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -704,7 +734,11 @@ public async Task GetAsync(string organizatio throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -802,7 +836,11 @@ public async Task RevokeAsync(string organ throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/OrganizationMemberships.cs b/src/Clerk/BackendAPI/OrganizationMemberships.cs index a91c4fc..b8a49e0 100644 --- a/src/Clerk/BackendAPI/OrganizationMemberships.cs +++ b/src/Clerk/BackendAPI/OrganizationMemberships.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IOrganizationMemberships { @@ -41,7 +41,7 @@ public interface IOrganizationMemberships /// Retrieves all user memberships for the given organization /// /// - Task ListAsync(string organizationId, long? limit = null, long? offset = null, string? orderBy = null); + Task ListAsync(string organizationId, long? limit = 10, long? offset = 0, string? orderBy = null); /// /// Update an organization membership @@ -70,7 +70,7 @@ public interface IOrganizationMemberships /// You can remove metadata keys at any level by setting their value to `null`. /// /// - Task UpdateMetadataAsync(string organizationId, string userId, UpdateOrganizationMembershipMetadataRequestBody requestBody); + Task UpdateMetadataAsync(string organizationId, string userId, UpdateOrganizationMembershipMetadataRequestBody? requestBody = null); /// /// Get a list of all organization memberships within an instance. @@ -79,17 +79,17 @@ public interface IOrganizationMemberships /// Retrieves all organization user memberships for the given instance. /// /// - Task ListForInstanceAsync(long? limit = null, long? offset = null, string? orderBy = null); + Task ListForInstanceAsync(long? limit = 10, long? offset = 0, string? orderBy = null); } public class OrganizationMemberships: IOrganizationMemberships { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -191,7 +191,11 @@ public async Task CreateAsync(string organ throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -199,7 +203,7 @@ public async Task CreateAsync(string organ throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task ListAsync(string organizationId, long? limit = null, long? offset = null, string? orderBy = null) + public async Task ListAsync(string organizationId, long? limit = 10, long? offset = 0, string? orderBy = null) { var request = new ListOrganizationMembershipsRequest() { @@ -284,7 +288,11 @@ public async Task ListAsync(string organiza throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -327,7 +335,7 @@ public async Task UpdateAsync(string organ httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 404 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode == 404 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -372,7 +380,7 @@ public async Task UpdateAsync(string organ throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{400, 404, 422}.Contains(responseStatusCode)) + else if(new List{404, 422}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -382,7 +390,11 @@ public async Task UpdateAsync(string organ throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -418,7 +430,7 @@ public async Task DeleteAsync(string organ httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -463,7 +475,7 @@ public async Task DeleteAsync(string organ throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{400, 401, 404}.Contains(responseStatusCode)) + else if(new List{401, 404}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -473,7 +485,11 @@ public async Task DeleteAsync(string organ throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -481,7 +497,7 @@ public async Task DeleteAsync(string organ throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task UpdateMetadataAsync(string organizationId, string userId, UpdateOrganizationMembershipMetadataRequestBody requestBody) + public async Task UpdateMetadataAsync(string organizationId, string userId, UpdateOrganizationMembershipMetadataRequestBody? requestBody = null) { var request = new UpdateOrganizationMembershipMetadataRequest() { @@ -495,7 +511,7 @@ public async Task UpdateMetadataAs var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -571,7 +587,11 @@ public async Task UpdateMetadataAs throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -579,7 +599,7 @@ public async Task UpdateMetadataAs throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task ListForInstanceAsync(long? limit = null, long? offset = null, string? orderBy = null) + public async Task ListForInstanceAsync(long? limit = 10, long? offset = 0, string? orderBy = null) { var request = new InstanceGetOrganizationMembershipsRequest() { @@ -653,7 +673,17 @@ public async Task ListForInstanceAsy throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{400, 401, 422, 500}.Contains(responseStatusCode)) + else if(new List{400, 401, 422}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode == 500) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -663,7 +693,11 @@ public async Task ListForInstanceAsy throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Organizations.cs b/src/Clerk/BackendAPI/Organizations.cs index 60e4156..1fd9c96 100644 --- a/src/Clerk/BackendAPI/Organizations.cs +++ b/src/Clerk/BackendAPI/Organizations.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Organizations are used to group members under a common entity and provide shared access to resources. @@ -47,7 +47,6 @@ public interface IOrganizations /// /// /// Creates a new organization with the given name for an instance.
- /// In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator.
/// You can specify an optional slug for the new organization.
/// If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash "-".
/// Organization slugs must be unique for the instance.
@@ -59,7 +58,7 @@ public interface IOrganizations /// the next time they create a session, presuming they don't explicitly set a different organization as active before then. ///
///
- Task CreateAsync(CreateOrganizationRequestBody request); + Task CreateAsync(CreateOrganizationRequestBody? request = null); /// /// Retrieve an organization by ID or slug @@ -112,7 +111,7 @@ public interface IOrganizations /// Only the following file content types are supported: `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `image/x-icon`, `image/vnd.microsoft.icon`. /// /// - Task UploadLogoAsync(string organizationId, UploadOrganizationLogoRequestBody requestBody); + Task UploadLogoAsync(string organizationId, UploadOrganizationLogoRequestBody? requestBody = null); /// /// Delete the organization's logo. @@ -129,10 +128,10 @@ public class Organizations: IOrganizations { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -223,7 +222,11 @@ public async Task ListAsync(ListOrganizationsRequest? throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -231,7 +234,7 @@ public async Task ListAsync(ListOrganizationsRequest? throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task CreateAsync(CreateOrganizationRequestBody request) + public async Task CreateAsync(CreateOrganizationRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -240,7 +243,7 @@ public async Task CreateAsync(CreateOrganizationRequ var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -291,7 +294,7 @@ public async Task CreateAsync(CreateOrganizationRequ { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var response = new CreateOrganizationResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -310,13 +313,17 @@ public async Task CreateAsync(CreateOrganizationRequ { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); throw obj!; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -407,7 +414,11 @@ public async Task GetAsync(string organizationId, bool? throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -504,7 +515,11 @@ public async Task UpdateAsync(string organizationId, throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -594,7 +609,11 @@ public async Task DeleteAsync(string organizationId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -691,7 +710,11 @@ public async Task MergeMetadataAsync(string o throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -699,7 +722,7 @@ public async Task MergeMetadataAsync(string o throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task UploadLogoAsync(string organizationId, UploadOrganizationLogoRequestBody requestBody) + public async Task UploadLogoAsync(string organizationId, UploadOrganizationLogoRequestBody? requestBody = null) { var request = new UploadOrganizationLogoRequest() { @@ -712,7 +735,7 @@ public async Task UploadLogoAsync(string organiz var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "multipart", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "multipart", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -788,7 +811,11 @@ public async Task UploadLogoAsync(string organiz throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -878,7 +905,11 @@ public async Task DeleteLogoAsync(string organiz throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/PhoneNumbers.cs b/src/Clerk/BackendAPI/PhoneNumbers.cs index 72f8d29..2f0b2eb 100644 --- a/src/Clerk/BackendAPI/PhoneNumbers.cs +++ b/src/Clerk/BackendAPI/PhoneNumbers.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IPhoneNumbers { @@ -59,17 +59,17 @@ public interface IPhoneNumbers /// Updates a phone number /// /// - Task UpdateAsync(string phoneNumberId, UpdatePhoneNumberRequestBody requestBody); + Task UpdateAsync(string phoneNumberId, UpdatePhoneNumberRequestBody? requestBody = null); } public class PhoneNumbers: IPhoneNumbers { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -167,7 +167,11 @@ public async Task CreateAsync(CreatePhoneNumberReques throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -257,7 +261,11 @@ public async Task GetAsync(string phoneNumberId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -347,7 +355,11 @@ public async Task DeleteAsync(string phoneNumberId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -355,7 +367,7 @@ public async Task DeleteAsync(string phoneNumberId) throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task UpdateAsync(string phoneNumberId, UpdatePhoneNumberRequestBody requestBody) + public async Task UpdateAsync(string phoneNumberId, UpdatePhoneNumberRequestBody? requestBody = null) { var request = new UpdatePhoneNumberRequest() { @@ -368,7 +380,7 @@ public async Task UpdateAsync(string phoneNumberId, U var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -444,7 +456,11 @@ public async Task UpdateAsync(string phoneNumberId, U throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/ProxyChecks.cs b/src/Clerk/BackendAPI/ProxyChecks.cs index 6de15e0..c067399 100644 --- a/src/Clerk/BackendAPI/ProxyChecks.cs +++ b/src/Clerk/BackendAPI/ProxyChecks.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IProxyChecks { @@ -46,10 +46,10 @@ public class ProxyChecks: IProxyChecks { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -147,7 +147,11 @@ public async Task VerifyAsync(VerifyDomainProxyReques throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/RedirectUrls.cs b/src/Clerk/BackendAPI/RedirectUrls.cs index 1bd1890..2484f37 100644 --- a/src/Clerk/BackendAPI/RedirectUrls.cs +++ b/src/Clerk/BackendAPI/RedirectUrls.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IRedirectUrls { @@ -66,10 +66,10 @@ public class RedirectUrls: IRedirectUrls { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -151,7 +151,11 @@ public async Task ListAsync() throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -244,7 +248,11 @@ public async Task CreateAsync(CreateRedirectURLReques throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -334,7 +342,11 @@ public async Task GetAsync(string id) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -424,7 +436,11 @@ public async Task DeleteAsync(string id) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/SamlConnections.cs b/src/Clerk/BackendAPI/SamlConnections.cs index f2dc313..bea3221 100644 --- a/src/Clerk/BackendAPI/SamlConnections.cs +++ b/src/Clerk/BackendAPI/SamlConnections.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface ISamlConnections { @@ -34,7 +34,7 @@ public interface ISamlConnections /// The SAML Connections are ordered by descending creation date and the most recent will be returned first. /// ///
- Task ListAsync(long? limit = null, long? offset = null); + Task ListAsync(long? limit = 10, long? offset = 0, List? organizationId = null); /// /// Create a SAML Connection @@ -43,7 +43,7 @@ public interface ISamlConnections /// Create a new SAML Connection. /// /// - Task CreateAsync(CreateSAMLConnectionRequestBody request); + Task CreateAsync(CreateSAMLConnectionRequestBody? request = null); /// /// Retrieve a SAML Connection by ID @@ -77,10 +77,10 @@ public class SamlConnections: ISamlConnections { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -93,12 +93,13 @@ public SamlConnections(ISpeakeasyHttpClient client, Func ListAsync(long? limit = null, long? offset = null) + public async Task ListAsync(long? limit = 10, long? offset = 0, List? organizationId = null) { var request = new ListSAMLConnectionsRequest() { Limit = limit, Offset = offset, + OrganizationId = organizationId, }; string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/saml_connections", request); @@ -176,7 +177,11 @@ public async Task ListAsync(long? limit = null, lon throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -184,7 +189,7 @@ public async Task ListAsync(long? limit = null, lon throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task CreateAsync(CreateSAMLConnectionRequestBody request) + public async Task CreateAsync(CreateSAMLConnectionRequestBody? request = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -193,7 +198,7 @@ public async Task CreateAsync(CreateSAMLConnection var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -214,7 +219,7 @@ public async Task CreateAsync(CreateSAMLConnection httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 402 || _statusCode == 403 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -244,7 +249,7 @@ public async Task CreateAsync(CreateSAMLConnection { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var response = new CreateSAMLConnectionResponse() { HttpMeta = new Models.Components.HTTPMetadata() @@ -259,17 +264,21 @@ public async Task CreateAsync(CreateSAMLConnection throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{402, 403, 422}.Contains(responseStatusCode)) + else if(new List{402, 403, 404, 422}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); throw obj!; } throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -359,7 +368,11 @@ public async Task GetAsync(string samlConnectionId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -456,7 +469,11 @@ public async Task UpdateAsync(string samlConnectio throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -546,7 +563,11 @@ public async Task DeleteAsync(string samlConnectio throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Sessions.cs b/src/Clerk/BackendAPI/Sessions.cs index a976e60..5b5ea46 100644 --- a/src/Clerk/BackendAPI/Sessions.cs +++ b/src/Clerk/BackendAPI/Sessions.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// The Session object is an abstraction over an HTTP session.
@@ -47,6 +47,17 @@ public interface ISessions ///
Task ListAsync(GetSessionListRequest? request = null); + /// + /// Create a new active session + /// + /// + /// Create a new active session for the provided user ID.
+ ///
+ /// This operation is only available for Clerk Development instances. + ///
+ ///
+ Task CreateSessionAsync(CreateSessionRequestBody? request = null); + /// /// Retrieve a session /// @@ -78,6 +89,15 @@ public interface ISessions /// Task VerifyAsync(string sessionId, VerifySessionRequestBody? requestBody = null); + /// + /// Create a session token + /// + /// + /// Creates a session JSON Web Token (JWT) based on a session. + /// + /// + Task CreateSessionTokenAsync(string sessionId, CreateSessionTokenRequestBody? requestBody = null); + /// /// Create a session token from a jwt template /// @@ -85,7 +105,7 @@ public interface ISessions /// Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined for your instance /// /// - Task CreateTokenAsync(string sessionId, string templateName); + Task CreateTokenAsync(string sessionId, string templateName, CreateSessionTokenFromTemplateRequestBody? requestBody = null); } /// @@ -102,10 +122,10 @@ public class Sessions: ISessions { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -196,7 +216,108 @@ public async Task ListAsync(GetSessionListRequest? reque throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + + throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); + } + + public async Task CreateSessionAsync(CreateSessionRequestBody? request = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/sessions"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("createSession", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var response = new CreateSessionResponse() + { + HttpMeta = new Models.Components.HTTPMetadata() + { + Response = httpResponse, + Request = httpRequest + } + }; + response.Session = obj; + return response; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(new List{400, 401, 404, 422}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -286,7 +407,11 @@ public async Task GetAsync(string sessionId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -376,7 +501,11 @@ public async Task RevokeAsync(string sessionId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -474,7 +603,112 @@ public async Task VerifyAsync(string sessionId, VerifySes throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + + throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); + } + + public async Task CreateSessionTokenAsync(string sessionId, CreateSessionTokenRequestBody? requestBody = null) + { + var request = new CreateSessionTokenRequest() + { + SessionId = sessionId, + RequestBody = requestBody, + }; + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/sessions/{session_id}/tokens", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("CreateSessionToken", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var response = new CreateSessionTokenResponse() + { + HttpMeta = new Models.Components.HTTPMetadata() + { + Response = httpResponse, + Request = httpRequest + } + }; + response.Object = obj; + return response; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(new List{401, 404}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -482,12 +716,13 @@ public async Task VerifyAsync(string sessionId, VerifySes throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task CreateTokenAsync(string sessionId, string templateName) + public async Task CreateTokenAsync(string sessionId, string templateName, CreateSessionTokenFromTemplateRequestBody? requestBody = null) { var request = new CreateSessionTokenFromTemplateRequest() { SessionId = sessionId, TemplateName = templateName, + RequestBody = requestBody, }; string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/sessions/{session_id}/tokens/{template_name}", request); @@ -495,6 +730,12 @@ public async Task CreateTokenAsync(strin var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + if (_securitySource != null) { httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); @@ -565,7 +806,11 @@ public async Task CreateTokenAsync(strin throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/SignInTokens.cs b/src/Clerk/BackendAPI/SignInTokens.cs index 90cc1a7..1c2cb85 100644 --- a/src/Clerk/BackendAPI/SignInTokens.cs +++ b/src/Clerk/BackendAPI/SignInTokens.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface ISignInTokens { @@ -50,10 +50,10 @@ public class SignInTokens: ISignInTokens { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -151,7 +151,11 @@ public async Task CreateAsync(CreateSignInTokenReques throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -241,7 +245,11 @@ public async Task RevokeAsync(string signInTokenId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/SignUps.cs b/src/Clerk/BackendAPI/SignUps.cs index 1d11471..040307c 100644 --- a/src/Clerk/BackendAPI/SignUps.cs +++ b/src/Clerk/BackendAPI/SignUps.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface ISignUps { @@ -32,17 +32,17 @@ public interface ISignUps /// Update the sign-up with the given ID /// /// - Task UpdateAsync(string id, UpdateSignUpRequestBody requestBody); + Task UpdateAsync(string id, UpdateSignUpRequestBody? requestBody = null); } public class SignUps: ISignUps { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -55,7 +55,7 @@ public SignUps(ISpeakeasyHttpClient client, Func UpdateAsync(string id, UpdateSignUpRequestBody requestBody) + public async Task UpdateAsync(string id, UpdateSignUpRequestBody? requestBody = null) { var request = new UpdateSignUpRequest() { @@ -68,7 +68,7 @@ public async Task UpdateAsync(string id, UpdateSignUpReque var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -144,7 +144,11 @@ public async Task UpdateAsync(string id, UpdateSignUpReque throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/TestingTokens.cs b/src/Clerk/BackendAPI/TestingTokens.cs index ff6d6bd..ffae124 100644 --- a/src/Clerk/BackendAPI/TestingTokens.cs +++ b/src/Clerk/BackendAPI/TestingTokens.cs @@ -13,13 +13,13 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; - using System; public interface ITestingTokens { @@ -28,7 +28,7 @@ public interface ITestingTokens /// Retrieve a new testing token /// /// - /// Retrieve a new testing token. Only available for development instances. + /// Retrieve a new testing token. /// ///
Task CreateAsync(); @@ -38,10 +38,10 @@ public class TestingTokens: ITestingTokens { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -78,7 +78,7 @@ public async Task CreateAsync() httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -123,7 +123,11 @@ public async Task CreateAsync() throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/UserWeb3Wallets.cs b/src/Clerk/BackendAPI/UserWeb3Wallets.cs index a952902..881e85c 100644 --- a/src/Clerk/BackendAPI/UserWeb3Wallets.cs +++ b/src/Clerk/BackendAPI/UserWeb3Wallets.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; public interface IUserWeb3Wallets { @@ -39,10 +39,10 @@ public class UserWeb3Wallets: IUserWeb3Wallets { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -128,7 +128,17 @@ public async Task DeleteAsync(string userId, strin throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{400, 403, 404, 500}.Contains(responseStatusCode)) + else if(new List{400, 403, 404}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode == 500) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -138,7 +148,11 @@ public async Task DeleteAsync(string userId, strin throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/Users.cs b/src/Clerk/BackendAPI/Users.cs index 2063b24..d4bcbf9 100644 --- a/src/Clerk/BackendAPI/Users.cs +++ b/src/Clerk/BackendAPI/Users.cs @@ -13,14 +13,14 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// The user object represents a user that has successfully signed up to your application. @@ -171,7 +171,7 @@ public interface IUsers /// You can remove metadata keys at any level by setting their value to `null`. /// /// - Task UpdateMetadataAsync(string userId, UpdateUserMetadataRequestBody requestBody); + Task UpdateMetadataAsync(string userId, UpdateUserMetadataRequestBody? requestBody = null); /// /// Retrieve the OAuth access token of a user @@ -190,7 +190,7 @@ public interface IUsers /// Retrieve a paginated list of the user's organization memberships /// /// - Task GetOrganizationMembershipsAsync(string userId, long? limit = null, long? offset = null); + Task GetOrganizationMembershipsAsync(string userId, long? limit = 10, long? offset = 0); /// /// Retrieve all invitations for a user @@ -199,7 +199,7 @@ public interface IUsers /// Retrieve a paginated list of the user's organization invitations /// /// - Task GetOrganizationInvitationsAsync(string userId, long? limit = null, long? offset = null, QueryParamStatus? status = null); + Task GetOrganizationInvitationsAsync(string userId, long? limit = 10, long? offset = 0, QueryParamStatus? status = null); /// /// Verify the password of a user @@ -209,7 +209,7 @@ public interface IUsers /// Useful for custom auth flows and re-verification. /// /// - Task VerifyPasswordAsync(string userId, VerifyPasswordRequestBody requestBody); + Task VerifyPasswordAsync(string userId, VerifyPasswordRequestBody? requestBody = null); /// /// Verify a TOTP or backup code for a user @@ -221,7 +221,7 @@ public interface IUsers /// Useful for custom auth flows and re-verification. /// /// - Task VerifyTotpAsync(string userId, VerifyTOTPRequestBody requestBody); + Task VerifyTotpAsync(string userId, VerifyTOTPRequestBody? requestBody = null); /// /// Disable a user's MFA methods @@ -288,10 +288,10 @@ public class Users: IUsers { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -382,7 +382,11 @@ public async Task ListAsync(GetUserListRequest? request = n throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -475,7 +479,11 @@ public async Task CreateAsync(CreateUserRequestBody? request throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -561,7 +569,11 @@ public async Task CountAsync(GetUsersCountRequest? reques throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -651,7 +663,11 @@ public async Task GetAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -748,7 +764,11 @@ public async Task UpdateAsync(string userId, UpdateUserReque throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -838,7 +858,11 @@ public async Task DeleteAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -928,7 +952,11 @@ public async Task BanAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1018,7 +1046,11 @@ public async Task UnbanAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1108,7 +1140,11 @@ public async Task LockAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1198,7 +1234,11 @@ public async Task UnlockAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1295,7 +1335,11 @@ public async Task SetProfileImageAsync(string userI throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1385,7 +1429,11 @@ public async Task DeleteProfileImageAsync(string throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1393,7 +1441,7 @@ public async Task DeleteProfileImageAsync(string throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task UpdateMetadataAsync(string userId, UpdateUserMetadataRequestBody requestBody) + public async Task UpdateMetadataAsync(string userId, UpdateUserMetadataRequestBody? requestBody = null) { var request = new UpdateUserMetadataRequest() { @@ -1406,7 +1454,7 @@ public async Task UpdateMetadataAsync(string userId, var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -1482,7 +1530,11 @@ public async Task UpdateMetadataAsync(string userId, throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1518,7 +1570,7 @@ public async Task GetOAuthAccessTokenAsync(string u httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode == 400 || _statusCode == 404 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -1563,7 +1615,7 @@ public async Task GetOAuthAccessTokenAsync(string u throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{400, 422}.Contains(responseStatusCode)) + else if(new List{400, 404, 422}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -1573,7 +1625,11 @@ public async Task GetOAuthAccessTokenAsync(string u throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1581,7 +1637,7 @@ public async Task GetOAuthAccessTokenAsync(string u throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task GetOrganizationMembershipsAsync(string userId, long? limit = null, long? offset = null) + public async Task GetOrganizationMembershipsAsync(string userId, long? limit = 10, long? offset = 0) { var request = new UsersGetOrganizationMembershipsRequest() { @@ -1665,7 +1721,11 @@ public async Task GetOrganizationMember throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1673,7 +1733,7 @@ public async Task GetOrganizationMember throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task GetOrganizationInvitationsAsync(string userId, long? limit = null, long? offset = null, QueryParamStatus? status = null) + public async Task GetOrganizationInvitationsAsync(string userId, long? limit = 10, long? offset = 0, QueryParamStatus? status = null) { var request = new UsersGetOrganizationInvitationsRequest() { @@ -1758,7 +1818,11 @@ public async Task GetOrganizationInvita throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1766,7 +1830,7 @@ public async Task GetOrganizationInvita throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task VerifyPasswordAsync(string userId, VerifyPasswordRequestBody requestBody) + public async Task VerifyPasswordAsync(string userId, VerifyPasswordRequestBody? requestBody = null) { var request = new VerifyPasswordRequest() { @@ -1779,7 +1843,7 @@ public async Task VerifyPasswordAsync(string userId, Ver var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -1845,7 +1909,7 @@ public async Task VerifyPasswordAsync(string userId, Ver throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode == 422 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode == 422 || responseStatusCode >= 400 && responseStatusCode < 500) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1859,11 +1923,15 @@ public async Task VerifyPasswordAsync(string userId, Ver throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } - public async Task VerifyTotpAsync(string userId, VerifyTOTPRequestBody requestBody) + public async Task VerifyTotpAsync(string userId, VerifyTOTPRequestBody? requestBody = null) { var request = new VerifyTOTPRequest() { @@ -1876,7 +1944,7 @@ public async Task VerifyTotpAsync(string userId, VerifyTOTPR var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); httpRequest.Headers.Add("user-agent", _userAgent); - var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) { httpRequest.Content = serializedBody; @@ -1942,7 +2010,7 @@ public async Task VerifyTotpAsync(string userId, VerifyTOTPR throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode == 422 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode == 422 || responseStatusCode >= 400 && responseStatusCode < 500) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -1956,6 +2024,10 @@ public async Task VerifyTotpAsync(string userId, VerifyTOTPR throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); } @@ -2032,7 +2104,7 @@ public async Task DisableMfaAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{404, 500}.Contains(responseStatusCode)) + else if(responseStatusCode == 404) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -2042,7 +2114,21 @@ public async Task DisableMfaAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode == 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -2122,7 +2208,17 @@ public async Task DeleteBackupCodeAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{404, 500}.Contains(responseStatusCode)) + else if(responseStatusCode == 404) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode == 500) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -2132,7 +2228,11 @@ public async Task DeleteBackupCodeAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -2213,7 +2313,7 @@ public async Task DeletePasskeyAsync(string userId, s throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{403, 404, 500}.Contains(responseStatusCode)) + else if(new List{403, 404}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -2223,7 +2323,21 @@ public async Task DeletePasskeyAsync(string userId, s throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode == 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -2303,7 +2417,17 @@ public async Task CreateTotpAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{403, 404, 500}.Contains(responseStatusCode)) + else if(new List{403, 404}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode == 500) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -2313,7 +2437,11 @@ public async Task CreateTotpAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -2393,7 +2521,17 @@ public async Task DeleteTOTPAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{404, 500}.Contains(responseStatusCode)) + else if(responseStatusCode == 404) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode == 500) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -2403,7 +2541,11 @@ public async Task DeleteTOTPAsync(string userId) throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -2484,7 +2626,17 @@ public async Task DeleteExternalAccountAsync(stri throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(new List{400, 403, 404, 500}.Contains(responseStatusCode)) + else if(new List{400, 403, 404}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode == 500) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -2494,7 +2646,11 @@ public async Task DeleteExternalAccountAsync(stri throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } diff --git a/src/Clerk/BackendAPI/WaitlistEntries.cs b/src/Clerk/BackendAPI/WaitlistEntries.cs new file mode 100644 index 0000000..aca04ee --- /dev/null +++ b/src/Clerk/BackendAPI/WaitlistEntries.cs @@ -0,0 +1,247 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Clerk.BackendAPI +{ + using Clerk.BackendAPI.Hooks; + using Clerk.BackendAPI.Models.Components; + using Clerk.BackendAPI.Models.Errors; + using Clerk.BackendAPI.Models.Operations; + using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; + using Newtonsoft.Json; + using System; + using System.Collections.Generic; + using System.Net.Http; + using System.Net.Http.Headers; + using System.Threading.Tasks; + + public interface IWaitlistEntries + { + + /// + /// List all waitlist entries + /// + /// + /// Retrieve a list of waitlist entries for the instance.
+ /// Entries are ordered by creation date in descending order by default.
+ /// Supports filtering by email address or status and pagination with limit and offset parameters. + ///
+ ///
+ Task ListWaitlistEntriesAsync(ListWaitlistEntriesRequest? request = null); + + /// + /// Create a waitlist entry + /// + /// + /// Creates a new waitlist entry for the given email address.
+ /// If the email address is already on the waitlist, no new entry will be created and the existing waitlist entry will be returned. + ///
+ ///
+ Task CreateWaitlistEntryAsync(CreateWaitlistEntryRequestBody? request = null); + } + + public class WaitlistEntries: IWaitlistEntries + { + public SDKConfig SDKConfiguration { get; private set; } + private const string _language = "csharp"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; + private const string _openapiDocVersion = "v1"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; + private string _serverUrl = ""; + private ISpeakeasyHttpClient _client; + private Func? _securitySource; + + public WaitlistEntries(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + { + _client = client; + _securitySource = securitySource; + _serverUrl = serverUrl; + SDKConfiguration = config; + } + + public async Task ListWaitlistEntriesAsync(ListWaitlistEntriesRequest? request = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/waitlist_entries", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("ListWaitlistEntries", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var response = new ListWaitlistEntriesResponse() + { + HttpMeta = new Models.Components.HTTPMetadata() + { + Response = httpResponse, + Request = httpRequest + } + }; + response.WaitlistEntries = obj; + return response; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + + throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); + } + + public async Task CreateWaitlistEntryAsync(CreateWaitlistEntryRequestBody? request = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/waitlist_entries"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("CreateWaitlistEntry", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode == 400 || _statusCode == 422 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var response = new CreateWaitlistEntryResponse() + { + HttpMeta = new Models.Components.HTTPMetadata() + { + Response = httpResponse, + Request = httpRequest + } + }; + response.WaitlistEntry = obj; + return response; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(new List{400, 422}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + throw obj!; + } + + throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + + throw new Models.Errors.SDKError("Unknown status code received", httpRequest, httpResponse); + } + } +} \ No newline at end of file diff --git a/src/Clerk/BackendAPI/Webhooks.cs b/src/Clerk/BackendAPI/Webhooks.cs index 0691a08..0e41497 100644 --- a/src/Clerk/BackendAPI/Webhooks.cs +++ b/src/Clerk/BackendAPI/Webhooks.cs @@ -13,13 +13,13 @@ namespace Clerk.BackendAPI using Clerk.BackendAPI.Models.Components; using Clerk.BackendAPI.Models.Errors; using Clerk.BackendAPI.Models.Operations; - using Clerk.BackendAPI.Utils.Retries; using Clerk.BackendAPI.Utils; + using Clerk.BackendAPI.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; - using System; /// /// You can configure webhooks to be notified about various events that happen on your instance. @@ -66,10 +66,10 @@ public class Webhooks: IWebhooks { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.2.4"; - private const string _sdkGenVersion = "2.481.0"; + private const string _sdkVersion = "0.3.0"; + private const string _sdkGenVersion = "2.495.0"; private const string _openapiDocVersion = "v1"; - private const string _userAgent = "speakeasy-sdk/csharp 0.2.4 2.481.0 v1 Clerk.BackendAPI"; + private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.495.0 v1 Clerk.BackendAPI"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -161,7 +161,11 @@ public async Task CreateSvixAppAsync() throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -240,7 +244,11 @@ public async Task DeleteSvixAppAsync() throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); } @@ -327,7 +335,11 @@ public async Task GenerateSvixAuthURLAsync() throw new Models.Errors.SDKError("Unknown content type received", httpRequest, httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKError("API error occurred", httpRequest, httpResponse); }