diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1553282 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# Linux start script should use lf +/gradlew text eol=lf + +# These are Windows script files and should use crlf +*.bat text eol=crlf + +# This allows generated code to be indexed correctly +*.java linguist-generated=false + diff --git a/.github/workflows/sdk_generation.yaml b/.github/workflows/sdk_generation.yaml new file mode 100644 index 0000000..7525d1f --- /dev/null +++ b/.github/workflows/sdk_generation.yaml @@ -0,0 +1,25 @@ +name: Generate +permissions: + checks: write + contents: write + pull-requests: write + statuses: write +"on": + workflow_dispatch: + inputs: + force: + description: Force generation of SDKs + type: boolean + default: false + schedule: + - cron: 0 0 * * * +jobs: + generate: + uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 + with: + force: ${{ github.event.inputs.force }} + mode: pr + speakeasy_version: latest + secrets: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..df0a985 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Ignore Gradle project-specific cache directory +.gradle +# Ignore Gradle build output directory +build +bin/ +# Ignore IDE-specific configs +.project +.settings/ +.DS_Store diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock new file mode 100755 index 0000000..546f031 --- /dev/null +++ b/.speakeasy/gen.lock @@ -0,0 +1,1129 @@ +lockVersion: 2.0.0 +id: 1d22a5a4-8bac-42e3-b164-121fcacf66c9 +management: + docChecksum: c4aa5fe08445d9bd9cce938a8e22a9bd + docVersion: v1 + speakeasyVersion: 1.307.1 + generationVersion: 2.342.2 + releaseVersion: 0.0.1 + configChecksum: ded0598933a8d75e7def29ab016062a4 +features: + java: + additionalDependencies: 0.1.0 + constsAndDefaults: 0.1.1 + core: 3.23.0 + deprecations: 2.81.1 + examples: 2.81.3 + flattening: 2.81.1 + globalSecurity: 2.82.5 + globalSecurityCallbacks: 0.1.0 + globalSecurityFlattening: 0.1.0 + globalServerURLs: 2.82.1 + groups: 2.81.2 + nameOverrides: 2.81.3 + nullables: 0.1.0 + pagination: 0.2.2 + sdkHooks: 0.1.0 + unions: 0.0.4 +generatedFiles: + - src/main/java/com/clerk/backend_api/SecuritySource.java + - src/main/java/com/clerk/backend_api/SDKConfiguration.java + - src/main/java/com/clerk/backend_api/Miscellaneous.java + - src/main/java/com/clerk/backend_api/Jwks.java + - src/main/java/com/clerk/backend_api/Clients.java + - src/main/java/com/clerk/backend_api/EmailAddresses.java + - src/main/java/com/clerk/backend_api/PhoneNumbers.java + - src/main/java/com/clerk/backend_api/Sessions.java + - src/main/java/com/clerk/backend_api/Templates.java + - src/main/java/com/clerk/backend_api/Users.java + - src/main/java/com/clerk/backend_api/Invitations.java + - src/main/java/com/clerk/backend_api/Allowlist.java + - src/main/java/com/clerk/backend_api/Blocklist.java + - src/main/java/com/clerk/backend_api/Instance.java + - src/main/java/com/clerk/backend_api/Actors.java + - src/main/java/com/clerk/backend_api/Domains.java + - src/main/java/com/clerk/backend_api/Webhooks.java + - src/main/java/com/clerk/backend_api/JwtTemplates.java + - src/main/java/com/clerk/backend_api/Organizations.java + - src/main/java/com/clerk/backend_api/OrganizationInvitations.java + - src/main/java/com/clerk/backend_api/OrganizationMemberships.java + - src/main/java/com/clerk/backend_api/Proxy.java + - src/main/java/com/clerk/backend_api/RedirectURLs.java + - src/main/java/com/clerk/backend_api/SignInTokens.java + - src/main/java/com/clerk/backend_api/SignUps.java + - src/main/java/com/clerk/backend_api/OAuthApplications.java + - src/main/java/com/clerk/backend_api/SamlConnections.java + - src/main/java/com/clerk/backend_api/TestingTokens.java + - src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetJWKSRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetClientListRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyClientRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetClientRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetSessionListRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetSessionRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeSessionRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetTemplateListRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/RevertTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetUserListRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateUserRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetUsersCountRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetUserRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteUserRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/BanUserRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UnbanUserRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/LockUserRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UnlockUserRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DisableMFARequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateInvitationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListInvitationsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListAllowlistIdentifiersRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListBlocklistIdentifiersRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListDomainsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/AddDomainRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteDomainRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSvixAppRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteSvixAppRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GenerateSvixAuthURLRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListJWTTemplatesRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetOrganizationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListRedirectURLsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/CreateTestingTokenRequestBuilder.java + - src/main/java/com/clerk/backend_api/models/operations/SDKMethodInterfaces.java + - src/main/java/com/clerk/backend_api/Clerk.java + - .gitattributes + - build.gradle + - gradle/wrapper/gradle-wrapper.jar + - gradle/wrapper/gradle-wrapper.properties + - gradlew + - gradlew.bat + - settings.gradle + - src/main/java/com/clerk/backend_api/utils/BackoffStrategy.java + - src/main/java/com/clerk/backend_api/utils/BigDecimalString.java + - src/main/java/com/clerk/backend_api/utils/BigIntegerString.java + - src/main/java/com/clerk/backend_api/utils/Deserializers.java + - src/main/java/com/clerk/backend_api/utils/EventStream.java + - src/main/java/com/clerk/backend_api/utils/EventStreamLineReader.java + - src/main/java/com/clerk/backend_api/utils/EventStreamMessage.java + - src/main/java/com/clerk/backend_api/utils/EventStreamReader.java + - src/main/java/com/clerk/backend_api/utils/FormMetadata.java + - src/main/java/com/clerk/backend_api/utils/HTTPClient.java + - src/main/java/com/clerk/backend_api/utils/HTTPRequest.java + - src/main/java/com/clerk/backend_api/utils/HeaderMetadata.java + - src/main/java/com/clerk/backend_api/utils/Hook.java + - src/main/java/com/clerk/backend_api/utils/Hooks.java + - src/main/java/com/clerk/backend_api/utils/JSON.java + - src/main/java/com/clerk/backend_api/utils/LazySingletonValue.java + - src/main/java/com/clerk/backend_api/utils/Metadata.java + - src/main/java/com/clerk/backend_api/utils/MultipartFormMetadata.java + - src/main/java/com/clerk/backend_api/utils/OneOfDeserializer.java + - src/main/java/com/clerk/backend_api/utils/Options.java + - src/main/java/com/clerk/backend_api/utils/PathParamsMetadata.java + - src/main/java/com/clerk/backend_api/utils/QueryParameters.java + - src/main/java/com/clerk/backend_api/utils/QueryParamsMetadata.java + - src/main/java/com/clerk/backend_api/utils/RequestBody.java + - src/main/java/com/clerk/backend_api/utils/RequestMetadata.java + - src/main/java/com/clerk/backend_api/utils/Response.java + - src/main/java/com/clerk/backend_api/utils/Retries.java + - src/main/java/com/clerk/backend_api/utils/RetryConfig.java + - src/main/java/com/clerk/backend_api/utils/Security.java + - src/main/java/com/clerk/backend_api/utils/SecurityMetadata.java + - src/main/java/com/clerk/backend_api/utils/SerializedBody.java + - src/main/java/com/clerk/backend_api/utils/SpeakeasyHTTPClient.java + - src/main/java/com/clerk/backend_api/utils/SpeakeasyMetadata.java + - src/main/java/com/clerk/backend_api/utils/TypedObject.java + - src/main/java/com/clerk/backend_api/utils/Types.java + - src/main/java/com/clerk/backend_api/utils/Utils.java + - src/main/java/com/clerk/backend_api/models/errors/AuthException.java + - src/main/java/com/clerk/backend_api/models/errors/SDKError.java + - src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetJWKSResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetClientListRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetClientListResponse.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyClientRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyClientResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetClientRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetClientResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberResponse.java + - src/main/java/com/clerk/backend_api/models/operations/Status.java + - src/main/java/com/clerk/backend_api/models/operations/GetSessionListRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetSessionListResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetSessionRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetSessionResponse.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeSessionRequest.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeSessionResponse.java + - src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequest.java + - src/main/java/com/clerk/backend_api/models/operations/VerifySessionResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateRequest.java + - src/main/java/com/clerk/backend_api/models/operations/Object.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateResponseBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/TemplateType.java + - src/main/java/com/clerk/backend_api/models/operations/GetTemplateListRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetTemplateListResponse.java + - src/main/java/com/clerk/backend_api/models/operations/PathParamTemplateType.java + - src/main/java/com/clerk/backend_api/models/operations/GetTemplateRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpsertTemplatePathParamTemplateType.java + - src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/RevertTemplatePathParamTemplateType.java + - src/main/java/com/clerk/backend_api/models/operations/RevertTemplateRequest.java + - src/main/java/com/clerk/backend_api/models/operations/RevertTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequest.java + - src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateResponseBody.java + - src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryPathParamTemplateType.java + - src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequest.java + - src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetUserListRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetUserListResponse.java + - src/main/java/com/clerk/backend_api/models/operations/PasswordHasher.java + - src/main/java/com/clerk/backend_api/models/operations/PublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/PrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UnsafeMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/CreateUserRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateUserResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetUsersCountRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetUsersCountResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetUserRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetUserResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserPasswordHasher.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserUnsafeMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteUserRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteUserResponse.java + - src/main/java/com/clerk/backend_api/models/operations/BanUserRequest.java + - src/main/java/com/clerk/backend_api/models/operations/BanUserResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UnbanUserRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UnbanUserResponse.java + - src/main/java/com/clerk/backend_api/models/operations/LockUserRequest.java + - src/main/java/com/clerk/backend_api/models/operations/LockUserResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UnlockUserRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UnlockUserResponse.java + - src/main/java/com/clerk/backend_api/models/operations/File.java + - src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequest.java + - src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataUnsafeMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/ResponseBody.java + - src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequest.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordResponseBody.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordResponse.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequest.java + - src/main/java/com/clerk/backend_api/models/operations/CodeType.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPResponseBody.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DisableMFARequest.java + - src/main/java/com/clerk/backend_api/models/operations/DisableMFAResponseBody.java + - src/main/java/com/clerk/backend_api/models/operations/DisableMFAResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateInvitationPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/CreateInvitationRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateInvitationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/QueryParamStatus.java + - src/main/java/com/clerk/backend_api/models/operations/ListInvitationsRequest.java + - src/main/java/com/clerk/backend_api/models/operations/ListInvitationsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListAllowlistIdentifiersResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListBlocklistIdentifiersResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenResponse.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenRequest.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListDomainsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/AddDomainRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/AddDomainResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteDomainRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteDomainResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateDomainResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSvixAppResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteSvixAppResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GenerateSvixAuthURLResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListJWTTemplatesResponse.java + - src/main/java/com/clerk/backend_api/models/operations/Claims.java + - src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateClaims.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsRequest.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetOrganizationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetOrganizationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequest.java + - src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoFile.java + - src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsQueryParamStatus.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsRequest.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/RequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkRequest.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsRequest.java + - src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequest.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsRequest.java + - src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataResponse.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListRedirectURLsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenResponse.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenRequest.java + - src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsRequest.java + - src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationResponse.java + - src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretRequest.java + - src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretResponse.java + - src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsRequest.java + - src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsResponse.java + - src/main/java/com/clerk/backend_api/models/operations/Provider.java + - src/main/java/com/clerk/backend_api/models/operations/AttributeMapping.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionResponse.java + - src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionRequest.java + - src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionResponse.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionAttributeMapping.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequestBody.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequest.java + - src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionResponse.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionRequest.java + - src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionResponse.java + - src/main/java/com/clerk/backend_api/models/operations/CreateTestingTokenResponse.java + - src/main/java/com/clerk/backend_api/models/components/Object.java + - src/main/java/com/clerk/backend_api/models/components/Client.java + - src/main/java/com/clerk/backend_api/models/components/SessionObject.java + - src/main/java/com/clerk/backend_api/models/components/Actor.java + - src/main/java/com/clerk/backend_api/models/components/Status.java + - src/main/java/com/clerk/backend_api/models/components/Session.java + - src/main/java/com/clerk/backend_api/models/components/Meta.java + - src/main/java/com/clerk/backend_api/models/components/ClerkError.java + - src/main/java/com/clerk/backend_api/models/components/EmailAddressObject.java + - src/main/java/com/clerk/backend_api/models/components/OauthVerificationStatus.java + - src/main/java/com/clerk/backend_api/models/components/OauthVerificationStrategy.java + - src/main/java/com/clerk/backend_api/models/components/ErrorMeta.java + - src/main/java/com/clerk/backend_api/models/components/ErrorClerkError.java + - src/main/java/com/clerk/backend_api/models/components/Error.java + - src/main/java/com/clerk/backend_api/models/components/Oauth.java + - src/main/java/com/clerk/backend_api/models/components/AdminVerificationStatus.java + - src/main/java/com/clerk/backend_api/models/components/VerificationStrategy.java + - src/main/java/com/clerk/backend_api/models/components/Admin.java + - src/main/java/com/clerk/backend_api/models/components/VerificationStatus.java + - src/main/java/com/clerk/backend_api/models/components/Strategy.java + - src/main/java/com/clerk/backend_api/models/components/Otp.java + - src/main/java/com/clerk/backend_api/models/components/Verification.java + - src/main/java/com/clerk/backend_api/models/components/EmailAddress.java + - src/main/java/com/clerk/backend_api/models/components/Type.java + - src/main/java/com/clerk/backend_api/models/components/IdentificationLink.java + - src/main/java/com/clerk/backend_api/models/components/DeletedObject.java + - src/main/java/com/clerk/backend_api/models/components/PhoneNumberObject.java + - src/main/java/com/clerk/backend_api/models/components/AdminVerificationPhoneNumberStatus.java + - src/main/java/com/clerk/backend_api/models/components/AdminVerificationStrategy.java + - src/main/java/com/clerk/backend_api/models/components/VerificationAdmin.java + - src/main/java/com/clerk/backend_api/models/components/OTPVerificationStatus.java + - src/main/java/com/clerk/backend_api/models/components/OTPVerificationStrategy.java + - src/main/java/com/clerk/backend_api/models/components/VerificationOTP.java + - src/main/java/com/clerk/backend_api/models/components/PhoneNumberVerification.java + - src/main/java/com/clerk/backend_api/models/components/PhoneNumber.java + - src/main/java/com/clerk/backend_api/models/components/TemplateObject.java + - src/main/java/com/clerk/backend_api/models/components/Template.java + - src/main/java/com/clerk/backend_api/models/components/UserObject.java + - src/main/java/com/clerk/backend_api/models/components/PublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/PrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/components/UnsafeMetadata.java + - src/main/java/com/clerk/backend_api/models/components/ExternalAccounts.java + - src/main/java/com/clerk/backend_api/models/components/User.java + - src/main/java/com/clerk/backend_api/models/components/SAMLAccountObject.java + - src/main/java/com/clerk/backend_api/models/components/SAMLAccountPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/TicketVerificationStatus.java + - src/main/java/com/clerk/backend_api/models/components/TicketVerificationStrategy.java + - src/main/java/com/clerk/backend_api/models/components/Ticket.java + - src/main/java/com/clerk/backend_api/models/components/SAMLVerificationStatus.java + - src/main/java/com/clerk/backend_api/models/components/SAMLVerificationStrategy.java + - src/main/java/com/clerk/backend_api/models/components/ClerkErrorErrorMeta.java + - src/main/java/com/clerk/backend_api/models/components/SAMLErrorClerkError.java + - src/main/java/com/clerk/backend_api/models/components/VerificationError.java + - src/main/java/com/clerk/backend_api/models/components/Saml.java + - src/main/java/com/clerk/backend_api/models/components/SAMLAccountVerification.java + - src/main/java/com/clerk/backend_api/models/components/SAMLAccount.java + - src/main/java/com/clerk/backend_api/models/components/SchemasPasskeyObject.java + - src/main/java/com/clerk/backend_api/models/components/PasskeyVerificationStatus.java + - src/main/java/com/clerk/backend_api/models/components/PasskeyVerificationStrategy.java + - src/main/java/com/clerk/backend_api/models/components/VerificationNonce.java + - src/main/java/com/clerk/backend_api/models/components/Passkey.java + - src/main/java/com/clerk/backend_api/models/components/SchemasPasskeyVerification.java + - src/main/java/com/clerk/backend_api/models/components/SchemasPasskey.java + - src/main/java/com/clerk/backend_api/models/components/Web3WalletObject.java + - src/main/java/com/clerk/backend_api/models/components/AdminVerificationWeb3WalletStatus.java + - src/main/java/com/clerk/backend_api/models/components/AdminVerificationWeb3WalletStrategy.java + - src/main/java/com/clerk/backend_api/models/components/Web3WalletVerificationAdmin.java + - src/main/java/com/clerk/backend_api/models/components/Web3SignatureVerificationStatus.java + - src/main/java/com/clerk/backend_api/models/components/Web3SignatureVerificationStrategy.java + - src/main/java/com/clerk/backend_api/models/components/Nonce.java + - src/main/java/com/clerk/backend_api/models/components/Web3Signature.java + - src/main/java/com/clerk/backend_api/models/components/Web3WalletVerification.java + - src/main/java/com/clerk/backend_api/models/components/Web3Wallet.java + - src/main/java/com/clerk/backend_api/models/components/TotalCountObject.java + - src/main/java/com/clerk/backend_api/models/components/TotalCount.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMemberships.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipObject.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationObject.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganization.java + - src/main/java/com/clerk/backend_api/models/components/PublicUserData.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationMembership.java + - src/main/java/com/clerk/backend_api/models/components/InvitationObject.java + - src/main/java/com/clerk/backend_api/models/components/InvitationPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/InvitationStatus.java + - src/main/java/com/clerk/backend_api/models/components/Invitation.java + - src/main/java/com/clerk/backend_api/models/components/InvitationRevokedObject.java + - src/main/java/com/clerk/backend_api/models/components/InvitationRevokedPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/InvitationRevokedStatus.java + - src/main/java/com/clerk/backend_api/models/components/InvitationRevoked.java + - src/main/java/com/clerk/backend_api/models/components/AllowlistIdentifierObject.java + - src/main/java/com/clerk/backend_api/models/components/IdentifierType.java + - src/main/java/com/clerk/backend_api/models/components/AllowlistIdentifier.java + - src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifiers.java + - src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifierObject.java + - src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifierIdentifierType.java + - src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifier.java + - src/main/java/com/clerk/backend_api/models/components/InstanceSettingsObject.java + - src/main/java/com/clerk/backend_api/models/components/InstanceSettings.java + - src/main/java/com/clerk/backend_api/models/components/InstanceRestrictionsObject.java + - src/main/java/com/clerk/backend_api/models/components/InstanceRestrictions.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationSettingsObject.java + - src/main/java/com/clerk/backend_api/models/components/DomainsEnrollmentModes.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationSettings.java + - src/main/java/com/clerk/backend_api/models/components/ActorTokenObject.java + - src/main/java/com/clerk/backend_api/models/components/ActorTokenStatus.java + - src/main/java/com/clerk/backend_api/models/components/ActorTokenActor.java + - src/main/java/com/clerk/backend_api/models/components/ActorToken.java + - src/main/java/com/clerk/backend_api/models/components/Domains.java + - src/main/java/com/clerk/backend_api/models/components/DomainObject.java + - src/main/java/com/clerk/backend_api/models/components/Domain.java + - src/main/java/com/clerk/backend_api/models/components/CNameTarget.java + - src/main/java/com/clerk/backend_api/models/components/SvixURL.java + - src/main/java/com/clerk/backend_api/models/components/JWTTemplateObject.java + - src/main/java/com/clerk/backend_api/models/components/Claims.java + - src/main/java/com/clerk/backend_api/models/components/JWTTemplate.java + - src/main/java/com/clerk/backend_api/models/components/Organizations.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationObject.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/components/Organization.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoObject.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogo.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationObject.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationPrivateMetadata.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationInvitation.java + - src/main/java/com/clerk/backend_api/models/components/OrganizationInvitations.java + - src/main/java/com/clerk/backend_api/models/components/ProxyCheckObject.java + - src/main/java/com/clerk/backend_api/models/components/ProxyCheck.java + - src/main/java/com/clerk/backend_api/models/components/RedirectURLObject.java + - src/main/java/com/clerk/backend_api/models/components/RedirectURL.java + - src/main/java/com/clerk/backend_api/models/components/SignInTokenObject.java + - src/main/java/com/clerk/backend_api/models/components/SignInTokenStatus.java + - src/main/java/com/clerk/backend_api/models/components/SignInToken.java + - src/main/java/com/clerk/backend_api/models/components/SignUpObject.java + - src/main/java/com/clerk/backend_api/models/components/SignUpStatus.java + - src/main/java/com/clerk/backend_api/models/components/Verifications.java + - src/main/java/com/clerk/backend_api/models/components/SignUpUnsafeMetadata.java + - src/main/java/com/clerk/backend_api/models/components/SignUpPublicMetadata.java + - src/main/java/com/clerk/backend_api/models/components/ExternalAccount.java + - src/main/java/com/clerk/backend_api/models/components/SignUp.java + - src/main/java/com/clerk/backend_api/models/components/OAuthApplications.java + - src/main/java/com/clerk/backend_api/models/components/OAuthApplicationObject.java + - src/main/java/com/clerk/backend_api/models/components/OAuthApplication.java + - src/main/java/com/clerk/backend_api/models/components/OAuthApplicationWithSecretObject.java + - src/main/java/com/clerk/backend_api/models/components/OAuthApplicationWithSecret.java + - src/main/java/com/clerk/backend_api/models/components/SAMLConnections.java + - src/main/java/com/clerk/backend_api/models/components/SAMLConnectionObject.java + - src/main/java/com/clerk/backend_api/models/components/AttributeMapping.java + - src/main/java/com/clerk/backend_api/models/components/SAMLConnection.java + - src/main/java/com/clerk/backend_api/models/components/TestingTokenObject.java + - src/main/java/com/clerk/backend_api/models/components/TestingToken.java + - src/main/java/com/clerk/backend_api/models/components/Security.java + - src/main/java/com/clerk/backend_api/models/errors/Meta.java + - src/main/java/com/clerk/backend_api/models/errors/ClerkErrors.java + - docs/models/operations/GetPublicInterstitialRequest.md + - docs/models/operations/GetPublicInterstitialResponse.md + - docs/models/operations/GetJWKSResponse.md + - docs/models/operations/GetClientListRequest.md + - docs/models/operations/GetClientListResponse.md + - docs/models/operations/VerifyClientRequestBody.md + - docs/models/operations/VerifyClientResponse.md + - docs/models/operations/GetClientRequest.md + - docs/models/operations/GetClientResponse.md + - docs/models/operations/CreateEmailAddressRequestBody.md + - docs/models/operations/CreateEmailAddressResponse.md + - docs/models/operations/GetEmailAddressRequest.md + - docs/models/operations/GetEmailAddressResponse.md + - docs/models/operations/DeleteEmailAddressRequest.md + - docs/models/operations/DeleteEmailAddressResponse.md + - docs/models/operations/UpdateEmailAddressRequestBody.md + - docs/models/operations/UpdateEmailAddressRequest.md + - docs/models/operations/UpdateEmailAddressResponse.md + - docs/models/operations/CreatePhoneNumberRequestBody.md + - docs/models/operations/CreatePhoneNumberResponse.md + - docs/models/operations/GetPhoneNumberRequest.md + - docs/models/operations/GetPhoneNumberResponse.md + - docs/models/operations/DeletePhoneNumberRequest.md + - docs/models/operations/DeletePhoneNumberResponse.md + - docs/models/operations/UpdatePhoneNumberRequestBody.md + - docs/models/operations/UpdatePhoneNumberRequest.md + - docs/models/operations/UpdatePhoneNumberResponse.md + - docs/models/operations/Status.md + - docs/models/operations/GetSessionListRequest.md + - docs/models/operations/GetSessionListResponse.md + - docs/models/operations/GetSessionRequest.md + - docs/models/operations/GetSessionResponse.md + - docs/models/operations/RevokeSessionRequest.md + - docs/models/operations/RevokeSessionResponse.md + - docs/models/operations/VerifySessionRequestBody.md + - docs/models/operations/VerifySessionRequest.md + - docs/models/operations/VerifySessionResponse.md + - docs/models/operations/CreateSessionTokenFromTemplateRequest.md + - docs/models/operations/Object.md + - docs/models/operations/CreateSessionTokenFromTemplateResponseBody.md + - docs/models/operations/CreateSessionTokenFromTemplateResponse.md + - docs/models/operations/TemplateType.md + - docs/models/operations/GetTemplateListRequest.md + - docs/models/operations/GetTemplateListResponse.md + - docs/models/operations/PathParamTemplateType.md + - docs/models/operations/GetTemplateRequest.md + - docs/models/operations/GetTemplateResponse.md + - docs/models/operations/UpsertTemplatePathParamTemplateType.md + - docs/models/operations/UpsertTemplateRequestBody.md + - docs/models/operations/UpsertTemplateRequest.md + - docs/models/operations/UpsertTemplateResponse.md + - docs/models/operations/RevertTemplatePathParamTemplateType.md + - docs/models/operations/RevertTemplateRequest.md + - docs/models/operations/RevertTemplateResponse.md + - docs/models/operations/PreviewTemplateRequestBody.md + - docs/models/operations/PreviewTemplateRequest.md + - docs/models/operations/PreviewTemplateResponseBody.md + - docs/models/operations/PreviewTemplateResponse.md + - docs/models/operations/ToggleTemplateDeliveryPathParamTemplateType.md + - docs/models/operations/ToggleTemplateDeliveryRequestBody.md + - docs/models/operations/ToggleTemplateDeliveryRequest.md + - docs/models/operations/ToggleTemplateDeliveryResponse.md + - docs/models/operations/GetUserListRequest.md + - docs/models/operations/GetUserListResponse.md + - docs/models/operations/PasswordHasher.md + - docs/models/operations/PublicMetadata.md + - docs/models/operations/PrivateMetadata.md + - docs/models/operations/UnsafeMetadata.md + - docs/models/operations/CreateUserRequestBody.md + - docs/models/operations/CreateUserResponse.md + - docs/models/operations/GetUsersCountRequest.md + - docs/models/operations/GetUsersCountResponse.md + - docs/models/operations/GetUserRequest.md + - docs/models/operations/GetUserResponse.md + - docs/models/operations/UpdateUserPasswordHasher.md + - docs/models/operations/UpdateUserPublicMetadata.md + - docs/models/operations/UpdateUserPrivateMetadata.md + - docs/models/operations/UpdateUserUnsafeMetadata.md + - docs/models/operations/UpdateUserRequestBody.md + - docs/models/operations/UpdateUserRequest.md + - docs/models/operations/UpdateUserResponse.md + - docs/models/operations/DeleteUserRequest.md + - docs/models/operations/DeleteUserResponse.md + - docs/models/operations/BanUserRequest.md + - docs/models/operations/BanUserResponse.md + - docs/models/operations/UnbanUserRequest.md + - docs/models/operations/UnbanUserResponse.md + - docs/models/operations/LockUserRequest.md + - docs/models/operations/LockUserResponse.md + - docs/models/operations/UnlockUserRequest.md + - docs/models/operations/UnlockUserResponse.md + - docs/models/operations/File.md + - docs/models/operations/SetUserProfileImageRequestBody.md + - docs/models/operations/SetUserProfileImageRequest.md + - docs/models/operations/SetUserProfileImageResponse.md + - docs/models/operations/DeleteUserProfileImageRequest.md + - docs/models/operations/DeleteUserProfileImageResponse.md + - docs/models/operations/UpdateUserMetadataPublicMetadata.md + - docs/models/operations/UpdateUserMetadataPrivateMetadata.md + - docs/models/operations/UpdateUserMetadataUnsafeMetadata.md + - docs/models/operations/UpdateUserMetadataRequestBody.md + - docs/models/operations/UpdateUserMetadataRequest.md + - docs/models/operations/UpdateUserMetadataResponse.md + - docs/models/operations/GetOAuthAccessTokenRequest.md + - docs/models/operations/GetOAuthAccessTokenPublicMetadata.md + - docs/models/operations/ResponseBody.md + - docs/models/operations/GetOAuthAccessTokenResponse.md + - docs/models/operations/UsersGetOrganizationMembershipsRequest.md + - docs/models/operations/UsersGetOrganizationMembershipsResponse.md + - docs/models/operations/VerifyPasswordRequestBody.md + - docs/models/operations/VerifyPasswordRequest.md + - docs/models/operations/VerifyPasswordResponseBody.md + - docs/models/operations/VerifyPasswordResponse.md + - docs/models/operations/VerifyTOTPRequestBody.md + - docs/models/operations/VerifyTOTPRequest.md + - docs/models/operations/CodeType.md + - docs/models/operations/VerifyTOTPResponseBody.md + - docs/models/operations/VerifyTOTPResponse.md + - docs/models/operations/DisableMFARequest.md + - docs/models/operations/DisableMFAResponseBody.md + - docs/models/operations/DisableMFAResponse.md + - docs/models/operations/CreateInvitationPublicMetadata.md + - docs/models/operations/CreateInvitationRequestBody.md + - docs/models/operations/CreateInvitationResponse.md + - docs/models/operations/QueryParamStatus.md + - docs/models/operations/ListInvitationsRequest.md + - docs/models/operations/ListInvitationsResponse.md + - docs/models/operations/RevokeInvitationRequest.md + - docs/models/operations/RevokeInvitationResponse.md + - docs/models/operations/ListAllowlistIdentifiersResponse.md + - docs/models/operations/CreateAllowlistIdentifierRequestBody.md + - docs/models/operations/CreateAllowlistIdentifierResponse.md + - docs/models/operations/DeleteAllowlistIdentifierRequest.md + - docs/models/operations/DeleteAllowlistIdentifierResponse.md + - docs/models/operations/ListBlocklistIdentifiersResponse.md + - docs/models/operations/CreateBlocklistIdentifierRequestBody.md + - docs/models/operations/CreateBlocklistIdentifierResponse.md + - docs/models/operations/DeleteBlocklistIdentifierRequest.md + - docs/models/operations/DeleteBlocklistIdentifierResponse.md + - docs/models/operations/UpdateInstanceAuthConfigRequestBody.md + - docs/models/operations/UpdateInstanceAuthConfigResponse.md + - docs/models/operations/UpdateProductionInstanceDomainRequestBody.md + - docs/models/operations/UpdateProductionInstanceDomainResponse.md + - docs/models/operations/UpdateInstanceRequestBody.md + - docs/models/operations/UpdateInstanceResponse.md + - docs/models/operations/UpdateInstanceRestrictionsRequestBody.md + - docs/models/operations/UpdateInstanceRestrictionsResponse.md + - docs/models/operations/ChangeProductionInstanceDomainRequestBody.md + - docs/models/operations/ChangeProductionInstanceDomainResponse.md + - docs/models/operations/UpdateInstanceOrganizationSettingsRequestBody.md + - docs/models/operations/UpdateInstanceOrganizationSettingsResponse.md + - docs/models/operations/CreateActorTokenRequestBody.md + - docs/models/operations/CreateActorTokenResponse.md + - docs/models/operations/RevokeActorTokenRequest.md + - docs/models/operations/RevokeActorTokenResponse.md + - docs/models/operations/ListDomainsResponse.md + - docs/models/operations/AddDomainRequestBody.md + - docs/models/operations/AddDomainResponse.md + - docs/models/operations/DeleteDomainRequest.md + - docs/models/operations/DeleteDomainResponse.md + - docs/models/operations/UpdateDomainRequestBody.md + - docs/models/operations/UpdateDomainRequest.md + - docs/models/operations/UpdateDomainResponse.md + - docs/models/operations/CreateSvixAppResponse.md + - docs/models/operations/DeleteSvixAppResponse.md + - docs/models/operations/GenerateSvixAuthURLResponse.md + - docs/models/operations/ListJWTTemplatesResponse.md + - docs/models/operations/Claims.md + - docs/models/operations/CreateJWTTemplateRequestBody.md + - docs/models/operations/CreateJWTTemplateResponse.md + - docs/models/operations/GetJWTTemplateRequest.md + - docs/models/operations/GetJWTTemplateResponse.md + - docs/models/operations/UpdateJWTTemplateClaims.md + - docs/models/operations/UpdateJWTTemplateRequestBody.md + - docs/models/operations/UpdateJWTTemplateRequest.md + - docs/models/operations/UpdateJWTTemplateResponse.md + - docs/models/operations/DeleteJWTTemplateRequest.md + - docs/models/operations/DeleteJWTTemplateResponse.md + - docs/models/operations/ListOrganizationsRequest.md + - docs/models/operations/ListOrganizationsResponse.md + - docs/models/operations/CreateOrganizationPrivateMetadata.md + - docs/models/operations/CreateOrganizationPublicMetadata.md + - docs/models/operations/CreateOrganizationRequestBody.md + - docs/models/operations/CreateOrganizationResponse.md + - docs/models/operations/GetOrganizationRequest.md + - docs/models/operations/GetOrganizationResponse.md + - docs/models/operations/UpdateOrganizationPublicMetadata.md + - docs/models/operations/UpdateOrganizationPrivateMetadata.md + - docs/models/operations/UpdateOrganizationRequestBody.md + - docs/models/operations/UpdateOrganizationRequest.md + - docs/models/operations/UpdateOrganizationResponse.md + - docs/models/operations/DeleteOrganizationRequest.md + - docs/models/operations/DeleteOrganizationResponse.md + - docs/models/operations/MergeOrganizationMetadataPublicMetadata.md + - docs/models/operations/MergeOrganizationMetadataPrivateMetadata.md + - docs/models/operations/MergeOrganizationMetadataRequestBody.md + - docs/models/operations/MergeOrganizationMetadataRequest.md + - docs/models/operations/MergeOrganizationMetadataResponse.md + - docs/models/operations/UploadOrganizationLogoFile.md + - docs/models/operations/UploadOrganizationLogoRequestBody.md + - docs/models/operations/UploadOrganizationLogoRequest.md + - docs/models/operations/UploadOrganizationLogoResponse.md + - docs/models/operations/DeleteOrganizationLogoRequest.md + - docs/models/operations/DeleteOrganizationLogoResponse.md + - docs/models/operations/CreateOrganizationInvitationPublicMetadata.md + - docs/models/operations/CreateOrganizationInvitationPrivateMetadata.md + - docs/models/operations/CreateOrganizationInvitationRequestBody.md + - docs/models/operations/CreateOrganizationInvitationRequest.md + - docs/models/operations/CreateOrganizationInvitationResponse.md + - docs/models/operations/ListOrganizationInvitationsQueryParamStatus.md + - docs/models/operations/ListOrganizationInvitationsRequest.md + - docs/models/operations/ListOrganizationInvitationsResponse.md + - docs/models/operations/CreateOrganizationInvitationBulkPublicMetadata.md + - docs/models/operations/CreateOrganizationInvitationBulkPrivateMetadata.md + - docs/models/operations/RequestBody.md + - docs/models/operations/CreateOrganizationInvitationBulkRequest.md + - docs/models/operations/CreateOrganizationInvitationBulkResponse.md + - docs/models/operations/ListPendingOrganizationInvitationsRequest.md + - docs/models/operations/ListPendingOrganizationInvitationsResponse.md + - docs/models/operations/GetOrganizationInvitationRequest.md + - docs/models/operations/GetOrganizationInvitationResponse.md + - docs/models/operations/RevokeOrganizationInvitationRequestBody.md + - docs/models/operations/RevokeOrganizationInvitationRequest.md + - docs/models/operations/RevokeOrganizationInvitationResponse.md + - docs/models/operations/CreateOrganizationMembershipRequestBody.md + - docs/models/operations/CreateOrganizationMembershipRequest.md + - docs/models/operations/CreateOrganizationMembershipResponse.md + - docs/models/operations/ListOrganizationMembershipsRequest.md + - docs/models/operations/ListOrganizationMembershipsResponse.md + - docs/models/operations/UpdateOrganizationMembershipRequestBody.md + - docs/models/operations/UpdateOrganizationMembershipRequest.md + - docs/models/operations/UpdateOrganizationMembershipResponse.md + - docs/models/operations/DeleteOrganizationMembershipRequest.md + - docs/models/operations/DeleteOrganizationMembershipResponse.md + - docs/models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.md + - docs/models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.md + - docs/models/operations/UpdateOrganizationMembershipMetadataRequestBody.md + - docs/models/operations/UpdateOrganizationMembershipMetadataRequest.md + - docs/models/operations/UpdateOrganizationMembershipMetadataResponse.md + - docs/models/operations/VerifyDomainProxyRequestBody.md + - docs/models/operations/VerifyDomainProxyResponse.md + - docs/models/operations/ListRedirectURLsResponse.md + - docs/models/operations/CreateRedirectURLRequestBody.md + - docs/models/operations/CreateRedirectURLResponse.md + - docs/models/operations/GetRedirectURLRequest.md + - docs/models/operations/GetRedirectURLResponse.md + - docs/models/operations/DeleteRedirectURLRequest.md + - docs/models/operations/DeleteRedirectURLResponse.md + - docs/models/operations/CreateSignInTokenRequestBody.md + - docs/models/operations/CreateSignInTokenResponse.md + - docs/models/operations/RevokeSignInTokenRequest.md + - docs/models/operations/RevokeSignInTokenResponse.md + - docs/models/operations/UpdateSignUpRequestBody.md + - docs/models/operations/UpdateSignUpRequest.md + - docs/models/operations/UpdateSignUpResponse.md + - docs/models/operations/ListOAuthApplicationsRequest.md + - docs/models/operations/ListOAuthApplicationsResponse.md + - docs/models/operations/CreateOAuthApplicationRequestBody.md + - docs/models/operations/CreateOAuthApplicationResponse.md + - docs/models/operations/GetOAuthApplicationRequest.md + - docs/models/operations/GetOAuthApplicationResponse.md + - docs/models/operations/UpdateOAuthApplicationRequestBody.md + - docs/models/operations/UpdateOAuthApplicationRequest.md + - docs/models/operations/UpdateOAuthApplicationResponse.md + - docs/models/operations/DeleteOAuthApplicationRequest.md + - docs/models/operations/DeleteOAuthApplicationResponse.md + - docs/models/operations/RotateOAuthApplicationSecretRequest.md + - docs/models/operations/RotateOAuthApplicationSecretResponse.md + - docs/models/operations/ListSAMLConnectionsRequest.md + - docs/models/operations/ListSAMLConnectionsResponse.md + - docs/models/operations/Provider.md + - docs/models/operations/AttributeMapping.md + - docs/models/operations/CreateSAMLConnectionRequestBody.md + - docs/models/operations/CreateSAMLConnectionResponse.md + - docs/models/operations/GetSAMLConnectionRequest.md + - docs/models/operations/GetSAMLConnectionResponse.md + - docs/models/operations/UpdateSAMLConnectionAttributeMapping.md + - docs/models/operations/UpdateSAMLConnectionRequestBody.md + - docs/models/operations/UpdateSAMLConnectionRequest.md + - docs/models/operations/UpdateSAMLConnectionResponse.md + - docs/models/operations/DeleteSAMLConnectionRequest.md + - docs/models/operations/DeleteSAMLConnectionResponse.md + - docs/models/operations/CreateTestingTokenResponse.md + - docs/models/components/Object.md + - docs/models/components/Client.md + - docs/models/components/SessionObject.md + - docs/models/components/Actor.md + - docs/models/components/Status.md + - docs/models/components/Session.md + - docs/models/components/Meta.md + - docs/models/components/ClerkError.md + - docs/models/components/EmailAddressObject.md + - docs/models/components/OauthVerificationStatus.md + - docs/models/components/OauthVerificationStrategy.md + - docs/models/components/ErrorMeta.md + - docs/models/components/ErrorClerkError.md + - docs/models/components/Error.md + - docs/models/components/Oauth.md + - docs/models/components/AdminVerificationStatus.md + - docs/models/components/VerificationStrategy.md + - docs/models/components/Admin.md + - docs/models/components/VerificationStatus.md + - docs/models/components/Strategy.md + - docs/models/components/Otp.md + - docs/models/components/Verification.md + - docs/models/components/EmailAddress.md + - docs/models/components/Type.md + - docs/models/components/IdentificationLink.md + - docs/models/components/DeletedObject.md + - docs/models/components/PhoneNumberObject.md + - docs/models/components/AdminVerificationPhoneNumberStatus.md + - docs/models/components/AdminVerificationStrategy.md + - docs/models/components/VerificationAdmin.md + - docs/models/components/OTPVerificationStatus.md + - docs/models/components/OTPVerificationStrategy.md + - docs/models/components/VerificationOTP.md + - docs/models/components/PhoneNumberVerification.md + - docs/models/components/PhoneNumber.md + - docs/models/components/TemplateObject.md + - docs/models/components/Template.md + - docs/models/components/UserObject.md + - docs/models/components/PublicMetadata.md + - docs/models/components/PrivateMetadata.md + - docs/models/components/UnsafeMetadata.md + - docs/models/components/ExternalAccounts.md + - docs/models/components/User.md + - docs/models/components/SAMLAccountObject.md + - docs/models/components/SAMLAccountPublicMetadata.md + - docs/models/components/TicketVerificationStatus.md + - docs/models/components/TicketVerificationStrategy.md + - docs/models/components/Ticket.md + - docs/models/components/SAMLVerificationStatus.md + - docs/models/components/SAMLVerificationStrategy.md + - docs/models/components/ClerkErrorErrorMeta.md + - docs/models/components/SAMLErrorClerkError.md + - docs/models/components/VerificationError.md + - docs/models/components/Saml.md + - docs/models/components/SAMLAccountVerification.md + - docs/models/components/SAMLAccount.md + - docs/models/components/SchemasPasskeyObject.md + - docs/models/components/PasskeyVerificationStatus.md + - docs/models/components/PasskeyVerificationStrategy.md + - docs/models/components/VerificationNonce.md + - docs/models/components/Passkey.md + - docs/models/components/SchemasPasskeyVerification.md + - docs/models/components/SchemasPasskey.md + - docs/models/components/Web3WalletObject.md + - docs/models/components/AdminVerificationWeb3WalletStatus.md + - docs/models/components/AdminVerificationWeb3WalletStrategy.md + - docs/models/components/Web3WalletVerificationAdmin.md + - docs/models/components/Web3SignatureVerificationStatus.md + - docs/models/components/Web3SignatureVerificationStrategy.md + - docs/models/components/Nonce.md + - docs/models/components/Web3Signature.md + - docs/models/components/Web3WalletVerification.md + - docs/models/components/Web3Wallet.md + - docs/models/components/TotalCountObject.md + - docs/models/components/TotalCount.md + - docs/models/components/OrganizationMemberships.md + - docs/models/components/OrganizationMembershipObject.md + - docs/models/components/OrganizationMembershipPublicMetadata.md + - docs/models/components/OrganizationMembershipPrivateMetadata.md + - docs/models/components/OrganizationMembershipOrganizationObject.md + - docs/models/components/OrganizationMembershipOrganizationPublicMetadata.md + - docs/models/components/OrganizationMembershipOrganizationPrivateMetadata.md + - docs/models/components/OrganizationMembershipOrganization.md + - docs/models/components/PublicUserData.md + - docs/models/components/OrganizationMembership.md + - docs/models/components/InvitationObject.md + - docs/models/components/InvitationPublicMetadata.md + - docs/models/components/InvitationStatus.md + - docs/models/components/Invitation.md + - docs/models/components/InvitationRevokedObject.md + - docs/models/components/InvitationRevokedPublicMetadata.md + - docs/models/components/InvitationRevokedStatus.md + - docs/models/components/InvitationRevoked.md + - docs/models/components/AllowlistIdentifierObject.md + - docs/models/components/IdentifierType.md + - docs/models/components/AllowlistIdentifier.md + - docs/models/components/BlocklistIdentifiers.md + - docs/models/components/BlocklistIdentifierObject.md + - docs/models/components/BlocklistIdentifierIdentifierType.md + - docs/models/components/BlocklistIdentifier.md + - docs/models/components/InstanceSettingsObject.md + - docs/models/components/InstanceSettings.md + - docs/models/components/InstanceRestrictionsObject.md + - docs/models/components/InstanceRestrictions.md + - docs/models/components/OrganizationSettingsObject.md + - docs/models/components/DomainsEnrollmentModes.md + - docs/models/components/OrganizationSettings.md + - docs/models/components/ActorTokenObject.md + - docs/models/components/ActorTokenStatus.md + - docs/models/components/ActorTokenActor.md + - docs/models/components/ActorToken.md + - docs/models/components/Domains.md + - docs/models/components/DomainObject.md + - docs/models/components/Domain.md + - docs/models/components/CNameTarget.md + - docs/models/components/SvixURL.md + - docs/models/components/JWTTemplateObject.md + - docs/models/components/Claims.md + - docs/models/components/JWTTemplate.md + - docs/models/components/Organizations.md + - docs/models/components/OrganizationObject.md + - docs/models/components/OrganizationPublicMetadata.md + - docs/models/components/OrganizationPrivateMetadata.md + - docs/models/components/Organization.md + - docs/models/components/OrganizationWithLogoObject.md + - docs/models/components/OrganizationWithLogoPublicMetadata.md + - docs/models/components/OrganizationWithLogoPrivateMetadata.md + - docs/models/components/OrganizationWithLogo.md + - docs/models/components/OrganizationInvitationObject.md + - docs/models/components/OrganizationInvitationPublicMetadata.md + - docs/models/components/OrganizationInvitationPrivateMetadata.md + - docs/models/components/OrganizationInvitation.md + - docs/models/components/OrganizationInvitations.md + - docs/models/components/ProxyCheckObject.md + - docs/models/components/ProxyCheck.md + - docs/models/components/RedirectURLObject.md + - docs/models/components/RedirectURL.md + - docs/models/components/SignInTokenObject.md + - docs/models/components/SignInTokenStatus.md + - docs/models/components/SignInToken.md + - docs/models/components/SignUpObject.md + - docs/models/components/SignUpStatus.md + - docs/models/components/Verifications.md + - docs/models/components/SignUpUnsafeMetadata.md + - docs/models/components/SignUpPublicMetadata.md + - docs/models/components/ExternalAccount.md + - docs/models/components/SignUp.md + - docs/models/components/OAuthApplications.md + - docs/models/components/OAuthApplicationObject.md + - docs/models/components/OAuthApplication.md + - docs/models/components/OAuthApplicationWithSecretObject.md + - docs/models/components/OAuthApplicationWithSecret.md + - docs/models/components/SAMLConnections.md + - docs/models/components/SAMLConnectionObject.md + - docs/models/components/AttributeMapping.md + - docs/models/components/SAMLConnection.md + - docs/models/components/TestingTokenObject.md + - docs/models/components/TestingToken.md + - docs/models/components/Security.md + - docs/models/errors/Meta.md + - docs/models/errors/ClerkErrors.md + - docs/sdks/clerk/README.md + - docs/sdks/miscellaneous/README.md + - docs/sdks/jwks/README.md + - docs/sdks/clients/README.md + - docs/sdks/emailaddresses/README.md + - docs/sdks/phonenumbers/README.md + - docs/sdks/sessions/README.md + - docs/sdks/templates/README.md + - docs/sdks/users/README.md + - docs/sdks/invitations/README.md + - docs/sdks/allowlist/README.md + - docs/sdks/blocklist/README.md + - docs/sdks/instance/README.md + - docs/sdks/actors/README.md + - docs/sdks/domains/README.md + - docs/sdks/webhooks/README.md + - docs/sdks/jwttemplates/README.md + - docs/sdks/organizations/README.md + - docs/sdks/organizationinvitations/README.md + - docs/sdks/organizationmemberships/README.md + - docs/sdks/proxy/README.md + - docs/sdks/redirecturls/README.md + - docs/sdks/signintokens/README.md + - docs/sdks/signups/README.md + - docs/sdks/oauthapplications/README.md + - docs/sdks/samlconnections/README.md + - docs/sdks/testingtokens/README.md + - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml new file mode 100755 index 0000000..a7565aa --- /dev/null +++ b/.speakeasy/gen.yaml @@ -0,0 +1,38 @@ +configVersion: 2.0.0 +generation: + sdkClassName: Clerk + maintainOpenAPIOrder: true + usageSnippets: + optionalPropertyRendering: withExample + useClassNamesForArrayFields: true + fixes: + nameResolutionDec2023: true + parameterOrderingFeb2024: true + requestResponseComponentNamesFeb2024: true + auth: + oAuth2ClientCredentialsEnabled: true +java: + version: 0.0.1 + additionalDependencies: [] + additionalPlugins: [] + artifactID: backend-api + clientServerStatusCodesAsErrors: true + companyEmail: info@mycompany.com + companyName: My Company + companyURL: www.mycompany.com + flattenGlobalSecurity: true + githubURL: github.com/owner/repo + groupID: com.clerk + imports: + option: openapi + paths: + callbacks: models/callbacks + errors: models/errors + operations: models/operations + shared: models/components + webhooks: models/webhooks + inputModelSuffix: input + maxMethodParams: 4 + outputModelSuffix: output + projectName: openapi + templateVersion: v2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock new file mode 100644 index 0000000..378afd0 --- /dev/null +++ b/.speakeasy/workflow.lock @@ -0,0 +1,27 @@ +speakeasyVersion: 1.307.1 +sources: + clerk-java-sdk: + sourceNamespace: clerk-java-sdk + sourceRevisionDigest: sha256:671a76348ffa42f50e48f36d00117419df09deedf8c407f5998533e01a8b64cb + sourceBlobDigest: sha256:e23b66a7b10f867245e42a1cd46af66f9ebee2db346f6a3bfcec0aa79ae2ac86 + tags: + - latest +targets: + my-first-target: + source: clerk-java-sdk + sourceNamespace: clerk-java-sdk + sourceRevisionDigest: sha256:671a76348ffa42f50e48f36d00117419df09deedf8c407f5998533e01a8b64cb + sourceBlobDigest: sha256:e23b66a7b10f867245e42a1cd46af66f9ebee2db346f6a3bfcec0aa79ae2ac86 + outLocation: /Users/kylemac/Sites/clerk/java-sdk/~/Sites/clerk/java-sdk +workflow: + workflowVersion: 1.0.0 + sources: + clerk-java-sdk: + inputs: + - location: ../../../../openapi.yml + registry: + location: registry.speakeasyapi.dev/clerk/clerk/clerk-java-sdk + targets: + my-first-target: + target: java + source: clerk-java-sdk diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml new file mode 100644 index 0000000..da26a5f --- /dev/null +++ b/.speakeasy/workflow.yaml @@ -0,0 +1,11 @@ +workflowVersion: 1.0.0 +sources: + clerk-java-sdk: + inputs: + - location: ../../../../openapi.yml + registry: + location: registry.speakeasyapi.dev/clerk/clerk/clerk-java-sdk +targets: + my-first-target: + target: java + source: clerk-java-sdk diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 0000000..f815235 --- /dev/null +++ b/USAGE.md @@ -0,0 +1,112 @@ + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetClientListResponse res = sdk.clients().list() + .limit(10L) + .offset(0L) + .call(); + + while (true) { + if (res.clientList().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Create Actor Tokens + +This example shows how to create an actor token that can be used to impersonate the given user. + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateActorTokenRequestBody req = CreateActorTokenRequestBody.builder() + .userId("") + .actor(java.util.Map.ofEntries( + entry("sub", "user_2OEpKhcCN1Lat9NQ0G6puh7q5Rb"))) + .build(); + + CreateActorTokenResponse res = sdk.actors().createToken() + .request(req) + .call(); + + if (res.actorToken().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + \ No newline at end of file diff --git a/build-extras.gradle b/build-extras.gradle new file mode 100644 index 0000000..e104d4f --- /dev/null +++ b/build-extras.gradle @@ -0,0 +1,4 @@ +// This file +// * is referred to in an `apply from` command in `build.gradle` +// * can be used to customise `build.gradle` +// * is generated once and not overwritten in SDK generation updates diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..b0213b4 --- /dev/null +++ b/build.gradle @@ -0,0 +1,43 @@ + +//////////////////////////////////////////////////////////////////////////////////////////// +// This file is generated by Speakeasy and any edits will be lost in generation updates. +// +// If you wish to customize this file then place those customizations in `build-extras.gradle` which +// is not touched by generation updates. +// +// Additions to the plugins block can be made by setting the `additionalPlugins` property (an array +// of string where each string value is an additional line in the block) in gen.yaml. +//////////////////////////////////////////////////////////////////////////////////////////// +plugins { + // Apply the java-library plugin for API and implementation separation. + id 'java-library' +} + +compileJava.options.encoding = "UTF-8" +compileJava.options.compilerArgs += '-Xlint:unchecked' +compileTestJava.options.encoding = "UTF-8" + +repositories { + // Use Maven Central for resolving dependencies. + mavenCentral() +} + +tasks.withType(Javadoc) { + failOnError false + options.addStringOption('Xdoclint:none', '-quiet') +} + +dependencies { + implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.0' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation 'org.apache.httpcomponents:httpclient:4.5.14' + implementation 'org.apache.httpcomponents:httpmime:4.5.14' + implementation 'commons-io:commons-io:2.15.1' + implementation 'com.jayway.jsonpath:json-path:2.9.0' +} + + + +apply from: 'build-extras.gradle' diff --git a/docs/models/components/Actor.md b/docs/models/components/Actor.md new file mode 100644 index 0000000..45b5a6d --- /dev/null +++ b/docs/models/components/Actor.md @@ -0,0 +1,7 @@ +# Actor + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/ActorToken.md b/docs/models/components/ActorToken.md new file mode 100644 index 0000000..9d8c016 --- /dev/null +++ b/docs/models/components/ActorToken.md @@ -0,0 +1,16 @@ +# ActorToken + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.ActorTokenObject](../../models/components/ActorTokenObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `status` | [com.clerk.backend_api.models.components.ActorTokenStatus](../../models/components/ActorTokenStatus.md) | :heavy_check_mark: | N/A | +| `userId` | *String* | :heavy_check_mark: | N/A | +| `actor` | [com.clerk.backend_api.models.components.ActorTokenActor](../../models/components/ActorTokenActor.md) | :heavy_check_mark: | N/A | +| `token` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `url` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/ActorTokenActor.md b/docs/models/components/ActorTokenActor.md new file mode 100644 index 0000000..16e49d4 --- /dev/null +++ b/docs/models/components/ActorTokenActor.md @@ -0,0 +1,7 @@ +# ActorTokenActor + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/ActorTokenObject.md b/docs/models/components/ActorTokenObject.md new file mode 100644 index 0000000..354c3af --- /dev/null +++ b/docs/models/components/ActorTokenObject.md @@ -0,0 +1,8 @@ +# ActorTokenObject + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `ACTOR_TOKEN` | actor_token | \ No newline at end of file diff --git a/docs/models/components/ActorTokenStatus.md b/docs/models/components/ActorTokenStatus.md new file mode 100644 index 0000000..f7dd577 --- /dev/null +++ b/docs/models/components/ActorTokenStatus.md @@ -0,0 +1,10 @@ +# ActorTokenStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `ACCEPTED` | accepted | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/components/Admin.md b/docs/models/components/Admin.md new file mode 100644 index 0000000..e1090a4 --- /dev/null +++ b/docs/models/components/Admin.md @@ -0,0 +1,11 @@ +# Admin + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.AdminVerificationStatus](../../models/components/AdminVerificationStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.VerificationStrategy](../../models/components/VerificationStrategy.md) | :heavy_check_mark: | N/A | +| `attempts` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `expireAt` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/AdminVerificationPhoneNumberStatus.md b/docs/models/components/AdminVerificationPhoneNumberStatus.md new file mode 100644 index 0000000..51b3f93 --- /dev/null +++ b/docs/models/components/AdminVerificationPhoneNumberStatus.md @@ -0,0 +1,8 @@ +# AdminVerificationPhoneNumberStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `VERIFIED` | verified | \ No newline at end of file diff --git a/docs/models/components/AdminVerificationStatus.md b/docs/models/components/AdminVerificationStatus.md new file mode 100644 index 0000000..927253e --- /dev/null +++ b/docs/models/components/AdminVerificationStatus.md @@ -0,0 +1,8 @@ +# AdminVerificationStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `VERIFIED` | verified | \ No newline at end of file diff --git a/docs/models/components/AdminVerificationStrategy.md b/docs/models/components/AdminVerificationStrategy.md new file mode 100644 index 0000000..e517d40 --- /dev/null +++ b/docs/models/components/AdminVerificationStrategy.md @@ -0,0 +1,8 @@ +# AdminVerificationStrategy + + +## Values + +| Name | Value | +| ------- | ------- | +| `ADMIN` | admin | \ No newline at end of file diff --git a/docs/models/components/AdminVerificationWeb3WalletStatus.md b/docs/models/components/AdminVerificationWeb3WalletStatus.md new file mode 100644 index 0000000..f16de1d --- /dev/null +++ b/docs/models/components/AdminVerificationWeb3WalletStatus.md @@ -0,0 +1,8 @@ +# AdminVerificationWeb3WalletStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `VERIFIED` | verified | \ No newline at end of file diff --git a/docs/models/components/AdminVerificationWeb3WalletStrategy.md b/docs/models/components/AdminVerificationWeb3WalletStrategy.md new file mode 100644 index 0000000..9dfa905 --- /dev/null +++ b/docs/models/components/AdminVerificationWeb3WalletStrategy.md @@ -0,0 +1,8 @@ +# AdminVerificationWeb3WalletStrategy + + +## Values + +| Name | Value | +| ------- | ------- | +| `ADMIN` | admin | \ No newline at end of file diff --git a/docs/models/components/AllowlistIdentifier.md b/docs/models/components/AllowlistIdentifier.md new file mode 100644 index 0000000..a0ffefd --- /dev/null +++ b/docs/models/components/AllowlistIdentifier.md @@ -0,0 +1,15 @@ +# AllowlistIdentifier + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [Optional](../../models/components/AllowlistIdentifierObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `invitationId` | *Optional* | :heavy_minus_sign: | N/A | +| `identifier` | *Optional* | :heavy_minus_sign: | An email address or a phone number.
| +| `identifierType` | [Optional](../../models/components/IdentifierType.md) | :heavy_minus_sign: | N/A | +| `instanceId` | *Optional* | :heavy_minus_sign: | N/A | +| `createdAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of creation
| +| `updatedAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/AllowlistIdentifierObject.md b/docs/models/components/AllowlistIdentifierObject.md new file mode 100644 index 0000000..5473a90 --- /dev/null +++ b/docs/models/components/AllowlistIdentifierObject.md @@ -0,0 +1,11 @@ +# AllowlistIdentifierObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `ALLOWLIST_IDENTIFIER` | allowlist_identifier | \ No newline at end of file diff --git a/docs/models/components/AttributeMapping.md b/docs/models/components/AttributeMapping.md new file mode 100644 index 0000000..3ff71d3 --- /dev/null +++ b/docs/models/components/AttributeMapping.md @@ -0,0 +1,11 @@ +# AttributeMapping + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `userId` | *Optional* | :heavy_minus_sign: | N/A | +| `emailAddress` | *Optional* | :heavy_minus_sign: | N/A | +| `firstName` | *Optional* | :heavy_minus_sign: | N/A | +| `lastName` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/BlocklistIdentifier.md b/docs/models/components/BlocklistIdentifier.md new file mode 100644 index 0000000..c71f4c0 --- /dev/null +++ b/docs/models/components/BlocklistIdentifier.md @@ -0,0 +1,14 @@ +# BlocklistIdentifier + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [Optional](../../models/components/BlocklistIdentifierObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `identifier` | *Optional* | :heavy_minus_sign: | An email address, email domain, phone number or web3 wallet.
| +| `identifierType` | [Optional](../../models/components/BlocklistIdentifierIdentifierType.md) | :heavy_minus_sign: | N/A | +| `instanceId` | *Optional* | :heavy_minus_sign: | N/A | +| `createdAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of creation
| +| `updatedAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/BlocklistIdentifierIdentifierType.md b/docs/models/components/BlocklistIdentifierIdentifierType.md new file mode 100644 index 0000000..21f7db0 --- /dev/null +++ b/docs/models/components/BlocklistIdentifierIdentifierType.md @@ -0,0 +1,10 @@ +# BlocklistIdentifierIdentifierType + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `EMAIL_ADDRESS` | email_address | +| `PHONE_NUMBER` | phone_number | +| `WEB3_WALLET` | web3_wallet | \ No newline at end of file diff --git a/docs/models/components/BlocklistIdentifierObject.md b/docs/models/components/BlocklistIdentifierObject.md new file mode 100644 index 0000000..9efb8af --- /dev/null +++ b/docs/models/components/BlocklistIdentifierObject.md @@ -0,0 +1,11 @@ +# BlocklistIdentifierObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `BLOCKLIST_IDENTIFIER` | blocklist_identifier | \ No newline at end of file diff --git a/docs/models/components/BlocklistIdentifiers.md b/docs/models/components/BlocklistIdentifiers.md new file mode 100644 index 0000000..72a8a51 --- /dev/null +++ b/docs/models/components/BlocklistIdentifiers.md @@ -0,0 +1,9 @@ +# BlocklistIdentifiers + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `data` | List<[com.clerk.backend_api.models.components.BlocklistIdentifier](../../models/components/BlocklistIdentifier.md)> | :heavy_check_mark: | N/A | +| `totalCount` | *long* | :heavy_check_mark: | Total number of blocklist identifiers
| \ No newline at end of file diff --git a/docs/models/components/CNameTarget.md b/docs/models/components/CNameTarget.md new file mode 100644 index 0000000..674ba57 --- /dev/null +++ b/docs/models/components/CNameTarget.md @@ -0,0 +1,10 @@ +# CNameTarget + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `host` | *String* | :heavy_check_mark: | N/A | +| `value` | *String* | :heavy_check_mark: | N/A | +| `required` | *boolean* | :heavy_check_mark: | Denotes whether this CNAME target is required to be set in order for the domain to be considered deployed.
| \ No newline at end of file diff --git a/docs/models/components/Claims.md b/docs/models/components/Claims.md new file mode 100644 index 0000000..5c4b4bd --- /dev/null +++ b/docs/models/components/Claims.md @@ -0,0 +1,7 @@ +# Claims + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/ClerkError.md b/docs/models/components/ClerkError.md new file mode 100644 index 0000000..00552ed --- /dev/null +++ b/docs/models/components/ClerkError.md @@ -0,0 +1,12 @@ +# ClerkError + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `message` | *String* | :heavy_check_mark: | N/A | +| `longMessage` | *String* | :heavy_check_mark: | N/A | +| `code` | *String* | :heavy_check_mark: | N/A | +| `meta` | [Optional](../../models/components/Meta.md) | :heavy_minus_sign: | N/A | +| `clerkTraceId` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/ClerkErrorErrorMeta.md b/docs/models/components/ClerkErrorErrorMeta.md new file mode 100644 index 0000000..e705a2f --- /dev/null +++ b/docs/models/components/ClerkErrorErrorMeta.md @@ -0,0 +1,7 @@ +# ClerkErrorErrorMeta + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/Client.md b/docs/models/components/Client.md new file mode 100644 index 0000000..306c40f --- /dev/null +++ b/docs/models/components/Client.md @@ -0,0 +1,16 @@ +# Client + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.Object](../../models/components/Object.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value.
| +| `id` | *String* | :heavy_check_mark: | String representing the identifier of the session.
| +| `sessionIds` | List<*String*> | :heavy_check_mark: | N/A | +| `sessions` | List<[com.clerk.backend_api.models.components.Session](../../models/components/Session.md)> | :heavy_check_mark: | N/A | +| `signInId` | *Optional* | :heavy_check_mark: | N/A | +| `signUpId` | *Optional* | :heavy_check_mark: | N/A | +| `lastActiveSessionId` | *Optional* | :heavy_check_mark: | Last active session_id.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| \ No newline at end of file diff --git a/docs/models/components/DeletedObject.md b/docs/models/components/DeletedObject.md new file mode 100644 index 0000000..4465bfe --- /dev/null +++ b/docs/models/components/DeletedObject.md @@ -0,0 +1,11 @@ +# DeletedObject + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `object` | *String* | :heavy_check_mark: | N/A | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `slug` | *Optional* | :heavy_minus_sign: | N/A | +| `deleted` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/Domain.md b/docs/models/components/Domain.md new file mode 100644 index 0000000..4026ce7 --- /dev/null +++ b/docs/models/components/Domain.md @@ -0,0 +1,16 @@ +# Domain + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.DomainObject](../../models/components/DomainObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `isSatellite` | *boolean* | :heavy_check_mark: | N/A | +| `frontendApiUrl` | *String* | :heavy_check_mark: | N/A | +| `accountsPortalUrl` | *JsonNullable* | :heavy_minus_sign: | Null for satellite domains.
| +| `proxyUrl` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `developmentOrigin` | *String* | :heavy_check_mark: | N/A | +| `cnameTargets` | List<[com.clerk.backend_api.models.components.CNameTarget](../../models/components/CNameTarget.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/DomainObject.md b/docs/models/components/DomainObject.md new file mode 100644 index 0000000..893b03e --- /dev/null +++ b/docs/models/components/DomainObject.md @@ -0,0 +1,8 @@ +# DomainObject + + +## Values + +| Name | Value | +| -------- | -------- | +| `DOMAIN` | domain | \ No newline at end of file diff --git a/docs/models/components/Domains.md b/docs/models/components/Domains.md new file mode 100644 index 0000000..a6ff079 --- /dev/null +++ b/docs/models/components/Domains.md @@ -0,0 +1,9 @@ +# Domains + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `data` | List<[com.clerk.backend_api.models.components.Domain](../../models/components/Domain.md)> | :heavy_check_mark: | N/A | +| `totalCount` | *long* | :heavy_check_mark: | Total number of domains
| \ No newline at end of file diff --git a/docs/models/components/DomainsEnrollmentModes.md b/docs/models/components/DomainsEnrollmentModes.md new file mode 100644 index 0000000..5af92ef --- /dev/null +++ b/docs/models/components/DomainsEnrollmentModes.md @@ -0,0 +1,10 @@ +# DomainsEnrollmentModes + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `MANUAL_INVITATION` | manual_invitation | +| `AUTOMATIC_INVITATION` | automatic_invitation | +| `AUTOMATIC_SUGGESTION` | automatic_suggestion | \ No newline at end of file diff --git a/docs/models/components/EmailAddress.md b/docs/models/components/EmailAddress.md new file mode 100644 index 0000000..851517e --- /dev/null +++ b/docs/models/components/EmailAddress.md @@ -0,0 +1,15 @@ +# EmailAddress + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `object` | [com.clerk.backend_api.models.components.EmailAddressObject](../../models/components/EmailAddressObject.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value.
| +| `emailAddress` | *String* | :heavy_check_mark: | N/A | +| `reserved` | *boolean* | :heavy_check_mark: | N/A | +| `verification` | [Optional](../../models/components/Verification.md) | :heavy_check_mark: | N/A | +| `linkedTo` | List<[com.clerk.backend_api.models.components.IdentificationLink](../../models/components/IdentificationLink.md)> | :heavy_check_mark: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation
| \ No newline at end of file diff --git a/docs/models/components/EmailAddressObject.md b/docs/models/components/EmailAddressObject.md new file mode 100644 index 0000000..d04e242 --- /dev/null +++ b/docs/models/components/EmailAddressObject.md @@ -0,0 +1,11 @@ +# EmailAddressObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `EMAIL_ADDRESS` | email_address | \ No newline at end of file diff --git a/docs/models/components/Error.md b/docs/models/components/Error.md new file mode 100644 index 0000000..d92caf2 --- /dev/null +++ b/docs/models/components/Error.md @@ -0,0 +1,2 @@ +# Error + diff --git a/docs/models/components/ErrorClerkError.md b/docs/models/components/ErrorClerkError.md new file mode 100644 index 0000000..19af3aa --- /dev/null +++ b/docs/models/components/ErrorClerkError.md @@ -0,0 +1,12 @@ +# ErrorClerkError + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `message` | *String* | :heavy_check_mark: | N/A | +| `longMessage` | *String* | :heavy_check_mark: | N/A | +| `code` | *String* | :heavy_check_mark: | N/A | +| `meta` | [Optional](../../models/components/ErrorMeta.md) | :heavy_minus_sign: | N/A | +| `clerkTraceId` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/ErrorMeta.md b/docs/models/components/ErrorMeta.md new file mode 100644 index 0000000..e498afa --- /dev/null +++ b/docs/models/components/ErrorMeta.md @@ -0,0 +1,7 @@ +# ErrorMeta + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/ExternalAccount.md b/docs/models/components/ExternalAccount.md new file mode 100644 index 0000000..2d331fb --- /dev/null +++ b/docs/models/components/ExternalAccount.md @@ -0,0 +1,7 @@ +# ExternalAccount + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/ExternalAccounts.md b/docs/models/components/ExternalAccounts.md new file mode 100644 index 0000000..7bbc958 --- /dev/null +++ b/docs/models/components/ExternalAccounts.md @@ -0,0 +1,7 @@ +# ExternalAccounts + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/IdentificationLink.md b/docs/models/components/IdentificationLink.md new file mode 100644 index 0000000..b19c2cb --- /dev/null +++ b/docs/models/components/IdentificationLink.md @@ -0,0 +1,9 @@ +# IdentificationLink + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `type` | [com.clerk.backend_api.models.components.Type](../../models/components/Type.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/IdentifierType.md b/docs/models/components/IdentifierType.md new file mode 100644 index 0000000..40d4d41 --- /dev/null +++ b/docs/models/components/IdentifierType.md @@ -0,0 +1,10 @@ +# IdentifierType + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `EMAIL_ADDRESS` | email_address | +| `PHONE_NUMBER` | phone_number | +| `WEB3_WALLET` | web3_wallet | \ No newline at end of file diff --git a/docs/models/components/InstanceRestrictions.md b/docs/models/components/InstanceRestrictions.md new file mode 100644 index 0000000..da67f5a --- /dev/null +++ b/docs/models/components/InstanceRestrictions.md @@ -0,0 +1,12 @@ +# InstanceRestrictions + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [Optional](../../models/components/InstanceRestrictionsObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value. | +| `allowlist` | *Optional* | :heavy_minus_sign: | N/A | +| `blocklist` | *Optional* | :heavy_minus_sign: | N/A | +| `blockEmailSubaddresses` | *Optional* | :heavy_minus_sign: | N/A | +| `ignoreDotsForGmailAddresses` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/InstanceRestrictionsObject.md b/docs/models/components/InstanceRestrictionsObject.md new file mode 100644 index 0000000..142f45a --- /dev/null +++ b/docs/models/components/InstanceRestrictionsObject.md @@ -0,0 +1,10 @@ +# InstanceRestrictionsObject + +String representing the object's type. Objects of the same type share the same value. + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `INSTANCE_RESTRICTIONS` | instance_restrictions | \ No newline at end of file diff --git a/docs/models/components/InstanceSettings.md b/docs/models/components/InstanceSettings.md new file mode 100644 index 0000000..3d457bf --- /dev/null +++ b/docs/models/components/InstanceSettings.md @@ -0,0 +1,13 @@ +# InstanceSettings + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [Optional](../../models/components/InstanceSettingsObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value. | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `restrictedToAllowlist` | *Optional* | :heavy_minus_sign: | N/A | +| `fromEmailAddress` | *Optional* | :heavy_minus_sign: | N/A | +| `progressiveSignUp` | *Optional* | :heavy_minus_sign: | N/A | +| `enhancedEmailDeliverability` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/InstanceSettingsObject.md b/docs/models/components/InstanceSettingsObject.md new file mode 100644 index 0000000..0b1bac6 --- /dev/null +++ b/docs/models/components/InstanceSettingsObject.md @@ -0,0 +1,10 @@ +# InstanceSettingsObject + +String representing the object's type. Objects of the same type share the same value. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `INSTANCE_SETTINGS` | instance_settings | \ No newline at end of file diff --git a/docs/models/components/Invitation.md b/docs/models/components/Invitation.md new file mode 100644 index 0000000..49cd69c --- /dev/null +++ b/docs/models/components/Invitation.md @@ -0,0 +1,16 @@ +# Invitation + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.InvitationObject](../../models/components/InvitationObject.md) | :heavy_check_mark: | N/A | | +| `id` | *String* | :heavy_check_mark: | N/A | | +| `emailAddress` | *String* | :heavy_check_mark: | N/A | | +| `publicMetadata` | [Optional](../../models/components/InvitationPublicMetadata.md) | :heavy_minus_sign: | N/A | | +| `revoked` | *Optional* | :heavy_minus_sign: | N/A | false | +| `status` | [com.clerk.backend_api.models.components.InvitationStatus](../../models/components/InvitationStatus.md) | :heavy_check_mark: | N/A | pending | +| `url` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| | +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| | \ No newline at end of file diff --git a/docs/models/components/InvitationObject.md b/docs/models/components/InvitationObject.md new file mode 100644 index 0000000..c70a864 --- /dev/null +++ b/docs/models/components/InvitationObject.md @@ -0,0 +1,8 @@ +# InvitationObject + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `INVITATION` | invitation | \ No newline at end of file diff --git a/docs/models/components/InvitationPublicMetadata.md b/docs/models/components/InvitationPublicMetadata.md new file mode 100644 index 0000000..86cefd3 --- /dev/null +++ b/docs/models/components/InvitationPublicMetadata.md @@ -0,0 +1,7 @@ +# InvitationPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/InvitationRevoked.md b/docs/models/components/InvitationRevoked.md new file mode 100644 index 0000000..e4b1dae --- /dev/null +++ b/docs/models/components/InvitationRevoked.md @@ -0,0 +1,16 @@ +# InvitationRevoked + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.InvitationRevokedObject](../../models/components/InvitationRevokedObject.md) | :heavy_check_mark: | N/A | | +| `id` | *String* | :heavy_check_mark: | N/A | | +| `emailAddress` | *String* | :heavy_check_mark: | N/A | | +| `publicMetadata` | [Optional](../../models/components/InvitationRevokedPublicMetadata.md) | :heavy_minus_sign: | N/A | | +| `revoked` | *Optional* | :heavy_minus_sign: | N/A | true | +| `status` | [com.clerk.backend_api.models.components.InvitationRevokedStatus](../../models/components/InvitationRevokedStatus.md) | :heavy_check_mark: | N/A | revoked | +| `url` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| | +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| | \ No newline at end of file diff --git a/docs/models/components/InvitationRevokedObject.md b/docs/models/components/InvitationRevokedObject.md new file mode 100644 index 0000000..8e8675f --- /dev/null +++ b/docs/models/components/InvitationRevokedObject.md @@ -0,0 +1,8 @@ +# InvitationRevokedObject + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `INVITATION` | invitation | \ No newline at end of file diff --git a/docs/models/components/InvitationRevokedPublicMetadata.md b/docs/models/components/InvitationRevokedPublicMetadata.md new file mode 100644 index 0000000..7a57063 --- /dev/null +++ b/docs/models/components/InvitationRevokedPublicMetadata.md @@ -0,0 +1,7 @@ +# InvitationRevokedPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/InvitationRevokedStatus.md b/docs/models/components/InvitationRevokedStatus.md new file mode 100644 index 0000000..36eda6a --- /dev/null +++ b/docs/models/components/InvitationRevokedStatus.md @@ -0,0 +1,8 @@ +# InvitationRevokedStatus + + +## Values + +| Name | Value | +| --------- | --------- | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/components/InvitationStatus.md b/docs/models/components/InvitationStatus.md new file mode 100644 index 0000000..fa867b7 --- /dev/null +++ b/docs/models/components/InvitationStatus.md @@ -0,0 +1,10 @@ +# InvitationStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `ACCEPTED` | accepted | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/components/JWTTemplate.md b/docs/models/components/JWTTemplate.md new file mode 100644 index 0000000..663321c --- /dev/null +++ b/docs/models/components/JWTTemplate.md @@ -0,0 +1,17 @@ +# JWTTemplate + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.JWTTemplateObject](../../models/components/JWTTemplateObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `claims` | [com.clerk.backend_api.models.components.Claims](../../models/components/Claims.md) | :heavy_check_mark: | N/A | +| `lifetime` | *long* | :heavy_check_mark: | N/A | +| `allowedClockSkew` | *long* | :heavy_check_mark: | N/A | +| `customSigningKey` | *Optional* | :heavy_minus_sign: | N/A | +| `signingAlgorithm` | *Optional* | :heavy_minus_sign: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/JWTTemplateObject.md b/docs/models/components/JWTTemplateObject.md new file mode 100644 index 0000000..707c0e1 --- /dev/null +++ b/docs/models/components/JWTTemplateObject.md @@ -0,0 +1,8 @@ +# JWTTemplateObject + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `JWT_TEMPLATE` | jwt_template | \ No newline at end of file diff --git a/docs/models/components/Meta.md b/docs/models/components/Meta.md new file mode 100644 index 0000000..93f98d6 --- /dev/null +++ b/docs/models/components/Meta.md @@ -0,0 +1,7 @@ +# Meta + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/Nonce.md b/docs/models/components/Nonce.md new file mode 100644 index 0000000..29706b1 --- /dev/null +++ b/docs/models/components/Nonce.md @@ -0,0 +1,8 @@ +# Nonce + + +## Values + +| Name | Value | +| ------- | ------- | +| `NONCE` | nonce | \ No newline at end of file diff --git a/docs/models/components/OAuthApplication.md b/docs/models/components/OAuthApplication.md new file mode 100644 index 0000000..a6cc9b8 --- /dev/null +++ b/docs/models/components/OAuthApplication.md @@ -0,0 +1,20 @@ +# OAuthApplication + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.OAuthApplicationObject](../../models/components/OAuthApplicationObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `instanceId` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `clientId` | *String* | :heavy_check_mark: | N/A | +| `public_` | *boolean* | :heavy_check_mark: | N/A | +| `scopes` | *String* | :heavy_check_mark: | N/A | +| `callbackUrl` | *String* | :heavy_check_mark: | N/A | +| `authorizeUrl` | *String* | :heavy_check_mark: | N/A | +| `tokenFetchUrl` | *String* | :heavy_check_mark: | N/A | +| `userInfoUrl` | *String* | :heavy_check_mark: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/OAuthApplicationObject.md b/docs/models/components/OAuthApplicationObject.md new file mode 100644 index 0000000..a24dc96 --- /dev/null +++ b/docs/models/components/OAuthApplicationObject.md @@ -0,0 +1,8 @@ +# OAuthApplicationObject + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `OAUTH_APPLICATION` | oauth_application | \ No newline at end of file diff --git a/docs/models/components/OAuthApplicationWithSecret.md b/docs/models/components/OAuthApplicationWithSecret.md new file mode 100644 index 0000000..7ed81ee --- /dev/null +++ b/docs/models/components/OAuthApplicationWithSecret.md @@ -0,0 +1,21 @@ +# OAuthApplicationWithSecret + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.OAuthApplicationWithSecretObject](../../models/components/OAuthApplicationWithSecretObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `instanceId` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `clientId` | *String* | :heavy_check_mark: | N/A | +| `public_` | *boolean* | :heavy_check_mark: | N/A | +| `scopes` | *String* | :heavy_check_mark: | N/A | +| `callbackUrl` | *String* | :heavy_check_mark: | N/A | +| `authorizeUrl` | *String* | :heavy_check_mark: | N/A | +| `tokenFetchUrl` | *String* | :heavy_check_mark: | N/A | +| `userInfoUrl` | *String* | :heavy_check_mark: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| +| `clientSecret` | *Optional* | :heavy_minus_sign: | Empty if public client.
| \ No newline at end of file diff --git a/docs/models/components/OAuthApplicationWithSecretObject.md b/docs/models/components/OAuthApplicationWithSecretObject.md new file mode 100644 index 0000000..f305752 --- /dev/null +++ b/docs/models/components/OAuthApplicationWithSecretObject.md @@ -0,0 +1,8 @@ +# OAuthApplicationWithSecretObject + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `OAUTH_APPLICATION` | oauth_application | \ No newline at end of file diff --git a/docs/models/components/OAuthApplications.md b/docs/models/components/OAuthApplications.md new file mode 100644 index 0000000..9f6647c --- /dev/null +++ b/docs/models/components/OAuthApplications.md @@ -0,0 +1,9 @@ +# OAuthApplications + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `data` | List<[com.clerk.backend_api.models.components.OAuthApplication](../../models/components/OAuthApplication.md)> | :heavy_check_mark: | N/A | +| `totalCount` | *long* | :heavy_check_mark: | Total number of OAuth applications
| \ No newline at end of file diff --git a/docs/models/components/OTPVerificationStatus.md b/docs/models/components/OTPVerificationStatus.md new file mode 100644 index 0000000..788b4f9 --- /dev/null +++ b/docs/models/components/OTPVerificationStatus.md @@ -0,0 +1,11 @@ +# OTPVerificationStatus + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `UNVERIFIED` | unverified | +| `VERIFIED` | verified | +| `FAILED` | failed | +| `EXPIRED` | expired | \ No newline at end of file diff --git a/docs/models/components/OTPVerificationStrategy.md b/docs/models/components/OTPVerificationStrategy.md new file mode 100644 index 0000000..ea83f29 --- /dev/null +++ b/docs/models/components/OTPVerificationStrategy.md @@ -0,0 +1,10 @@ +# OTPVerificationStrategy + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `PHONE_CODE` | phone_code | +| `EMAIL_CODE` | email_code | +| `RESET_PASSWORD_EMAIL_CODE` | reset_password_email_code | \ No newline at end of file diff --git a/docs/models/components/Oauth.md b/docs/models/components/Oauth.md new file mode 100644 index 0000000..84f2480 --- /dev/null +++ b/docs/models/components/Oauth.md @@ -0,0 +1,13 @@ +# Oauth + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.OauthVerificationStatus](../../models/components/OauthVerificationStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.OauthVerificationStrategy](../../models/components/OauthVerificationStrategy.md) | :heavy_check_mark: | N/A | +| `externalVerificationRedirectUrl` | *Optional* | :heavy_minus_sign: | N/A | +| `error` | [JsonNullable](../../models/components/Error.md) | :heavy_minus_sign: | N/A | +| `expireAt` | *long* | :heavy_check_mark: | N/A | +| `attempts` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/OauthVerificationStatus.md b/docs/models/components/OauthVerificationStatus.md new file mode 100644 index 0000000..9638035 --- /dev/null +++ b/docs/models/components/OauthVerificationStatus.md @@ -0,0 +1,12 @@ +# 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 new file mode 100644 index 0000000..8b785df --- /dev/null +++ b/docs/models/components/OauthVerificationStrategy.md @@ -0,0 +1,9 @@ +# OauthVerificationStrategy + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `OAUTH_GOOGLE` | oauth_google | +| `OAUTH_MOCK` | oauth_mock | \ No newline at end of file diff --git a/docs/models/components/Object.md b/docs/models/components/Object.md new file mode 100644 index 0000000..ec43ade --- /dev/null +++ b/docs/models/components/Object.md @@ -0,0 +1,11 @@ +# Object + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| -------- | -------- | +| `CLIENT` | client | \ No newline at end of file diff --git a/docs/models/components/Organization.md b/docs/models/components/Organization.md new file mode 100644 index 0000000..149093d --- /dev/null +++ b/docs/models/components/Organization.md @@ -0,0 +1,19 @@ +# Organization + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.OrganizationObject](../../models/components/OrganizationObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `slug` | *String* | :heavy_check_mark: | N/A | +| `membersCount` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `maxAllowedMemberships` | *long* | :heavy_check_mark: | N/A | +| `adminDeleteEnabled` | *Optional* | :heavy_minus_sign: | N/A | +| `publicMetadata` | [com.clerk.backend_api.models.components.OrganizationPublicMetadata](../../models/components/OrganizationPublicMetadata.md) | :heavy_check_mark: | N/A | +| `privateMetadata` | [com.clerk.backend_api.models.components.OrganizationPrivateMetadata](../../models/components/OrganizationPrivateMetadata.md) | :heavy_check_mark: | N/A | +| `createdBy` | *Optional* | :heavy_minus_sign: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/OrganizationInvitation.md b/docs/models/components/OrganizationInvitation.md new file mode 100644 index 0000000..2711ddd --- /dev/null +++ b/docs/models/components/OrganizationInvitation.md @@ -0,0 +1,19 @@ +# OrganizationInvitation + +An organization invitation + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `object` | [Optional](../../models/components/OrganizationInvitationObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| +| `emailAddress` | *Optional* | :heavy_minus_sign: | N/A | +| `role` | *Optional* | :heavy_minus_sign: | N/A | +| `organizationId` | *Optional* | :heavy_minus_sign: | N/A | +| `status` | *Optional* | :heavy_minus_sign: | N/A | +| `publicMetadata` | [Optional](../../models/components/OrganizationInvitationPublicMetadata.md) | :heavy_minus_sign: | N/A | +| `privateMetadata` | [Optional](../../models/components/OrganizationInvitationPrivateMetadata.md) | :heavy_minus_sign: | N/A | +| `createdAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of creation. | +| `updatedAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of last update. | \ No newline at end of file diff --git a/docs/models/components/OrganizationInvitationObject.md b/docs/models/components/OrganizationInvitationObject.md new file mode 100644 index 0000000..be5a971 --- /dev/null +++ b/docs/models/components/OrganizationInvitationObject.md @@ -0,0 +1,11 @@ +# OrganizationInvitationObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `ORGANIZATION_INVITATION` | organization_invitation | \ No newline at end of file diff --git a/docs/models/components/OrganizationInvitationPrivateMetadata.md b/docs/models/components/OrganizationInvitationPrivateMetadata.md new file mode 100644 index 0000000..179f38a --- /dev/null +++ b/docs/models/components/OrganizationInvitationPrivateMetadata.md @@ -0,0 +1,7 @@ +# OrganizationInvitationPrivateMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationInvitationPublicMetadata.md b/docs/models/components/OrganizationInvitationPublicMetadata.md new file mode 100644 index 0000000..f0b62d1 --- /dev/null +++ b/docs/models/components/OrganizationInvitationPublicMetadata.md @@ -0,0 +1,7 @@ +# OrganizationInvitationPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationInvitations.md b/docs/models/components/OrganizationInvitations.md new file mode 100644 index 0000000..a04087d --- /dev/null +++ b/docs/models/components/OrganizationInvitations.md @@ -0,0 +1,9 @@ +# OrganizationInvitations + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `data` | List<[com.clerk.backend_api.models.components.OrganizationInvitation](../../models/components/OrganizationInvitation.md)> | :heavy_check_mark: | N/A | +| `totalCount` | *long* | :heavy_check_mark: | Total number of organization invitations
| \ No newline at end of file diff --git a/docs/models/components/OrganizationMembership.md b/docs/models/components/OrganizationMembership.md new file mode 100644 index 0000000..031561a --- /dev/null +++ b/docs/models/components/OrganizationMembership.md @@ -0,0 +1,19 @@ +# OrganizationMembership + +Hello world + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `object` | [Optional](../../models/components/OrganizationMembershipObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| +| `role` | *Optional* | :heavy_minus_sign: | N/A | +| `permissions` | List<*String*> | :heavy_minus_sign: | N/A | +| `publicMetadata` | [Optional](../../models/components/OrganizationMembershipPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization membership, accessible from both Frontend and Backend APIs | +| `privateMetadata` | [Optional](../../models/components/OrganizationMembershipPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization membership, accessible only from the Backend API | +| `organization` | [Optional](../../models/components/OrganizationMembershipOrganization.md) | :heavy_minus_sign: | N/A | +| `publicUserData` | [Optional](../../models/components/PublicUserData.md) | :heavy_minus_sign: | N/A | +| `createdAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of creation. | +| `updatedAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of last update. | \ No newline at end of file diff --git a/docs/models/components/OrganizationMembershipObject.md b/docs/models/components/OrganizationMembershipObject.md new file mode 100644 index 0000000..b06b6f2 --- /dev/null +++ b/docs/models/components/OrganizationMembershipObject.md @@ -0,0 +1,11 @@ +# OrganizationMembershipObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `ORGANIZATION_MEMBERSHIP` | organization_membership | \ No newline at end of file diff --git a/docs/models/components/OrganizationMembershipOrganization.md b/docs/models/components/OrganizationMembershipOrganization.md new file mode 100644 index 0000000..22acd4c --- /dev/null +++ b/docs/models/components/OrganizationMembershipOrganization.md @@ -0,0 +1,19 @@ +# OrganizationMembershipOrganization + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.OrganizationMembershipOrganizationObject](../../models/components/OrganizationMembershipOrganizationObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `slug` | *String* | :heavy_check_mark: | N/A | +| `membersCount` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `maxAllowedMemberships` | *long* | :heavy_check_mark: | N/A | +| `adminDeleteEnabled` | *Optional* | :heavy_minus_sign: | N/A | +| `publicMetadata` | [com.clerk.backend_api.models.components.OrganizationMembershipOrganizationPublicMetadata](../../models/components/OrganizationMembershipOrganizationPublicMetadata.md) | :heavy_check_mark: | N/A | +| `privateMetadata` | [com.clerk.backend_api.models.components.OrganizationMembershipOrganizationPrivateMetadata](../../models/components/OrganizationMembershipOrganizationPrivateMetadata.md) | :heavy_check_mark: | N/A | +| `createdBy` | *Optional* | :heavy_minus_sign: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/OrganizationMembershipOrganizationObject.md b/docs/models/components/OrganizationMembershipOrganizationObject.md new file mode 100644 index 0000000..aa6222b --- /dev/null +++ b/docs/models/components/OrganizationMembershipOrganizationObject.md @@ -0,0 +1,8 @@ +# OrganizationMembershipOrganizationObject + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `ORGANIZATION` | organization | \ No newline at end of file diff --git a/docs/models/components/OrganizationMembershipOrganizationPrivateMetadata.md b/docs/models/components/OrganizationMembershipOrganizationPrivateMetadata.md new file mode 100644 index 0000000..361b894 --- /dev/null +++ b/docs/models/components/OrganizationMembershipOrganizationPrivateMetadata.md @@ -0,0 +1,7 @@ +# OrganizationMembershipOrganizationPrivateMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationMembershipOrganizationPublicMetadata.md b/docs/models/components/OrganizationMembershipOrganizationPublicMetadata.md new file mode 100644 index 0000000..7040de0 --- /dev/null +++ b/docs/models/components/OrganizationMembershipOrganizationPublicMetadata.md @@ -0,0 +1,7 @@ +# OrganizationMembershipOrganizationPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationMembershipPrivateMetadata.md b/docs/models/components/OrganizationMembershipPrivateMetadata.md new file mode 100644 index 0000000..82b7b53 --- /dev/null +++ b/docs/models/components/OrganizationMembershipPrivateMetadata.md @@ -0,0 +1,9 @@ +# OrganizationMembershipPrivateMetadata + +Metadata saved on the organization membership, accessible only from the Backend API + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationMembershipPublicMetadata.md b/docs/models/components/OrganizationMembershipPublicMetadata.md new file mode 100644 index 0000000..e9197dd --- /dev/null +++ b/docs/models/components/OrganizationMembershipPublicMetadata.md @@ -0,0 +1,9 @@ +# OrganizationMembershipPublicMetadata + +Metadata saved on the organization membership, accessible from both Frontend and Backend APIs + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationMemberships.md b/docs/models/components/OrganizationMemberships.md new file mode 100644 index 0000000..9cca8c4 --- /dev/null +++ b/docs/models/components/OrganizationMemberships.md @@ -0,0 +1,9 @@ +# OrganizationMemberships + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `data` | List<[com.clerk.backend_api.models.components.OrganizationMembership](../../models/components/OrganizationMembership.md)> | :heavy_check_mark: | N/A | +| `totalCount` | *long* | :heavy_check_mark: | Total number of organization memberships
| \ No newline at end of file diff --git a/docs/models/components/OrganizationObject.md b/docs/models/components/OrganizationObject.md new file mode 100644 index 0000000..30e26e2 --- /dev/null +++ b/docs/models/components/OrganizationObject.md @@ -0,0 +1,8 @@ +# OrganizationObject + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `ORGANIZATION` | organization | \ No newline at end of file diff --git a/docs/models/components/OrganizationPrivateMetadata.md b/docs/models/components/OrganizationPrivateMetadata.md new file mode 100644 index 0000000..a6c2475 --- /dev/null +++ b/docs/models/components/OrganizationPrivateMetadata.md @@ -0,0 +1,7 @@ +# OrganizationPrivateMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationPublicMetadata.md b/docs/models/components/OrganizationPublicMetadata.md new file mode 100644 index 0000000..9beca5e --- /dev/null +++ b/docs/models/components/OrganizationPublicMetadata.md @@ -0,0 +1,7 @@ +# OrganizationPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationSettings.md b/docs/models/components/OrganizationSettings.md new file mode 100644 index 0000000..8e1095c --- /dev/null +++ b/docs/models/components/OrganizationSettings.md @@ -0,0 +1,17 @@ +# OrganizationSettings + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.OrganizationSettingsObject](../../models/components/OrganizationSettingsObject.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value. | +| `enabled` | *boolean* | :heavy_check_mark: | N/A | +| `maxAllowedMemberships` | *long* | :heavy_check_mark: | N/A | +| `maxAllowedRoles` | *Optional* | :heavy_minus_sign: | N/A | +| `maxAllowedPermissions` | *Optional* | :heavy_minus_sign: | N/A | +| `creatorRole` | *String* | :heavy_check_mark: | The role key that a user will be assigned after creating an organization. | +| `adminDeleteEnabled` | *boolean* | :heavy_check_mark: | The default for whether an admin can delete an organization with the Frontend API. | +| `domainsEnabled` | *boolean* | :heavy_check_mark: | N/A | +| `domainsEnrollmentModes` | List<[com.clerk.backend_api.models.components.DomainsEnrollmentModes](../../models/components/DomainsEnrollmentModes.md)> | :heavy_check_mark: | N/A | +| `domainsDefaultRole` | *String* | :heavy_check_mark: | The role key that it will be used in order to create an organization invitation or suggestion. | \ No newline at end of file diff --git a/docs/models/components/OrganizationSettingsObject.md b/docs/models/components/OrganizationSettingsObject.md new file mode 100644 index 0000000..023bd08 --- /dev/null +++ b/docs/models/components/OrganizationSettingsObject.md @@ -0,0 +1,10 @@ +# OrganizationSettingsObject + +String representing the object's type. Objects of the same type share the same value. + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `ORGANIZATION_SETTINGS` | organization_settings | \ No newline at end of file diff --git a/docs/models/components/OrganizationWithLogo.md b/docs/models/components/OrganizationWithLogo.md new file mode 100644 index 0000000..6764d07 --- /dev/null +++ b/docs/models/components/OrganizationWithLogo.md @@ -0,0 +1,22 @@ +# OrganizationWithLogo + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.OrganizationWithLogoObject](../../models/components/OrganizationWithLogoObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `slug` | *String* | :heavy_check_mark: | N/A | +| `membersCount` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `maxAllowedMemberships` | *long* | :heavy_check_mark: | N/A | +| `adminDeleteEnabled` | *Optional* | :heavy_minus_sign: | N/A | +| `publicMetadata` | [com.clerk.backend_api.models.components.OrganizationWithLogoPublicMetadata](../../models/components/OrganizationWithLogoPublicMetadata.md) | :heavy_check_mark: | N/A | +| `privateMetadata` | [com.clerk.backend_api.models.components.OrganizationWithLogoPrivateMetadata](../../models/components/OrganizationWithLogoPrivateMetadata.md) | :heavy_check_mark: | N/A | +| `createdBy` | *Optional* | :heavy_minus_sign: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| +| ~~`logoUrl`~~ | *Optional* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `imageUrl` | *String* | :heavy_check_mark: | N/A | +| `hasImage` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/OrganizationWithLogoObject.md b/docs/models/components/OrganizationWithLogoObject.md new file mode 100644 index 0000000..cdb1d2e --- /dev/null +++ b/docs/models/components/OrganizationWithLogoObject.md @@ -0,0 +1,8 @@ +# OrganizationWithLogoObject + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `ORGANIZATION` | organization | \ No newline at end of file diff --git a/docs/models/components/OrganizationWithLogoPrivateMetadata.md b/docs/models/components/OrganizationWithLogoPrivateMetadata.md new file mode 100644 index 0000000..3c6b8d7 --- /dev/null +++ b/docs/models/components/OrganizationWithLogoPrivateMetadata.md @@ -0,0 +1,7 @@ +# OrganizationWithLogoPrivateMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/OrganizationWithLogoPublicMetadata.md b/docs/models/components/OrganizationWithLogoPublicMetadata.md new file mode 100644 index 0000000..fb7c525 --- /dev/null +++ b/docs/models/components/OrganizationWithLogoPublicMetadata.md @@ -0,0 +1,7 @@ +# OrganizationWithLogoPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/Organizations.md b/docs/models/components/Organizations.md new file mode 100644 index 0000000..03cac70 --- /dev/null +++ b/docs/models/components/Organizations.md @@ -0,0 +1,9 @@ +# Organizations + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `data` | List<[com.clerk.backend_api.models.components.Organization](../../models/components/Organization.md)> | :heavy_check_mark: | N/A | +| `totalCount` | *long* | :heavy_check_mark: | Total number of organizations
| \ No newline at end of file diff --git a/docs/models/components/Otp.md b/docs/models/components/Otp.md new file mode 100644 index 0000000..c92315e --- /dev/null +++ b/docs/models/components/Otp.md @@ -0,0 +1,11 @@ +# Otp + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.VerificationStatus](../../models/components/VerificationStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.Strategy](../../models/components/Strategy.md) | :heavy_check_mark: | N/A | +| `attempts` | *long* | :heavy_check_mark: | N/A | +| `expireAt` | *long* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/Passkey.md b/docs/models/components/Passkey.md new file mode 100644 index 0000000..9b2202e --- /dev/null +++ b/docs/models/components/Passkey.md @@ -0,0 +1,12 @@ +# Passkey + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.PasskeyVerificationStatus](../../models/components/PasskeyVerificationStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.PasskeyVerificationStrategy](../../models/components/PasskeyVerificationStrategy.md) | :heavy_check_mark: | N/A | +| `nonce` | [Optional](../../models/components/VerificationNonce.md) | :heavy_minus_sign: | N/A | +| `attempts` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `expireAt` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/PasskeyVerificationStatus.md b/docs/models/components/PasskeyVerificationStatus.md new file mode 100644 index 0000000..2fe4f12 --- /dev/null +++ b/docs/models/components/PasskeyVerificationStatus.md @@ -0,0 +1,8 @@ +# PasskeyVerificationStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `VERIFIED` | verified | \ No newline at end of file diff --git a/docs/models/components/PasskeyVerificationStrategy.md b/docs/models/components/PasskeyVerificationStrategy.md new file mode 100644 index 0000000..af43d3f --- /dev/null +++ b/docs/models/components/PasskeyVerificationStrategy.md @@ -0,0 +1,8 @@ +# PasskeyVerificationStrategy + + +## Values + +| Name | Value | +| --------- | --------- | +| `PASSKEY` | passkey | \ No newline at end of file diff --git a/docs/models/components/PhoneNumber.md b/docs/models/components/PhoneNumber.md new file mode 100644 index 0000000..b7607c6 --- /dev/null +++ b/docs/models/components/PhoneNumber.md @@ -0,0 +1,18 @@ +# PhoneNumber + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `object` | [com.clerk.backend_api.models.components.PhoneNumberObject](../../models/components/PhoneNumberObject.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value.
| +| `phoneNumber` | *String* | :heavy_check_mark: | N/A | +| `reservedForSecondFactor` | *Optional* | :heavy_minus_sign: | N/A | +| `defaultSecondFactor` | *Optional* | :heavy_minus_sign: | N/A | +| `reserved` | *boolean* | :heavy_check_mark: | N/A | +| `verification` | [Optional](../../models/components/PhoneNumberVerification.md) | :heavy_check_mark: | N/A | +| `linkedTo` | List<[com.clerk.backend_api.models.components.IdentificationLink](../../models/components/IdentificationLink.md)> | :heavy_check_mark: | N/A | +| `backupCodes` | List<*String*> | :heavy_minus_sign: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation
| \ No newline at end of file diff --git a/docs/models/components/PhoneNumberObject.md b/docs/models/components/PhoneNumberObject.md new file mode 100644 index 0000000..18fc0c3 --- /dev/null +++ b/docs/models/components/PhoneNumberObject.md @@ -0,0 +1,11 @@ +# PhoneNumberObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `PHONE_NUMBER` | phone_number | \ No newline at end of file diff --git a/docs/models/components/PhoneNumberVerification.md b/docs/models/components/PhoneNumberVerification.md new file mode 100644 index 0000000..3a064db --- /dev/null +++ b/docs/models/components/PhoneNumberVerification.md @@ -0,0 +1,2 @@ +# PhoneNumberVerification + diff --git a/docs/models/components/PrivateMetadata.md b/docs/models/components/PrivateMetadata.md new file mode 100644 index 0000000..133ba7d --- /dev/null +++ b/docs/models/components/PrivateMetadata.md @@ -0,0 +1,7 @@ +# PrivateMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/ProxyCheck.md b/docs/models/components/ProxyCheck.md new file mode 100644 index 0000000..2eeea81 --- /dev/null +++ b/docs/models/components/ProxyCheck.md @@ -0,0 +1,15 @@ +# ProxyCheck + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.ProxyCheckObject](../../models/components/ProxyCheckObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `domainId` | *String* | :heavy_check_mark: | N/A | +| `lastRunAt` | *long* | :heavy_check_mark: | N/A | +| `proxyUrl` | *String* | :heavy_check_mark: | N/A | +| `successful` | *boolean* | :heavy_check_mark: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | N/A | +| `updatedAt` | *long* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/ProxyCheckObject.md b/docs/models/components/ProxyCheckObject.md new file mode 100644 index 0000000..8f072d3 --- /dev/null +++ b/docs/models/components/ProxyCheckObject.md @@ -0,0 +1,8 @@ +# ProxyCheckObject + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `PROXY_CHECK` | proxy_check | \ No newline at end of file diff --git a/docs/models/components/PublicMetadata.md b/docs/models/components/PublicMetadata.md new file mode 100644 index 0000000..b994731 --- /dev/null +++ b/docs/models/components/PublicMetadata.md @@ -0,0 +1,7 @@ +# PublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/PublicUserData.md b/docs/models/components/PublicUserData.md new file mode 100644 index 0000000..a6bcdea --- /dev/null +++ b/docs/models/components/PublicUserData.md @@ -0,0 +1,14 @@ +# PublicUserData + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `userId` | *Optional* | :heavy_minus_sign: | N/A | +| `firstName` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `lastName` | *JsonNullable* | :heavy_minus_sign: | N/A | +| ~~`profileImageUrl`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `imageUrl` | *Optional* | :heavy_minus_sign: | N/A | +| `hasImage` | *Optional* | :heavy_minus_sign: | N/A | +| `identifier` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/RedirectURL.md b/docs/models/components/RedirectURL.md new file mode 100644 index 0000000..76b2cfd --- /dev/null +++ b/docs/models/components/RedirectURL.md @@ -0,0 +1,12 @@ +# RedirectURL + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.RedirectURLObject](../../models/components/RedirectURLObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `url` | *String* | :heavy_check_mark: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/RedirectURLObject.md b/docs/models/components/RedirectURLObject.md new file mode 100644 index 0000000..5007ef4 --- /dev/null +++ b/docs/models/components/RedirectURLObject.md @@ -0,0 +1,8 @@ +# RedirectURLObject + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `REDIRECT_URL` | redirect_url | \ No newline at end of file diff --git a/docs/models/components/SAMLAccount.md b/docs/models/components/SAMLAccount.md new file mode 100644 index 0000000..7b79076 --- /dev/null +++ b/docs/models/components/SAMLAccount.md @@ -0,0 +1,17 @@ +# SAMLAccount + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | N/A | +| `object` | [com.clerk.backend_api.models.components.SAMLAccountObject](../../models/components/SAMLAccountObject.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value.
| +| `provider` | *String* | :heavy_check_mark: | N/A | +| `active` | *boolean* | :heavy_check_mark: | N/A | +| `emailAddress` | *String* | :heavy_check_mark: | N/A | +| `firstName` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `lastName` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `providerUserId` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `publicMetadata` | [Optional](../../models/components/SAMLAccountPublicMetadata.md) | :heavy_minus_sign: | N/A | +| `verification` | [Optional](../../models/components/SAMLAccountVerification.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/SAMLAccountObject.md b/docs/models/components/SAMLAccountObject.md new file mode 100644 index 0000000..f993007 --- /dev/null +++ b/docs/models/components/SAMLAccountObject.md @@ -0,0 +1,11 @@ +# SAMLAccountObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `SAML_ACCOUNT` | saml_account | \ No newline at end of file diff --git a/docs/models/components/SAMLAccountPublicMetadata.md b/docs/models/components/SAMLAccountPublicMetadata.md new file mode 100644 index 0000000..9ff4040 --- /dev/null +++ b/docs/models/components/SAMLAccountPublicMetadata.md @@ -0,0 +1,7 @@ +# SAMLAccountPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/SAMLAccountVerification.md b/docs/models/components/SAMLAccountVerification.md new file mode 100644 index 0000000..5dd94f7 --- /dev/null +++ b/docs/models/components/SAMLAccountVerification.md @@ -0,0 +1,2 @@ +# SAMLAccountVerification + diff --git a/docs/models/components/SAMLConnection.md b/docs/models/components/SAMLConnection.md new file mode 100644 index 0000000..f9b81aa --- /dev/null +++ b/docs/models/components/SAMLConnection.md @@ -0,0 +1,28 @@ +# SAMLConnection + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.SAMLConnectionObject](../../models/components/SAMLConnectionObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `name` | *String* | :heavy_check_mark: | N/A | +| `domain` | *String* | :heavy_check_mark: | N/A | +| `idpEntityId` | *Optional* | :heavy_check_mark: | N/A | +| `idpSsoUrl` | *Optional* | :heavy_check_mark: | N/A | +| `idpCertificate` | *Optional* | :heavy_check_mark: | N/A | +| `idpMetadataUrl` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `idpMetadata` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `acsUrl` | *String* | :heavy_check_mark: | N/A | +| `spEntityId` | *String* | :heavy_check_mark: | N/A | +| `spMetadataUrl` | *String* | :heavy_check_mark: | N/A | +| `attributeMapping` | [Optional](../../models/components/AttributeMapping.md) | :heavy_minus_sign: | N/A | +| `active` | *boolean* | :heavy_check_mark: | N/A | +| `provider` | *String* | :heavy_check_mark: | N/A | +| `userCount` | *long* | :heavy_check_mark: | N/A | +| `syncUserAttributes` | *boolean* | :heavy_check_mark: | N/A | +| `allowSubdomains` | *Optional* | :heavy_minus_sign: | N/A | +| `allowIdpInitiated` | *Optional* | :heavy_minus_sign: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/SAMLConnectionObject.md b/docs/models/components/SAMLConnectionObject.md new file mode 100644 index 0000000..152e30a --- /dev/null +++ b/docs/models/components/SAMLConnectionObject.md @@ -0,0 +1,8 @@ +# SAMLConnectionObject + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `SAML_CONNECTION` | saml_connection | \ No newline at end of file diff --git a/docs/models/components/SAMLConnections.md b/docs/models/components/SAMLConnections.md new file mode 100644 index 0000000..33a829a --- /dev/null +++ b/docs/models/components/SAMLConnections.md @@ -0,0 +1,9 @@ +# SAMLConnections + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `data` | List<[com.clerk.backend_api.models.components.SAMLConnection](../../models/components/SAMLConnection.md)> | :heavy_check_mark: | N/A | +| `totalCount` | *long* | :heavy_check_mark: | Total number of SAML Connections
| \ No newline at end of file diff --git a/docs/models/components/SAMLErrorClerkError.md b/docs/models/components/SAMLErrorClerkError.md new file mode 100644 index 0000000..242bc51 --- /dev/null +++ b/docs/models/components/SAMLErrorClerkError.md @@ -0,0 +1,12 @@ +# SAMLErrorClerkError + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `message` | *String* | :heavy_check_mark: | N/A | +| `longMessage` | *String* | :heavy_check_mark: | N/A | +| `code` | *String* | :heavy_check_mark: | N/A | +| `meta` | [Optional](../../models/components/ClerkErrorErrorMeta.md) | :heavy_minus_sign: | N/A | +| `clerkTraceId` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/SAMLVerificationStatus.md b/docs/models/components/SAMLVerificationStatus.md new file mode 100644 index 0000000..64f88a8 --- /dev/null +++ b/docs/models/components/SAMLVerificationStatus.md @@ -0,0 +1,12 @@ +# SAMLVerificationStatus + + +## 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/SAMLVerificationStrategy.md b/docs/models/components/SAMLVerificationStrategy.md new file mode 100644 index 0000000..65978b9 --- /dev/null +++ b/docs/models/components/SAMLVerificationStrategy.md @@ -0,0 +1,8 @@ +# SAMLVerificationStrategy + + +## Values + +| Name | Value | +| ------ | ------ | +| `SAML` | saml | \ No newline at end of file diff --git a/docs/models/components/Saml.md b/docs/models/components/Saml.md new file mode 100644 index 0000000..4ba661e --- /dev/null +++ b/docs/models/components/Saml.md @@ -0,0 +1,13 @@ +# Saml + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.SAMLVerificationStatus](../../models/components/SAMLVerificationStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.SAMLVerificationStrategy](../../models/components/SAMLVerificationStrategy.md) | :heavy_check_mark: | N/A | +| `externalVerificationRedirectUrl` | *Optional* | :heavy_check_mark: | N/A | +| `error` | [JsonNullable](../../models/components/VerificationError.md) | :heavy_minus_sign: | N/A | +| `expireAt` | *long* | :heavy_check_mark: | N/A | +| `attempts` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/SchemasPasskey.md b/docs/models/components/SchemasPasskey.md new file mode 100644 index 0000000..dd3a42d --- /dev/null +++ b/docs/models/components/SchemasPasskey.md @@ -0,0 +1,12 @@ +# SchemasPasskey + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `object` | [com.clerk.backend_api.models.components.SchemasPasskeyObject](../../models/components/SchemasPasskeyObject.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value.
| +| `name` | *String* | :heavy_check_mark: | N/A | +| `lastUsedAt` | *long* | :heavy_check_mark: | Unix timestamp of when the passkey was last used.
| +| `verification` | [Optional](../../models/components/SchemasPasskeyVerification.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/SchemasPasskeyObject.md b/docs/models/components/SchemasPasskeyObject.md new file mode 100644 index 0000000..dba361d --- /dev/null +++ b/docs/models/components/SchemasPasskeyObject.md @@ -0,0 +1,11 @@ +# SchemasPasskeyObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| --------- | --------- | +| `PASSKEY` | passkey | \ No newline at end of file diff --git a/docs/models/components/SchemasPasskeyVerification.md b/docs/models/components/SchemasPasskeyVerification.md new file mode 100644 index 0000000..927da90 --- /dev/null +++ b/docs/models/components/SchemasPasskeyVerification.md @@ -0,0 +1,2 @@ +# SchemasPasskeyVerification + diff --git a/docs/models/components/Security.md b/docs/models/components/Security.md new file mode 100644 index 0000000..32660d9 --- /dev/null +++ b/docs/models/components/Security.md @@ -0,0 +1,8 @@ +# Security + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `bearerAuth` | *String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/Session.md b/docs/models/components/Session.md new file mode 100644 index 0000000..3d4e989 --- /dev/null +++ b/docs/models/components/Session.md @@ -0,0 +1,19 @@ +# Session + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.SessionObject](../../models/components/SessionObject.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value.
| +| `id` | *String* | :heavy_check_mark: | N/A | +| `userId` | *String* | :heavy_check_mark: | N/A | +| `clientId` | *String* | :heavy_check_mark: | N/A | +| `actor` | [JsonNullable](../../models/components/Actor.md) | :heavy_minus_sign: | N/A | +| `status` | [com.clerk.backend_api.models.components.Status](../../models/components/Status.md) | :heavy_check_mark: | N/A | +| `lastActiveOrganizationId` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `lastActiveAt` | *long* | :heavy_check_mark: | N/A | +| `expireAt` | *long* | :heavy_check_mark: | N/A | +| `abandonAt` | *long* | :heavy_check_mark: | N/A | +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| \ No newline at end of file diff --git a/docs/models/components/SessionObject.md b/docs/models/components/SessionObject.md new file mode 100644 index 0000000..ff6d435 --- /dev/null +++ b/docs/models/components/SessionObject.md @@ -0,0 +1,11 @@ +# SessionObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| --------- | --------- | +| `SESSION` | session | \ No newline at end of file diff --git a/docs/models/components/SignInToken.md b/docs/models/components/SignInToken.md new file mode 100644 index 0000000..537232f --- /dev/null +++ b/docs/models/components/SignInToken.md @@ -0,0 +1,15 @@ +# SignInToken + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.SignInTokenObject](../../models/components/SignInTokenObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `status` | [com.clerk.backend_api.models.components.SignInTokenStatus](../../models/components/SignInTokenStatus.md) | :heavy_check_mark: | N/A | +| `userId` | *String* | :heavy_check_mark: | N/A | +| `token` | *Optional* | :heavy_minus_sign: | N/A | +| `url` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/models/components/SignInTokenObject.md b/docs/models/components/SignInTokenObject.md new file mode 100644 index 0000000..51c2643 --- /dev/null +++ b/docs/models/components/SignInTokenObject.md @@ -0,0 +1,8 @@ +# SignInTokenObject + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `SIGN_IN_TOKEN` | sign_in_token | \ No newline at end of file diff --git a/docs/models/components/SignInTokenStatus.md b/docs/models/components/SignInTokenStatus.md new file mode 100644 index 0000000..d381a77 --- /dev/null +++ b/docs/models/components/SignInTokenStatus.md @@ -0,0 +1,10 @@ +# SignInTokenStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `ACCEPTED` | accepted | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/components/SignUp.md b/docs/models/components/SignUp.md new file mode 100644 index 0000000..ec3744d --- /dev/null +++ b/docs/models/components/SignUp.md @@ -0,0 +1,30 @@ +# SignUp + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.SignUpObject](../../models/components/SignUpObject.md) | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `status` | [com.clerk.backend_api.models.components.SignUpStatus](../../models/components/SignUpStatus.md) | :heavy_check_mark: | N/A | +| `requiredFields` | List<*String*> | :heavy_minus_sign: | N/A | +| `optionalFields` | List<*String*> | :heavy_minus_sign: | N/A | +| `missingFields` | List<*String*> | :heavy_minus_sign: | N/A | +| `unverifiedFields` | List<*String*> | :heavy_minus_sign: | N/A | +| `verifications` | [Optional](../../models/components/Verifications.md) | :heavy_minus_sign: | N/A | +| `username` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `emailAddress` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `phoneNumber` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `web3Wallet` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `passwordEnabled` | *boolean* | :heavy_check_mark: | N/A | +| `firstName` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `lastName` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `unsafeMetadata` | [Optional](../../models/components/SignUpUnsafeMetadata.md) | :heavy_minus_sign: | N/A | +| `publicMetadata` | [Optional](../../models/components/SignUpPublicMetadata.md) | :heavy_minus_sign: | N/A | +| `customAction` | *boolean* | :heavy_check_mark: | N/A | +| `externalId` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `createdSessionId` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `createdUserId` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `abandonAt` | *long* | :heavy_check_mark: | N/A | +| `externalAccount` | [Optional](../../models/components/ExternalAccount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/SignUpObject.md b/docs/models/components/SignUpObject.md new file mode 100644 index 0000000..15c2334 --- /dev/null +++ b/docs/models/components/SignUpObject.md @@ -0,0 +1,8 @@ +# SignUpObject + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `SIGN_UP_ATTEMPT` | sign_up_attempt | \ No newline at end of file diff --git a/docs/models/components/SignUpPublicMetadata.md b/docs/models/components/SignUpPublicMetadata.md new file mode 100644 index 0000000..7e9e611 --- /dev/null +++ b/docs/models/components/SignUpPublicMetadata.md @@ -0,0 +1,7 @@ +# SignUpPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/SignUpStatus.md b/docs/models/components/SignUpStatus.md new file mode 100644 index 0000000..17a919b --- /dev/null +++ b/docs/models/components/SignUpStatus.md @@ -0,0 +1,10 @@ +# SignUpStatus + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `MISSING_REQUIREMENTS` | missing_requirements | +| `COMPLETE` | complete | +| `ABANDONED` | abandoned | \ No newline at end of file diff --git a/docs/models/components/SignUpUnsafeMetadata.md b/docs/models/components/SignUpUnsafeMetadata.md new file mode 100644 index 0000000..8a47b7e --- /dev/null +++ b/docs/models/components/SignUpUnsafeMetadata.md @@ -0,0 +1,7 @@ +# SignUpUnsafeMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/Status.md b/docs/models/components/Status.md new file mode 100644 index 0000000..f8948a2 --- /dev/null +++ b/docs/models/components/Status.md @@ -0,0 +1,14 @@ +# Status + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ACTIVE` | active | +| `REVOKED` | revoked | +| `ENDED` | ended | +| `EXPIRED` | expired | +| `REMOVED` | removed | +| `ABANDONED` | abandoned | +| `REPLACED` | replaced | \ No newline at end of file diff --git a/docs/models/components/Strategy.md b/docs/models/components/Strategy.md new file mode 100644 index 0000000..bba7efa --- /dev/null +++ b/docs/models/components/Strategy.md @@ -0,0 +1,10 @@ +# Strategy + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `PHONE_CODE` | phone_code | +| `EMAIL_CODE` | email_code | +| `RESET_PASSWORD_EMAIL_CODE` | reset_password_email_code | \ No newline at end of file diff --git a/docs/models/components/SvixURL.md b/docs/models/components/SvixURL.md new file mode 100644 index 0000000..382a238 --- /dev/null +++ b/docs/models/components/SvixURL.md @@ -0,0 +1,8 @@ +# SvixURL + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `svixUrl` | *String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/Template.md b/docs/models/components/Template.md new file mode 100644 index 0000000..9c2a3c6 --- /dev/null +++ b/docs/models/components/Template.md @@ -0,0 +1,28 @@ +# Template + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `object` | [Optional](../../models/components/TemplateObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| +| `instanceId` | *JsonNullable* | :heavy_minus_sign: | the id of the instance the template belongs to | +| `resourceType` | *Optional* | :heavy_minus_sign: | whether this is a system (default) or user overridden) template | +| `templateType` | *Optional* | :heavy_minus_sign: | whether this is an email or SMS template | +| `name` | *Optional* | :heavy_minus_sign: | user-friendly name of the template | +| `slug` | *Optional* | :heavy_minus_sign: | machine-friendly name of the template | +| `position` | *Optional* | :heavy_minus_sign: | position with the listing of templates | +| `canRevert` | *Optional* | :heavy_minus_sign: | whether this template can be reverted to the corresponding system default | +| `canDelete` | *Optional* | :heavy_minus_sign: | whether this template can be deleted | +| `canDisable` | *Optional* | :heavy_minus_sign: | whether this template can be disabled, true only for notification SMS templates | +| `subject` | *JsonNullable* | :heavy_minus_sign: | email subject | +| `markup` | *Optional* | :heavy_minus_sign: | the editor markup used to generate the body of the template | +| `body` | *Optional* | :heavy_minus_sign: | the template body before variable interpolation | +| `availableVariables` | List<*String*> | :heavy_minus_sign: | list of variables that are available for use in the template body | +| `requiredVariables` | List<*String*> | :heavy_minus_sign: | list of variables that must be contained in the template body | +| `fromEmailName` | *Optional* | :heavy_minus_sign: | N/A | +| `replyToEmailName` | *Optional* | :heavy_minus_sign: | N/A | +| `deliveredByClerk` | *Optional* | :heavy_minus_sign: | N/A | +| `updatedAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of last update.
| +| `createdAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of creation.
| \ No newline at end of file diff --git a/docs/models/components/TemplateObject.md b/docs/models/components/TemplateObject.md new file mode 100644 index 0000000..417d2a6 --- /dev/null +++ b/docs/models/components/TemplateObject.md @@ -0,0 +1,11 @@ +# TemplateObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `TEMPLATE` | template | \ No newline at end of file diff --git a/docs/models/components/TestingToken.md b/docs/models/components/TestingToken.md new file mode 100644 index 0000000..8fc016e --- /dev/null +++ b/docs/models/components/TestingToken.md @@ -0,0 +1,10 @@ +# TestingToken + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `object` | [com.clerk.backend_api.models.components.TestingTokenObject](../../models/components/TestingTokenObject.md) | :heavy_check_mark: | N/A | | +| `token` | *String* | :heavy_check_mark: | The actual token. This value is meant to be passed in the `__clerk_testing_token` query parameter with requests to the Frontend API. | 1713877200-c_2J2MvPu9PnXcuhbPZNao0LOXqK9A7YrnBn0HmIWxy | +| `expiresAt` | *long* | :heavy_check_mark: | Unix timestamp of the token's expiration time.
| 1713880800 | \ No newline at end of file diff --git a/docs/models/components/TestingTokenObject.md b/docs/models/components/TestingTokenObject.md new file mode 100644 index 0000000..a9dd8c0 --- /dev/null +++ b/docs/models/components/TestingTokenObject.md @@ -0,0 +1,8 @@ +# TestingTokenObject + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `TESTING_TOKEN` | testing_token | \ No newline at end of file diff --git a/docs/models/components/Ticket.md b/docs/models/components/Ticket.md new file mode 100644 index 0000000..d634dd1 --- /dev/null +++ b/docs/models/components/Ticket.md @@ -0,0 +1,11 @@ +# Ticket + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.TicketVerificationStatus](../../models/components/TicketVerificationStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.TicketVerificationStrategy](../../models/components/TicketVerificationStrategy.md) | :heavy_check_mark: | N/A | +| `attempts` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `expireAt` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/TicketVerificationStatus.md b/docs/models/components/TicketVerificationStatus.md new file mode 100644 index 0000000..552fb31 --- /dev/null +++ b/docs/models/components/TicketVerificationStatus.md @@ -0,0 +1,10 @@ +# TicketVerificationStatus + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `UNVERIFIED` | unverified | +| `VERIFIED` | verified | +| `EXPIRED` | expired | \ No newline at end of file diff --git a/docs/models/components/TicketVerificationStrategy.md b/docs/models/components/TicketVerificationStrategy.md new file mode 100644 index 0000000..6287be6 --- /dev/null +++ b/docs/models/components/TicketVerificationStrategy.md @@ -0,0 +1,8 @@ +# TicketVerificationStrategy + + +## Values + +| Name | Value | +| -------- | -------- | +| `TICKET` | ticket | \ No newline at end of file diff --git a/docs/models/components/TotalCount.md b/docs/models/components/TotalCount.md new file mode 100644 index 0000000..b7ba547 --- /dev/null +++ b/docs/models/components/TotalCount.md @@ -0,0 +1,9 @@ +# TotalCount + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `object` | [com.clerk.backend_api.models.components.TotalCountObject](../../models/components/TotalCountObject.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value.
| +| `totalCount` | *long* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/TotalCountObject.md b/docs/models/components/TotalCountObject.md new file mode 100644 index 0000000..4781d70 --- /dev/null +++ b/docs/models/components/TotalCountObject.md @@ -0,0 +1,11 @@ +# TotalCountObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `TOTAL_COUNT` | total_count | \ No newline at end of file diff --git a/docs/models/components/Type.md b/docs/models/components/Type.md new file mode 100644 index 0000000..0fd535b --- /dev/null +++ b/docs/models/components/Type.md @@ -0,0 +1,10 @@ +# Type + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `OAUTH_GOOGLE` | oauth_google | +| `OAUTH_MOCK` | oauth_mock | +| `SAML` | saml | \ No newline at end of file diff --git a/docs/models/components/UnsafeMetadata.md b/docs/models/components/UnsafeMetadata.md new file mode 100644 index 0000000..cf94d10 --- /dev/null +++ b/docs/models/components/UnsafeMetadata.md @@ -0,0 +1,7 @@ +# UnsafeMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/User.md b/docs/models/components/User.md new file mode 100644 index 0000000..a8f0598 --- /dev/null +++ b/docs/models/components/User.md @@ -0,0 +1,44 @@ +# User + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | | +| `object` | [Optional](../../models/components/UserObject.md) | :heavy_minus_sign: | String representing the object's type. Objects of the same type share the same value.
| | +| `externalId` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| `primaryEmailAddressId` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| `primaryPhoneNumberId` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| `primaryWeb3WalletId` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| `username` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| `firstName` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| `lastName` | *JsonNullable* | :heavy_minus_sign: | N/A | | +| ~~`profileImageUrl`~~ | *Optional* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `imageUrl` | *Optional* | :heavy_minus_sign: | N/A | | +| `hasImage` | *Optional* | :heavy_minus_sign: | N/A | | +| `publicMetadata` | [Optional](../../models/components/PublicMetadata.md) | :heavy_minus_sign: | N/A | | +| `privateMetadata` | [JsonNullable](../../models/components/PrivateMetadata.md) | :heavy_minus_sign: | N/A | | +| `unsafeMetadata` | [Optional](../../models/components/UnsafeMetadata.md) | :heavy_minus_sign: | N/A | | +| `emailAddresses` | List<[com.clerk.backend_api.models.components.EmailAddress](../../models/components/EmailAddress.md)> | :heavy_minus_sign: | N/A | | +| `phoneNumbers` | List<[com.clerk.backend_api.models.components.PhoneNumber](../../models/components/PhoneNumber.md)> | :heavy_minus_sign: | N/A | | +| `web3Wallets` | List<[com.clerk.backend_api.models.components.Web3Wallet](../../models/components/Web3Wallet.md)> | :heavy_minus_sign: | N/A | | +| `passkeys` | List<[com.clerk.backend_api.models.components.SchemasPasskey](../../models/components/SchemasPasskey.md)> | :heavy_minus_sign: | N/A | | +| `passwordEnabled` | *Optional* | :heavy_minus_sign: | N/A | | +| `twoFactorEnabled` | *Optional* | :heavy_minus_sign: | N/A | | +| `totpEnabled` | *Optional* | :heavy_minus_sign: | N/A | | +| `backupCodeEnabled` | *Optional* | :heavy_minus_sign: | N/A | | +| `mfaEnabledAt` | *JsonNullable* | :heavy_minus_sign: | Unix timestamp of when MFA was last enabled for this user. It should be noted that this field is not nullified if MFA is disabled.
| | +| `mfaDisabledAt` | *JsonNullable* | :heavy_minus_sign: | Unix timestamp of when MFA was last disabled for this user. It should be noted that this field is not nullified if MFA is enabled again.
| | +| `externalAccounts` | List<[com.clerk.backend_api.models.components.ExternalAccounts](../../models/components/ExternalAccounts.md)> | :heavy_minus_sign: | N/A | | +| `samlAccounts` | List<[com.clerk.backend_api.models.components.SAMLAccount](../../models/components/SAMLAccount.md)> | :heavy_minus_sign: | N/A | | +| `lastSignInAt` | *JsonNullable* | :heavy_minus_sign: | Unix timestamp of last sign-in.
| | +| `banned` | *Optional* | :heavy_minus_sign: | Flag to denote whether user is banned or not.
| | +| `locked` | *Optional* | :heavy_minus_sign: | Flag to denote whether user is currently locked, i.e. restricted from signing in or not.
| | +| `lockoutExpiresInSeconds` | *JsonNullable* | :heavy_minus_sign: | The number of seconds remaining until the lockout period expires for a locked user. A null value for a locked user indicates that lockout never expires.
| | +| `verificationAttemptsRemaining` | *JsonNullable* | :heavy_minus_sign: | The number of verification attempts remaining until the user is locked. Null if account lockout is not enabled. Note: if a user is locked explicitly via the Backend API, they may still have verification attempts remaining.
| | +| `updatedAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of last update.
| | +| `createdAt` | *Optional* | :heavy_minus_sign: | Unix timestamp of creation.
| | +| `deleteSelfEnabled` | *Optional* | :heavy_minus_sign: | If enabled, user can delete themselves via FAPI.
| | +| `createOrganizationEnabled` | *Optional* | :heavy_minus_sign: | If enabled, user can create organizations via FAPI.
| | +| `lastActiveAt` | *JsonNullable* | :heavy_minus_sign: | Unix timestamp of the latest session activity, with day precision.
| 1700690400000 | \ No newline at end of file diff --git a/docs/models/components/UserObject.md b/docs/models/components/UserObject.md new file mode 100644 index 0000000..5ebea17 --- /dev/null +++ b/docs/models/components/UserObject.md @@ -0,0 +1,11 @@ +# UserObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ------ | ------ | +| `USER` | user | \ No newline at end of file diff --git a/docs/models/components/Verification.md b/docs/models/components/Verification.md new file mode 100644 index 0000000..4a007cf --- /dev/null +++ b/docs/models/components/Verification.md @@ -0,0 +1,2 @@ +# Verification + diff --git a/docs/models/components/VerificationAdmin.md b/docs/models/components/VerificationAdmin.md new file mode 100644 index 0000000..dab3f3a --- /dev/null +++ b/docs/models/components/VerificationAdmin.md @@ -0,0 +1,11 @@ +# VerificationAdmin + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.AdminVerificationPhoneNumberStatus](../../models/components/AdminVerificationPhoneNumberStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.AdminVerificationStrategy](../../models/components/AdminVerificationStrategy.md) | :heavy_check_mark: | N/A | +| `attempts` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `expireAt` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/VerificationError.md b/docs/models/components/VerificationError.md new file mode 100644 index 0000000..74af073 --- /dev/null +++ b/docs/models/components/VerificationError.md @@ -0,0 +1,2 @@ +# VerificationError + diff --git a/docs/models/components/VerificationNonce.md b/docs/models/components/VerificationNonce.md new file mode 100644 index 0000000..87cd5b9 --- /dev/null +++ b/docs/models/components/VerificationNonce.md @@ -0,0 +1,8 @@ +# VerificationNonce + + +## Values + +| Name | Value | +| ------- | ------- | +| `NONCE` | nonce | \ No newline at end of file diff --git a/docs/models/components/VerificationOTP.md b/docs/models/components/VerificationOTP.md new file mode 100644 index 0000000..4329c98 --- /dev/null +++ b/docs/models/components/VerificationOTP.md @@ -0,0 +1,11 @@ +# VerificationOTP + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.OTPVerificationStatus](../../models/components/OTPVerificationStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.OTPVerificationStrategy](../../models/components/OTPVerificationStrategy.md) | :heavy_check_mark: | N/A | +| `attempts` | *long* | :heavy_check_mark: | N/A | +| `expireAt` | *long* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/VerificationStatus.md b/docs/models/components/VerificationStatus.md new file mode 100644 index 0000000..7da7c68 --- /dev/null +++ b/docs/models/components/VerificationStatus.md @@ -0,0 +1,11 @@ +# VerificationStatus + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `UNVERIFIED` | unverified | +| `VERIFIED` | verified | +| `FAILED` | failed | +| `EXPIRED` | expired | \ No newline at end of file diff --git a/docs/models/components/VerificationStrategy.md b/docs/models/components/VerificationStrategy.md new file mode 100644 index 0000000..4cc127f --- /dev/null +++ b/docs/models/components/VerificationStrategy.md @@ -0,0 +1,8 @@ +# VerificationStrategy + + +## Values + +| Name | Value | +| ------- | ------- | +| `ADMIN` | admin | \ No newline at end of file diff --git a/docs/models/components/Verifications.md b/docs/models/components/Verifications.md new file mode 100644 index 0000000..9822e8c --- /dev/null +++ b/docs/models/components/Verifications.md @@ -0,0 +1,7 @@ +# Verifications + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/Web3Signature.md b/docs/models/components/Web3Signature.md new file mode 100644 index 0000000..6f2abcd --- /dev/null +++ b/docs/models/components/Web3Signature.md @@ -0,0 +1,12 @@ +# Web3Signature + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.Web3SignatureVerificationStatus](../../models/components/Web3SignatureVerificationStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.Web3SignatureVerificationStrategy](../../models/components/Web3SignatureVerificationStrategy.md) | :heavy_check_mark: | N/A | +| `nonce` | [com.clerk.backend_api.models.components.Nonce](../../models/components/Nonce.md) | :heavy_check_mark: | N/A | +| `attempts` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `expireAt` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/Web3SignatureVerificationStatus.md b/docs/models/components/Web3SignatureVerificationStatus.md new file mode 100644 index 0000000..357fd05 --- /dev/null +++ b/docs/models/components/Web3SignatureVerificationStatus.md @@ -0,0 +1,8 @@ +# Web3SignatureVerificationStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `VERIFIED` | verified | \ No newline at end of file diff --git a/docs/models/components/Web3SignatureVerificationStrategy.md b/docs/models/components/Web3SignatureVerificationStrategy.md new file mode 100644 index 0000000..0a4e6bd --- /dev/null +++ b/docs/models/components/Web3SignatureVerificationStrategy.md @@ -0,0 +1,8 @@ +# Web3SignatureVerificationStrategy + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `WEB3_METAMASK_SIGNATURE` | web3_metamask_signature | \ No newline at end of file diff --git a/docs/models/components/Web3Wallet.md b/docs/models/components/Web3Wallet.md new file mode 100644 index 0000000..08e8e33 --- /dev/null +++ b/docs/models/components/Web3Wallet.md @@ -0,0 +1,13 @@ +# Web3Wallet + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | N/A | +| `object` | [com.clerk.backend_api.models.components.Web3WalletObject](../../models/components/Web3WalletObject.md) | :heavy_check_mark: | String representing the object's type. Objects of the same type share the same value.
| +| `web3Wallet` | *String* | :heavy_check_mark: | N/A | +| `verification` | [Optional](../../models/components/Web3WalletVerification.md) | :heavy_check_mark: | N/A | +| `createdAt` | *long* | :heavy_check_mark: | Unix timestamp of creation
| +| `updatedAt` | *long* | :heavy_check_mark: | Unix timestamp of creation
| \ No newline at end of file diff --git a/docs/models/components/Web3WalletObject.md b/docs/models/components/Web3WalletObject.md new file mode 100644 index 0000000..e5f7458 --- /dev/null +++ b/docs/models/components/Web3WalletObject.md @@ -0,0 +1,11 @@ +# Web3WalletObject + +String representing the object's type. Objects of the same type share the same value. + + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `WEB3_WALLET` | web3_wallet | \ No newline at end of file diff --git a/docs/models/components/Web3WalletVerification.md b/docs/models/components/Web3WalletVerification.md new file mode 100644 index 0000000..02b0ab6 --- /dev/null +++ b/docs/models/components/Web3WalletVerification.md @@ -0,0 +1,2 @@ +# Web3WalletVerification + diff --git a/docs/models/components/Web3WalletVerificationAdmin.md b/docs/models/components/Web3WalletVerificationAdmin.md new file mode 100644 index 0000000..6de2aa5 --- /dev/null +++ b/docs/models/components/Web3WalletVerificationAdmin.md @@ -0,0 +1,11 @@ +# Web3WalletVerificationAdmin + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `status` | [com.clerk.backend_api.models.components.AdminVerificationWeb3WalletStatus](../../models/components/AdminVerificationWeb3WalletStatus.md) | :heavy_check_mark: | N/A | +| `strategy` | [com.clerk.backend_api.models.components.AdminVerificationWeb3WalletStrategy](../../models/components/AdminVerificationWeb3WalletStrategy.md) | :heavy_check_mark: | N/A | +| `attempts` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `expireAt` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/errors/ClerkErrors.md b/docs/models/errors/ClerkErrors.md new file mode 100644 index 0000000..ec72b41 --- /dev/null +++ b/docs/models/errors/ClerkErrors.md @@ -0,0 +1,11 @@ +# ClerkErrors + +Request was not successful + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `errors` | List<[com.clerk.backend_api.models.components.ClerkError](../../models/components/ClerkError.md)> | :heavy_check_mark: | N/A | +| `meta` | [Optional](../../models/errors/Meta.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/errors/Meta.md b/docs/models/errors/Meta.md new file mode 100644 index 0000000..93f98d6 --- /dev/null +++ b/docs/models/errors/Meta.md @@ -0,0 +1,7 @@ +# Meta + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/AddDomainRequestBody.md b/docs/models/operations/AddDomainRequestBody.md new file mode 100644 index 0000000..c8ba329 --- /dev/null +++ b/docs/models/operations/AddDomainRequestBody.md @@ -0,0 +1,10 @@ +# AddDomainRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *String* | :heavy_check_mark: | The new domain name. Can contain the port for development instances. | +| `isSatellite` | *boolean* | :heavy_check_mark: | Marks the new domain as satellite. Only `true` is accepted at the moment. | +| `proxyUrl` | *Optional* | :heavy_minus_sign: | The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. | \ No newline at end of file diff --git a/docs/models/operations/AddDomainResponse.md b/docs/models/operations/AddDomainResponse.md new file mode 100644 index 0000000..58833a8 --- /dev/null +++ b/docs/models/operations/AddDomainResponse.md @@ -0,0 +1,11 @@ +# AddDomainResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `domain` | [Optional](../../models/components/Domain.md) | :heavy_minus_sign: | A domain | \ No newline at end of file diff --git a/docs/models/operations/AttributeMapping.md b/docs/models/operations/AttributeMapping.md new file mode 100644 index 0000000..f809916 --- /dev/null +++ b/docs/models/operations/AttributeMapping.md @@ -0,0 +1,13 @@ +# AttributeMapping + +Define the attribute name mapping between Identity Provider and Clerk's user properties + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `userId` | *Optional* | :heavy_minus_sign: | N/A | +| `emailAddress` | *Optional* | :heavy_minus_sign: | N/A | +| `firstName` | *Optional* | :heavy_minus_sign: | N/A | +| `lastName` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/BanUserRequest.md b/docs/models/operations/BanUserRequest.md new file mode 100644 index 0000000..93c64b3 --- /dev/null +++ b/docs/models/operations/BanUserRequest.md @@ -0,0 +1,8 @@ +# BanUserRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to ban | \ No newline at end of file diff --git a/docs/models/operations/BanUserResponse.md b/docs/models/operations/BanUserResponse.md new file mode 100644 index 0000000..d5f3289 --- /dev/null +++ b/docs/models/operations/BanUserResponse.md @@ -0,0 +1,11 @@ +# BanUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/ChangeProductionInstanceDomainRequestBody.md b/docs/models/operations/ChangeProductionInstanceDomainRequestBody.md new file mode 100644 index 0000000..da4d960 --- /dev/null +++ b/docs/models/operations/ChangeProductionInstanceDomainRequestBody.md @@ -0,0 +1,8 @@ +# ChangeProductionInstanceDomainRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `homeUrl` | *Optional* | :heavy_minus_sign: | The new home URL of the production instance e.g. https://www.example.com | \ No newline at end of file diff --git a/docs/models/operations/ChangeProductionInstanceDomainResponse.md b/docs/models/operations/ChangeProductionInstanceDomainResponse.md new file mode 100644 index 0000000..a31bccf --- /dev/null +++ b/docs/models/operations/ChangeProductionInstanceDomainResponse.md @@ -0,0 +1,10 @@ +# ChangeProductionInstanceDomainResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/Claims.md b/docs/models/operations/Claims.md new file mode 100644 index 0000000..55d4696 --- /dev/null +++ b/docs/models/operations/Claims.md @@ -0,0 +1,9 @@ +# Claims + +JWT template claims in JSON format + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/CodeType.md b/docs/models/operations/CodeType.md new file mode 100644 index 0000000..e3d81ce --- /dev/null +++ b/docs/models/operations/CodeType.md @@ -0,0 +1,9 @@ +# CodeType + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `TOTP` | totp | +| `BACKUP_CODE` | backup_code | \ No newline at end of file diff --git a/docs/models/operations/CreateActorTokenRequestBody.md b/docs/models/operations/CreateActorTokenRequestBody.md new file mode 100644 index 0000000..2a6e7cb --- /dev/null +++ b/docs/models/operations/CreateActorTokenRequestBody.md @@ -0,0 +1,11 @@ +# CreateActorTokenRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user that can use the newly created sign in token. | | +| `actor` | Map | :heavy_check_mark: | The actor payload. It needs to include a sub property which should contain the ID of the actor.
This whole payload will be also included in the JWT session token. | {
"sub": "user_2OEpKhcCN1Lat9NQ0G6puh7q5Rb"
} | +| `expiresInSeconds` | *Optional* | :heavy_minus_sign: | Optional parameter to specify the life duration of the actor token in seconds.
By default, the duration is 1 hour. | | +| `sessionMaxDurationInSeconds` | *Optional* | :heavy_minus_sign: | The maximum duration that the session which will be created by the generated actor token should last.
By default, the duration of a session created via an actor token, lasts 30 minutes. | | \ No newline at end of file diff --git a/docs/models/operations/CreateActorTokenResponse.md b/docs/models/operations/CreateActorTokenResponse.md new file mode 100644 index 0000000..61e153a --- /dev/null +++ b/docs/models/operations/CreateActorTokenResponse.md @@ -0,0 +1,11 @@ +# CreateActorTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `actorToken` | [Optional](../../models/components/ActorToken.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateAllowlistIdentifierRequestBody.md b/docs/models/operations/CreateAllowlistIdentifierRequestBody.md new file mode 100644 index 0000000..dad20a9 --- /dev/null +++ b/docs/models/operations/CreateAllowlistIdentifierRequestBody.md @@ -0,0 +1,9 @@ +# CreateAllowlistIdentifierRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `identifier` | *String* | :heavy_check_mark: | The identifier to be added in the allow-list.
This can be an email address, a phone number or a web3 wallet. | +| `notify_` | *Optional* | :heavy_minus_sign: | This flag denotes whether the given identifier will receive an invitation to join the application.
Note that this only works for email address and phone number identifiers. | \ No newline at end of file diff --git a/docs/models/operations/CreateAllowlistIdentifierResponse.md b/docs/models/operations/CreateAllowlistIdentifierResponse.md new file mode 100644 index 0000000..a1b3f19 --- /dev/null +++ b/docs/models/operations/CreateAllowlistIdentifierResponse.md @@ -0,0 +1,11 @@ +# CreateAllowlistIdentifierResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `allowlistIdentifier` | [Optional](../../models/components/AllowlistIdentifier.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateBlocklistIdentifierRequestBody.md b/docs/models/operations/CreateBlocklistIdentifierRequestBody.md new file mode 100644 index 0000000..0e32125 --- /dev/null +++ b/docs/models/operations/CreateBlocklistIdentifierRequestBody.md @@ -0,0 +1,8 @@ +# CreateBlocklistIdentifierRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `identifier` | *String* | :heavy_check_mark: | The identifier to be added in the block-list.
This can be an email address, a phone number or a web3 wallet. | \ No newline at end of file diff --git a/docs/models/operations/CreateBlocklistIdentifierResponse.md b/docs/models/operations/CreateBlocklistIdentifierResponse.md new file mode 100644 index 0000000..b6f14b6 --- /dev/null +++ b/docs/models/operations/CreateBlocklistIdentifierResponse.md @@ -0,0 +1,11 @@ +# CreateBlocklistIdentifierResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `blocklistIdentifier` | [Optional](../../models/components/BlocklistIdentifier.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateEmailAddressRequestBody.md b/docs/models/operations/CreateEmailAddressRequestBody.md new file mode 100644 index 0000000..5d32bba --- /dev/null +++ b/docs/models/operations/CreateEmailAddressRequestBody.md @@ -0,0 +1,11 @@ +# CreateEmailAddressRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *Optional* | :heavy_minus_sign: | The ID representing the user | +| `emailAddress` | *Optional* | :heavy_minus_sign: | The new email address. Must adhere to the RFC 5322 specification for email address format. | +| `verified` | *JsonNullable* | :heavy_minus_sign: | When created, the email address will be marked as verified. | +| `primary` | *JsonNullable* | :heavy_minus_sign: | Create this email address as the primary email address for the user.
Default: false, unless it is the first email address. | \ No newline at end of file diff --git a/docs/models/operations/CreateEmailAddressResponse.md b/docs/models/operations/CreateEmailAddressResponse.md new file mode 100644 index 0000000..581622f --- /dev/null +++ b/docs/models/operations/CreateEmailAddressResponse.md @@ -0,0 +1,11 @@ +# CreateEmailAddressResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `emailAddress` | [Optional](../../models/components/EmailAddress.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateInvitationPublicMetadata.md b/docs/models/operations/CreateInvitationPublicMetadata.md new file mode 100644 index 0000000..0ae2ee3 --- /dev/null +++ b/docs/models/operations/CreateInvitationPublicMetadata.md @@ -0,0 +1,11 @@ +# CreateInvitationPublicMetadata + +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. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/CreateInvitationRequestBody.md b/docs/models/operations/CreateInvitationRequestBody.md new file mode 100644 index 0000000..07bf90e --- /dev/null +++ b/docs/models/operations/CreateInvitationRequestBody.md @@ -0,0 +1,14 @@ +# CreateInvitationRequestBody + +Required parameters + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `emailAddress` | *String* | :heavy_check_mark: | The email address the invitation will be sent to | +| `publicMetadata` | [Optional](../../models/operations/CreateInvitationPublicMetadata.md) | :heavy_minus_sign: | Metadata that will be attached to the newly created invitation.
The value of this property should be a well-formed JSON object.
Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. | +| `redirectUrl` | *Optional* | :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. | +| `notify_` | *JsonNullable* | :heavy_minus_sign: | Optional flag which denotes whether an email invitation should be sent to the given email address.
Defaults to true. | +| `ignoreExisting` | *JsonNullable* | :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. | \ No newline at end of file diff --git a/docs/models/operations/CreateInvitationResponse.md b/docs/models/operations/CreateInvitationResponse.md new file mode 100644 index 0000000..ff0b44a --- /dev/null +++ b/docs/models/operations/CreateInvitationResponse.md @@ -0,0 +1,11 @@ +# CreateInvitationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `invitation` | [Optional](../../models/components/Invitation.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateJWTTemplateRequestBody.md b/docs/models/operations/CreateJWTTemplateRequestBody.md new file mode 100644 index 0000000..9e14cdc --- /dev/null +++ b/docs/models/operations/CreateJWTTemplateRequestBody.md @@ -0,0 +1,14 @@ +# CreateJWTTemplateRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `name` | *Optional* | :heavy_minus_sign: | JWT template name | +| `claims` | [Optional](../../models/operations/Claims.md) | :heavy_minus_sign: | JWT template claims in JSON format | +| `lifetime` | *JsonNullable* | :heavy_minus_sign: | JWT token lifetime | +| `allowedClockSkew` | *JsonNullable* | :heavy_minus_sign: | JWT token allowed clock skew | +| `customSigningKey` | *Optional* | :heavy_minus_sign: | Whether a custom signing key/algorithm is also provided for this template | +| `signingAlgorithm` | *JsonNullable* | :heavy_minus_sign: | The custom signing algorithm to use when minting JWTs | +| `signingKey` | *JsonNullable* | :heavy_minus_sign: | The custom signing private key to use when minting JWTs | \ No newline at end of file diff --git a/docs/models/operations/CreateJWTTemplateResponse.md b/docs/models/operations/CreateJWTTemplateResponse.md new file mode 100644 index 0000000..3d9366c --- /dev/null +++ b/docs/models/operations/CreateJWTTemplateResponse.md @@ -0,0 +1,11 @@ +# CreateJWTTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `jwtTemplate` | [Optional](../../models/components/JWTTemplate.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateOAuthApplicationRequestBody.md b/docs/models/operations/CreateOAuthApplicationRequestBody.md new file mode 100644 index 0000000..4086744 --- /dev/null +++ b/docs/models/operations/CreateOAuthApplicationRequestBody.md @@ -0,0 +1,11 @@ +# CreateOAuthApplicationRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *String* | :heavy_check_mark: | The name of the new OAuth application | | +| `callbackUrl` | *String* | :heavy_check_mark: | The callback URL of the new OAuth application | | +| `scopes` | *Optional* | :heavy_minus_sign: | Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. | profile email public_metadata | +| `public_` | *Optional* | :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. | | \ No newline at end of file diff --git a/docs/models/operations/CreateOAuthApplicationResponse.md b/docs/models/operations/CreateOAuthApplicationResponse.md new file mode 100644 index 0000000..6470b12 --- /dev/null +++ b/docs/models/operations/CreateOAuthApplicationResponse.md @@ -0,0 +1,11 @@ +# CreateOAuthApplicationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `oAuthApplicationWithSecret` | [Optional](../../models/components/OAuthApplicationWithSecret.md) | :heavy_minus_sign: | An OAuth application with client secret | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationBulkPrivateMetadata.md b/docs/models/operations/CreateOrganizationInvitationBulkPrivateMetadata.md new file mode 100644 index 0000000..36a117b --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationBulkPrivateMetadata.md @@ -0,0 +1,9 @@ +# CreateOrganizationInvitationBulkPrivateMetadata + +Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationBulkPublicMetadata.md b/docs/models/operations/CreateOrganizationInvitationBulkPublicMetadata.md new file mode 100644 index 0000000..6b0de6e --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationBulkPublicMetadata.md @@ -0,0 +1,9 @@ +# CreateOrganizationInvitationBulkPublicMetadata + +Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationBulkRequest.md b/docs/models/operations/CreateOrganizationInvitationBulkRequest.md new file mode 100644 index 0000000..1f0a3ef --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationBulkRequest.md @@ -0,0 +1,9 @@ +# CreateOrganizationInvitationBulkRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `requestBody` | List<[com.clerk.backend_api.models.operations.RequestBody](../../models/operations/RequestBody.md)> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationBulkResponse.md b/docs/models/operations/CreateOrganizationInvitationBulkResponse.md new file mode 100644 index 0000000..3bfa8e6 --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationBulkResponse.md @@ -0,0 +1,11 @@ +# CreateOrganizationInvitationBulkResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationInvitations` | [Optional](../../models/components/OrganizationInvitations.md) | :heavy_minus_sign: | A list of organization invitations | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationPrivateMetadata.md b/docs/models/operations/CreateOrganizationInvitationPrivateMetadata.md new file mode 100644 index 0000000..cb30466 --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationPrivateMetadata.md @@ -0,0 +1,9 @@ +# CreateOrganizationInvitationPrivateMetadata + +Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationPublicMetadata.md b/docs/models/operations/CreateOrganizationInvitationPublicMetadata.md new file mode 100644 index 0000000..59477dd --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationPublicMetadata.md @@ -0,0 +1,9 @@ +# CreateOrganizationInvitationPublicMetadata + +Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationRequest.md b/docs/models/operations/CreateOrganizationInvitationRequest.md new file mode 100644 index 0000000..59e3d10 --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationRequest.md @@ -0,0 +1,9 @@ +# CreateOrganizationInvitationRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization for which to send the invitation | +| `requestBody` | [com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequestBody](../../models/operations/CreateOrganizationInvitationRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationRequestBody.md b/docs/models/operations/CreateOrganizationInvitationRequestBody.md new file mode 100644 index 0000000..7e35283 --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationRequestBody.md @@ -0,0 +1,13 @@ +# CreateOrganizationInvitationRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `emailAddress` | *String* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | +| `inviterUserId` | *String* | :heavy_check_mark: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | +| `role` | *String* | :heavy_check_mark: | The role of the new member in the organization | +| `publicMetadata` | [Optional](../../models/operations/CreateOrganizationInvitationPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. | +| `privateMetadata` | [Optional](../../models/operations/CreateOrganizationInvitationPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. | +| `redirectUrl` | *Optional* | :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. | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationInvitationResponse.md b/docs/models/operations/CreateOrganizationInvitationResponse.md new file mode 100644 index 0000000..8b6f9fb --- /dev/null +++ b/docs/models/operations/CreateOrganizationInvitationResponse.md @@ -0,0 +1,11 @@ +# CreateOrganizationInvitationResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationInvitation` | [Optional](../../models/components/OrganizationInvitation.md) | :heavy_minus_sign: | An organization invitation | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationMembershipRequest.md b/docs/models/operations/CreateOrganizationMembershipRequest.md new file mode 100644 index 0000000..8d27eba --- /dev/null +++ b/docs/models/operations/CreateOrganizationMembershipRequest.md @@ -0,0 +1,9 @@ +# CreateOrganizationMembershipRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization where the new membership will be created | +| `requestBody` | [com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequestBody](../../models/operations/CreateOrganizationMembershipRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationMembershipRequestBody.md b/docs/models/operations/CreateOrganizationMembershipRequestBody.md new file mode 100644 index 0000000..b3accd5 --- /dev/null +++ b/docs/models/operations/CreateOrganizationMembershipRequestBody.md @@ -0,0 +1,9 @@ +# CreateOrganizationMembershipRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user that will be added as a member in the organization.
The user needs to exist in the same instance as the organization and must not be a member of the given organization already. | +| `role` | *String* | :heavy_check_mark: | The role that the new member will have in the organization. | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationMembershipResponse.md b/docs/models/operations/CreateOrganizationMembershipResponse.md new file mode 100644 index 0000000..e2d08cc --- /dev/null +++ b/docs/models/operations/CreateOrganizationMembershipResponse.md @@ -0,0 +1,11 @@ +# CreateOrganizationMembershipResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationMembership` | [Optional](../../models/components/OrganizationMembership.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationPrivateMetadata.md b/docs/models/operations/CreateOrganizationPrivateMetadata.md new file mode 100644 index 0000000..f2f829a --- /dev/null +++ b/docs/models/operations/CreateOrganizationPrivateMetadata.md @@ -0,0 +1,9 @@ +# CreateOrganizationPrivateMetadata + +Metadata saved on the organization, accessible only from the Backend API + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationPublicMetadata.md b/docs/models/operations/CreateOrganizationPublicMetadata.md new file mode 100644 index 0000000..b80d04c --- /dev/null +++ b/docs/models/operations/CreateOrganizationPublicMetadata.md @@ -0,0 +1,9 @@ +# CreateOrganizationPublicMetadata + +Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationRequestBody.md b/docs/models/operations/CreateOrganizationRequestBody.md new file mode 100644 index 0000000..0373d23 --- /dev/null +++ b/docs/models/operations/CreateOrganizationRequestBody.md @@ -0,0 +1,13 @@ +# CreateOrganizationRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *String* | :heavy_check_mark: | The name of the new organization | +| `createdBy` | *String* | :heavy_check_mark: | The ID of the User who will become the administrator for the new organization | +| `privateMetadata` | [Optional](../../models/operations/CreateOrganizationPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, accessible only from the Backend API | +| `publicMetadata` | [Optional](../../models/operations/CreateOrganizationPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API | +| `slug` | *Optional* | :heavy_minus_sign: | A slug for the new organization.
Can contain only lowercase alphanumeric characters and the dash "-".
Must be unique for the instance. | +| `maxAllowedMemberships` | *Optional* | :heavy_minus_sign: | The maximum number of memberships allowed for this organization | \ No newline at end of file diff --git a/docs/models/operations/CreateOrganizationResponse.md b/docs/models/operations/CreateOrganizationResponse.md new file mode 100644 index 0000000..84c9498 --- /dev/null +++ b/docs/models/operations/CreateOrganizationResponse.md @@ -0,0 +1,11 @@ +# CreateOrganizationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organization` | [Optional](../../models/components/Organization.md) | :heavy_minus_sign: | An organization | \ No newline at end of file diff --git a/docs/models/operations/CreatePhoneNumberRequestBody.md b/docs/models/operations/CreatePhoneNumberRequestBody.md new file mode 100644 index 0000000..beea2c2 --- /dev/null +++ b/docs/models/operations/CreatePhoneNumberRequestBody.md @@ -0,0 +1,12 @@ +# CreatePhoneNumberRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *Optional* | :heavy_minus_sign: | The ID representing the user | +| `phoneNumber` | *Optional* | :heavy_minus_sign: | The new phone number. Must adhere to the E.164 standard for phone number format. | +| `verified` | *JsonNullable* | :heavy_minus_sign: | When created, the phone number will be marked as verified. | +| `primary` | *JsonNullable* | :heavy_minus_sign: | Create this phone number as the primary phone number for the user.
Default: false, unless it is the first phone number. | +| `reservedForSecondFactor` | *JsonNullable* | :heavy_minus_sign: | Create this phone number as reserved for multi-factor authentication.
The phone number must also be verified.
If there are no other reserved second factors, the phone number will be set as the default second factor. | \ No newline at end of file diff --git a/docs/models/operations/CreatePhoneNumberResponse.md b/docs/models/operations/CreatePhoneNumberResponse.md new file mode 100644 index 0000000..df2862b --- /dev/null +++ b/docs/models/operations/CreatePhoneNumberResponse.md @@ -0,0 +1,11 @@ +# CreatePhoneNumberResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `phoneNumber` | [Optional](../../models/components/PhoneNumber.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateRedirectURLRequestBody.md b/docs/models/operations/CreateRedirectURLRequestBody.md new file mode 100644 index 0000000..f318418 --- /dev/null +++ b/docs/models/operations/CreateRedirectURLRequestBody.md @@ -0,0 +1,8 @@ +# CreateRedirectURLRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `url` | *Optional* | :heavy_minus_sign: | The full url value prefixed with `https://` or a custom scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"` | \ No newline at end of file diff --git a/docs/models/operations/CreateRedirectURLResponse.md b/docs/models/operations/CreateRedirectURLResponse.md new file mode 100644 index 0000000..9b771d8 --- /dev/null +++ b/docs/models/operations/CreateRedirectURLResponse.md @@ -0,0 +1,11 @@ +# CreateRedirectURLResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `redirectURL` | [Optional](../../models/components/RedirectURL.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateSAMLConnectionRequestBody.md b/docs/models/operations/CreateSAMLConnectionRequestBody.md new file mode 100644 index 0000000..ee0c77f --- /dev/null +++ b/docs/models/operations/CreateSAMLConnectionRequestBody.md @@ -0,0 +1,16 @@ +# CreateSAMLConnectionRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *String* | :heavy_check_mark: | The name to use as a label for this SAML Connection | +| `domain` | *String* | :heavy_check_mark: | The domain of your organization. Sign in flows using an email with this domain, will use this SAML Connection. | +| `provider` | [com.clerk.backend_api.models.operations.Provider](../../models/operations/Provider.md) | :heavy_check_mark: | The IdP provider of the connection. | +| `idpEntityId` | *JsonNullable* | :heavy_minus_sign: | The Entity ID as provided by the IdP | +| `idpSsoUrl` | *JsonNullable* | :heavy_minus_sign: | The Single-Sign On URL as provided by the IdP | +| `idpCertificate` | *JsonNullable* | :heavy_minus_sign: | The X.509 certificate as provided by the IdP | +| `idpMetadataUrl` | *JsonNullable* | :heavy_minus_sign: | The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties | +| `idpMetadata` | *JsonNullable* | :heavy_minus_sign: | The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties | +| `attributeMapping` | [JsonNullable](../../models/operations/AttributeMapping.md) | :heavy_minus_sign: | Define the attribute name mapping between Identity Provider and Clerk's user properties | \ No newline at end of file diff --git a/docs/models/operations/CreateSAMLConnectionResponse.md b/docs/models/operations/CreateSAMLConnectionResponse.md new file mode 100644 index 0000000..b2ee68f --- /dev/null +++ b/docs/models/operations/CreateSAMLConnectionResponse.md @@ -0,0 +1,11 @@ +# CreateSAMLConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `samlConnection` | [Optional](../../models/components/SAMLConnection.md) | :heavy_minus_sign: | A SAML Connection | \ No newline at end of file diff --git a/docs/models/operations/CreateSessionTokenFromTemplateRequest.md b/docs/models/operations/CreateSessionTokenFromTemplateRequest.md new file mode 100644 index 0000000..4a97126 --- /dev/null +++ b/docs/models/operations/CreateSessionTokenFromTemplateRequest.md @@ -0,0 +1,9 @@ +# CreateSessionTokenFromTemplateRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `sessionId` | *String* | :heavy_check_mark: | The ID of the session | +| `templateName` | *String* | :heavy_check_mark: | The name of the JWT Template defined in your instance (e.g. `custom_hasura`). | \ No newline at end of file diff --git a/docs/models/operations/CreateSessionTokenFromTemplateResponse.md b/docs/models/operations/CreateSessionTokenFromTemplateResponse.md new file mode 100644 index 0000000..aec48b3 --- /dev/null +++ b/docs/models/operations/CreateSessionTokenFromTemplateResponse.md @@ -0,0 +1,11 @@ +# CreateSessionTokenFromTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional](../../models/operations/CreateSessionTokenFromTemplateResponseBody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/CreateSessionTokenFromTemplateResponseBody.md b/docs/models/operations/CreateSessionTokenFromTemplateResponseBody.md new file mode 100644 index 0000000..620952f --- /dev/null +++ b/docs/models/operations/CreateSessionTokenFromTemplateResponseBody.md @@ -0,0 +1,11 @@ +# CreateSessionTokenFromTemplateResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `object` | [Optional](../../models/operations/Object.md) | :heavy_minus_sign: | N/A | +| `jwt` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/CreateSignInTokenRequestBody.md b/docs/models/operations/CreateSignInTokenRequestBody.md new file mode 100644 index 0000000..4639d10 --- /dev/null +++ b/docs/models/operations/CreateSignInTokenRequestBody.md @@ -0,0 +1,9 @@ +# CreateSignInTokenRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `userId` | *Optional* | :heavy_minus_sign: | The ID of the user that can use the newly created sign in token | +| `expiresInSeconds` | *Optional* | :heavy_minus_sign: | Optional parameter to specify the life duration of the sign in token in seconds.
By default, the duration is 30 days. | \ No newline at end of file diff --git a/docs/models/operations/CreateSignInTokenResponse.md b/docs/models/operations/CreateSignInTokenResponse.md new file mode 100644 index 0000000..2cbc428 --- /dev/null +++ b/docs/models/operations/CreateSignInTokenResponse.md @@ -0,0 +1,11 @@ +# CreateSignInTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `signInToken` | [Optional](../../models/components/SignInToken.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/CreateSvixAppResponse.md b/docs/models/operations/CreateSvixAppResponse.md new file mode 100644 index 0000000..1b63e3e --- /dev/null +++ b/docs/models/operations/CreateSvixAppResponse.md @@ -0,0 +1,11 @@ +# CreateSvixAppResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `svixURL` | [Optional](../../models/components/SvixURL.md) | :heavy_minus_sign: | Response that contains a temporary Svix URL to access management dashboard | \ No newline at end of file diff --git a/docs/models/operations/CreateTestingTokenResponse.md b/docs/models/operations/CreateTestingTokenResponse.md new file mode 100644 index 0000000..246ba0f --- /dev/null +++ b/docs/models/operations/CreateTestingTokenResponse.md @@ -0,0 +1,11 @@ +# CreateTestingTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `testingToken` | [Optional](../../models/components/TestingToken.md) | :heavy_minus_sign: | A Testing Token | \ No newline at end of file diff --git a/docs/models/operations/CreateUserRequestBody.md b/docs/models/operations/CreateUserRequestBody.md new file mode 100644 index 0000000..ca2617c --- /dev/null +++ b/docs/models/operations/CreateUserRequestBody.md @@ -0,0 +1,25 @@ +# CreateUserRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `externalId` | *JsonNullable* | :heavy_minus_sign: | The ID of the user as used in your external systems or your previous authentication solution.
Must be unique across your instance. | +| `firstName` | *JsonNullable* | :heavy_minus_sign: | The first name to assign to the user | +| `lastName` | *JsonNullable* | :heavy_minus_sign: | The last name to assign to the user | +| `emailAddress` | List<*String*> | :heavy_minus_sign: | Email addresses to add to the user.
Must be unique across your instance.
The first email address will be set as the user's primary email address. | +| `phoneNumber` | List<*String*> | :heavy_minus_sign: | Phone numbers to add to the user.
Must be unique across your instance.
The first phone number will be set as the user's primary phone number. | +| `web3Wallet` | List<*String*> | :heavy_minus_sign: | Web3 wallets to add to the user.
Must be unique across your instance.
The first wallet will be set as the user's primary wallet. | +| `username` | *JsonNullable* | :heavy_minus_sign: | The username to give to the user.
It must be unique across your instance. | +| `password` | *JsonNullable* | :heavy_minus_sign: | The plaintext password to give the user.
Must be at least 8 characters long, and can not be in any list of hacked passwords. | +| `passwordDigest` | *Optional* | :heavy_minus_sign: | In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.
The digests should be generated with one of the supported algorithms.
The hashing algorithm can be specified using the `password_hasher` property. | +| `passwordHasher` | [Optional](../../models/operations/PasswordHasher.md) | :heavy_minus_sign: | The hashing algorithm that was used to generate the password digest.
The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/),
[phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/),
[scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2)
and the [argon2](https://argon2.online/) variants argon2i and argon2id.

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

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

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

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

`$$$`

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

`bcrypt_sha256$$$$`

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

`5f4dcc3b5aa765d61d8327deb882cf99`

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

`pbkdf2_sha256$$$`

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

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

`pbkdf2_sha512$$$`

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

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

`pbkdf2_sha256$$$`

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

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

The format is the following:

`pbkdf2_sha1$$$`

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

The format is the following:

`$P$`

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

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

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

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

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

`$$$$$`

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

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

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

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

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

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

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

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

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

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

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

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

`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08`

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

The format is the following:
`$`

The value is expected to have 2 segments separated by the $ character and include the following information:
_hash:_ The sha256 hash, a 64-length hex string.
_salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. | +| `skipPasswordChecks` | *Optional* | :heavy_minus_sign: | When set to `true` all password checks are skipped.
It is recommended to use this method only when migrating plaintext passwords to Clerk.
Upon migration the user base should be prompted to pick stronger password. | +| `skipPasswordRequirement` | *Optional* | :heavy_minus_sign: | When set to `true`, `password` is not required anymore when creating the user and can be omitted.
This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords.
Please note that you cannot use this flag if password is the only way for a user to sign into your instance. | +| `totpSecret` | *Optional* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | +| `backupCodes` | List<*String*> | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | +| `publicMetadata` | [Optional](../../models/operations/PublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | +| `privateMetadata` | [Optional](../../models/operations/PrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | +| `unsafeMetadata` | [Optional](../../models/operations/UnsafeMetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | +| `createdAt` | *Optional* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | \ No newline at end of file diff --git a/docs/models/operations/CreateUserResponse.md b/docs/models/operations/CreateUserResponse.md new file mode 100644 index 0000000..69f963b --- /dev/null +++ b/docs/models/operations/CreateUserResponse.md @@ -0,0 +1,11 @@ +# CreateUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/DeleteAllowlistIdentifierRequest.md b/docs/models/operations/DeleteAllowlistIdentifierRequest.md new file mode 100644 index 0000000..72d54c1 --- /dev/null +++ b/docs/models/operations/DeleteAllowlistIdentifierRequest.md @@ -0,0 +1,8 @@ +# DeleteAllowlistIdentifierRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `identifierId` | *String* | :heavy_check_mark: | The ID of the identifier to delete from the allow-list | \ No newline at end of file diff --git a/docs/models/operations/DeleteAllowlistIdentifierResponse.md b/docs/models/operations/DeleteAllowlistIdentifierResponse.md new file mode 100644 index 0000000..8f66574 --- /dev/null +++ b/docs/models/operations/DeleteAllowlistIdentifierResponse.md @@ -0,0 +1,11 @@ +# DeleteAllowlistIdentifierResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteBlocklistIdentifierRequest.md b/docs/models/operations/DeleteBlocklistIdentifierRequest.md new file mode 100644 index 0000000..75be4c4 --- /dev/null +++ b/docs/models/operations/DeleteBlocklistIdentifierRequest.md @@ -0,0 +1,8 @@ +# DeleteBlocklistIdentifierRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `identifierId` | *String* | :heavy_check_mark: | The ID of the identifier to delete from the block-list | \ No newline at end of file diff --git a/docs/models/operations/DeleteBlocklistIdentifierResponse.md b/docs/models/operations/DeleteBlocklistIdentifierResponse.md new file mode 100644 index 0000000..2d2a858 --- /dev/null +++ b/docs/models/operations/DeleteBlocklistIdentifierResponse.md @@ -0,0 +1,11 @@ +# DeleteBlocklistIdentifierResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteDomainRequest.md b/docs/models/operations/DeleteDomainRequest.md new file mode 100644 index 0000000..3214099 --- /dev/null +++ b/docs/models/operations/DeleteDomainRequest.md @@ -0,0 +1,8 @@ +# DeleteDomainRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `domainId` | *String* | :heavy_check_mark: | The ID of the domain that will be deleted. Must be a satellite domain. | \ No newline at end of file diff --git a/docs/models/operations/DeleteDomainResponse.md b/docs/models/operations/DeleteDomainResponse.md new file mode 100644 index 0000000..45f963e --- /dev/null +++ b/docs/models/operations/DeleteDomainResponse.md @@ -0,0 +1,11 @@ +# DeleteDomainResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteEmailAddressRequest.md b/docs/models/operations/DeleteEmailAddressRequest.md new file mode 100644 index 0000000..bffa982 --- /dev/null +++ b/docs/models/operations/DeleteEmailAddressRequest.md @@ -0,0 +1,8 @@ +# DeleteEmailAddressRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `emailAddressId` | *String* | :heavy_check_mark: | The ID of the email address to delete | \ No newline at end of file diff --git a/docs/models/operations/DeleteEmailAddressResponse.md b/docs/models/operations/DeleteEmailAddressResponse.md new file mode 100644 index 0000000..e0d6fff --- /dev/null +++ b/docs/models/operations/DeleteEmailAddressResponse.md @@ -0,0 +1,11 @@ +# DeleteEmailAddressResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteJWTTemplateRequest.md b/docs/models/operations/DeleteJWTTemplateRequest.md new file mode 100644 index 0000000..5093641 --- /dev/null +++ b/docs/models/operations/DeleteJWTTemplateRequest.md @@ -0,0 +1,8 @@ +# DeleteJWTTemplateRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `templateId` | *String* | :heavy_check_mark: | JWT Template ID | \ No newline at end of file diff --git a/docs/models/operations/DeleteJWTTemplateResponse.md b/docs/models/operations/DeleteJWTTemplateResponse.md new file mode 100644 index 0000000..a6644fd --- /dev/null +++ b/docs/models/operations/DeleteJWTTemplateResponse.md @@ -0,0 +1,11 @@ +# DeleteJWTTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteOAuthApplicationRequest.md b/docs/models/operations/DeleteOAuthApplicationRequest.md new file mode 100644 index 0000000..785588c --- /dev/null +++ b/docs/models/operations/DeleteOAuthApplicationRequest.md @@ -0,0 +1,8 @@ +# DeleteOAuthApplicationRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `oauthApplicationId` | *String* | :heavy_check_mark: | The ID of the OAuth application to delete | \ No newline at end of file diff --git a/docs/models/operations/DeleteOAuthApplicationResponse.md b/docs/models/operations/DeleteOAuthApplicationResponse.md new file mode 100644 index 0000000..371d244 --- /dev/null +++ b/docs/models/operations/DeleteOAuthApplicationResponse.md @@ -0,0 +1,11 @@ +# DeleteOAuthApplicationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteOrganizationLogoRequest.md b/docs/models/operations/DeleteOrganizationLogoRequest.md new file mode 100644 index 0000000..bf2ec71 --- /dev/null +++ b/docs/models/operations/DeleteOrganizationLogoRequest.md @@ -0,0 +1,8 @@ +# DeleteOrganizationLogoRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization for which the logo will be deleted. | \ No newline at end of file diff --git a/docs/models/operations/DeleteOrganizationLogoResponse.md b/docs/models/operations/DeleteOrganizationLogoResponse.md new file mode 100644 index 0000000..78a574a --- /dev/null +++ b/docs/models/operations/DeleteOrganizationLogoResponse.md @@ -0,0 +1,11 @@ +# DeleteOrganizationLogoResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organization` | [Optional](../../models/components/Organization.md) | :heavy_minus_sign: | An organization | \ No newline at end of file diff --git a/docs/models/operations/DeleteOrganizationMembershipRequest.md b/docs/models/operations/DeleteOrganizationMembershipRequest.md new file mode 100644 index 0000000..3b91c1c --- /dev/null +++ b/docs/models/operations/DeleteOrganizationMembershipRequest.md @@ -0,0 +1,9 @@ +# DeleteOrganizationMembershipRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization the membership belongs to | +| `userId` | *String* | :heavy_check_mark: | The ID of the user that this membership belongs to | \ No newline at end of file diff --git a/docs/models/operations/DeleteOrganizationMembershipResponse.md b/docs/models/operations/DeleteOrganizationMembershipResponse.md new file mode 100644 index 0000000..8403169 --- /dev/null +++ b/docs/models/operations/DeleteOrganizationMembershipResponse.md @@ -0,0 +1,11 @@ +# DeleteOrganizationMembershipResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationMembership` | [Optional](../../models/components/OrganizationMembership.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/DeleteOrganizationRequest.md b/docs/models/operations/DeleteOrganizationRequest.md new file mode 100644 index 0000000..23d20e0 --- /dev/null +++ b/docs/models/operations/DeleteOrganizationRequest.md @@ -0,0 +1,8 @@ +# DeleteOrganizationRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization to delete | \ No newline at end of file diff --git a/docs/models/operations/DeleteOrganizationResponse.md b/docs/models/operations/DeleteOrganizationResponse.md new file mode 100644 index 0000000..92c15cb --- /dev/null +++ b/docs/models/operations/DeleteOrganizationResponse.md @@ -0,0 +1,11 @@ +# DeleteOrganizationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeletePhoneNumberRequest.md b/docs/models/operations/DeletePhoneNumberRequest.md new file mode 100644 index 0000000..5bb1d49 --- /dev/null +++ b/docs/models/operations/DeletePhoneNumberRequest.md @@ -0,0 +1,8 @@ +# DeletePhoneNumberRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `phoneNumberId` | *String* | :heavy_check_mark: | The ID of the phone number to delete | \ No newline at end of file diff --git a/docs/models/operations/DeletePhoneNumberResponse.md b/docs/models/operations/DeletePhoneNumberResponse.md new file mode 100644 index 0000000..85b58b2 --- /dev/null +++ b/docs/models/operations/DeletePhoneNumberResponse.md @@ -0,0 +1,11 @@ +# DeletePhoneNumberResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteRedirectURLRequest.md b/docs/models/operations/DeleteRedirectURLRequest.md new file mode 100644 index 0000000..8befef3 --- /dev/null +++ b/docs/models/operations/DeleteRedirectURLRequest.md @@ -0,0 +1,8 @@ +# DeleteRedirectURLRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `id` | *String* | :heavy_check_mark: | The ID of the redirect URL | \ No newline at end of file diff --git a/docs/models/operations/DeleteRedirectURLResponse.md b/docs/models/operations/DeleteRedirectURLResponse.md new file mode 100644 index 0000000..18204d6 --- /dev/null +++ b/docs/models/operations/DeleteRedirectURLResponse.md @@ -0,0 +1,11 @@ +# DeleteRedirectURLResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteSAMLConnectionRequest.md b/docs/models/operations/DeleteSAMLConnectionRequest.md new file mode 100644 index 0000000..e57508c --- /dev/null +++ b/docs/models/operations/DeleteSAMLConnectionRequest.md @@ -0,0 +1,8 @@ +# DeleteSAMLConnectionRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection to delete | \ No newline at end of file diff --git a/docs/models/operations/DeleteSAMLConnectionResponse.md b/docs/models/operations/DeleteSAMLConnectionResponse.md new file mode 100644 index 0000000..b0c2105 --- /dev/null +++ b/docs/models/operations/DeleteSAMLConnectionResponse.md @@ -0,0 +1,11 @@ +# DeleteSAMLConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DeleteSvixAppResponse.md b/docs/models/operations/DeleteSvixAppResponse.md new file mode 100644 index 0000000..53264d5 --- /dev/null +++ b/docs/models/operations/DeleteSvixAppResponse.md @@ -0,0 +1,10 @@ +# DeleteSvixAppResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/DeleteUserProfileImageRequest.md b/docs/models/operations/DeleteUserProfileImageRequest.md new file mode 100644 index 0000000..c3c89ed --- /dev/null +++ b/docs/models/operations/DeleteUserProfileImageRequest.md @@ -0,0 +1,8 @@ +# DeleteUserProfileImageRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to delete the profile image for | \ No newline at end of file diff --git a/docs/models/operations/DeleteUserProfileImageResponse.md b/docs/models/operations/DeleteUserProfileImageResponse.md new file mode 100644 index 0000000..c98f1b1 --- /dev/null +++ b/docs/models/operations/DeleteUserProfileImageResponse.md @@ -0,0 +1,11 @@ +# DeleteUserProfileImageResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/DeleteUserRequest.md b/docs/models/operations/DeleteUserRequest.md new file mode 100644 index 0000000..7efdad1 --- /dev/null +++ b/docs/models/operations/DeleteUserRequest.md @@ -0,0 +1,8 @@ +# DeleteUserRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to delete | \ No newline at end of file diff --git a/docs/models/operations/DeleteUserResponse.md b/docs/models/operations/DeleteUserResponse.md new file mode 100644 index 0000000..c856514 --- /dev/null +++ b/docs/models/operations/DeleteUserResponse.md @@ -0,0 +1,11 @@ +# DeleteUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `deletedObject` | [Optional](../../models/components/DeletedObject.md) | :heavy_minus_sign: | Deleted Object | \ No newline at end of file diff --git a/docs/models/operations/DisableMFARequest.md b/docs/models/operations/DisableMFARequest.md new file mode 100644 index 0000000..ecdfe94 --- /dev/null +++ b/docs/models/operations/DisableMFARequest.md @@ -0,0 +1,8 @@ +# DisableMFARequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user whose MFA methods are to be disabled | \ No newline at end of file diff --git a/docs/models/operations/DisableMFAResponse.md b/docs/models/operations/DisableMFAResponse.md new file mode 100644 index 0000000..a38cd11 --- /dev/null +++ b/docs/models/operations/DisableMFAResponse.md @@ -0,0 +1,11 @@ +# DisableMFAResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional](../../models/operations/DisableMFAResponseBody.md) | :heavy_minus_sign: | Successful operation. | \ No newline at end of file diff --git a/docs/models/operations/DisableMFAResponseBody.md b/docs/models/operations/DisableMFAResponseBody.md new file mode 100644 index 0000000..51cea15 --- /dev/null +++ b/docs/models/operations/DisableMFAResponseBody.md @@ -0,0 +1,10 @@ +# DisableMFAResponseBody + +Successful operation. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `userId` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/File.md b/docs/models/operations/File.md new file mode 100644 index 0000000..728fd2e --- /dev/null +++ b/docs/models/operations/File.md @@ -0,0 +1,9 @@ +# File + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `fileName` | *String* | :heavy_check_mark: | N/A | +| `content` | *byte[]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GenerateSvixAuthURLResponse.md b/docs/models/operations/GenerateSvixAuthURLResponse.md new file mode 100644 index 0000000..5a3360f --- /dev/null +++ b/docs/models/operations/GenerateSvixAuthURLResponse.md @@ -0,0 +1,11 @@ +# GenerateSvixAuthURLResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `svixURL` | [Optional](../../models/components/SvixURL.md) | :heavy_minus_sign: | Response that contains a temporary Svix URL to access management dashboard | \ No newline at end of file diff --git a/docs/models/operations/GetClientListRequest.md b/docs/models/operations/GetClientListRequest.md new file mode 100644 index 0000000..12d725b --- /dev/null +++ b/docs/models/operations/GetClientListRequest.md @@ -0,0 +1,9 @@ +# GetClientListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | \ No newline at end of file diff --git a/docs/models/operations/GetClientListResponse.md b/docs/models/operations/GetClientListResponse.md new file mode 100644 index 0000000..0be48b6 --- /dev/null +++ b/docs/models/operations/GetClientListResponse.md @@ -0,0 +1,11 @@ +# GetClientListResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `clientList` | List<[com.clerk.backend_api.models.components.Client](../../models/components/Client.md)> | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetClientRequest.md b/docs/models/operations/GetClientRequest.md new file mode 100644 index 0000000..16a2c89 --- /dev/null +++ b/docs/models/operations/GetClientRequest.md @@ -0,0 +1,8 @@ +# GetClientRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `clientId` | *String* | :heavy_check_mark: | Client ID. | \ No newline at end of file diff --git a/docs/models/operations/GetClientResponse.md b/docs/models/operations/GetClientResponse.md new file mode 100644 index 0000000..37cdd9e --- /dev/null +++ b/docs/models/operations/GetClientResponse.md @@ -0,0 +1,11 @@ +# GetClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `client` | [Optional](../../models/components/Client.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetEmailAddressRequest.md b/docs/models/operations/GetEmailAddressRequest.md new file mode 100644 index 0000000..2e42533 --- /dev/null +++ b/docs/models/operations/GetEmailAddressRequest.md @@ -0,0 +1,8 @@ +# GetEmailAddressRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `emailAddressId` | *String* | :heavy_check_mark: | The ID of the email address to retrieve | \ No newline at end of file diff --git a/docs/models/operations/GetEmailAddressResponse.md b/docs/models/operations/GetEmailAddressResponse.md new file mode 100644 index 0000000..a3fe442 --- /dev/null +++ b/docs/models/operations/GetEmailAddressResponse.md @@ -0,0 +1,11 @@ +# GetEmailAddressResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `emailAddress` | [Optional](../../models/components/EmailAddress.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 new file mode 100644 index 0000000..eda7953 --- /dev/null +++ b/docs/models/operations/GetJWKSResponse.md @@ -0,0 +1,10 @@ +# GetJWKSResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetJWTTemplateRequest.md b/docs/models/operations/GetJWTTemplateRequest.md new file mode 100644 index 0000000..bd592a9 --- /dev/null +++ b/docs/models/operations/GetJWTTemplateRequest.md @@ -0,0 +1,8 @@ +# GetJWTTemplateRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `templateId` | *String* | :heavy_check_mark: | JWT Template ID | \ No newline at end of file diff --git a/docs/models/operations/GetJWTTemplateResponse.md b/docs/models/operations/GetJWTTemplateResponse.md new file mode 100644 index 0000000..c2f16d0 --- /dev/null +++ b/docs/models/operations/GetJWTTemplateResponse.md @@ -0,0 +1,11 @@ +# GetJWTTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `jwtTemplate` | [Optional](../../models/components/JWTTemplate.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetOAuthAccessTokenPublicMetadata.md b/docs/models/operations/GetOAuthAccessTokenPublicMetadata.md new file mode 100644 index 0000000..a6e935a --- /dev/null +++ b/docs/models/operations/GetOAuthAccessTokenPublicMetadata.md @@ -0,0 +1,7 @@ +# GetOAuthAccessTokenPublicMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/GetOAuthAccessTokenRequest.md b/docs/models/operations/GetOAuthAccessTokenRequest.md new file mode 100644 index 0000000..867431e --- /dev/null +++ b/docs/models/operations/GetOAuthAccessTokenRequest.md @@ -0,0 +1,9 @@ +# GetOAuthAccessTokenRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user for which to retrieve the OAuth access token | +| `provider` | *String* | :heavy_check_mark: | The ID of the OAuth provider (e.g. `oauth_google`) | \ No newline at end of file diff --git a/docs/models/operations/GetOAuthAccessTokenResponse.md b/docs/models/operations/GetOAuthAccessTokenResponse.md new file mode 100644 index 0000000..c785f2c --- /dev/null +++ b/docs/models/operations/GetOAuthAccessTokenResponse.md @@ -0,0 +1,11 @@ +# GetOAuthAccessTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `responseBodies` | List<[com.clerk.backend_api.models.operations.ResponseBody](../../models/operations/ResponseBody.md)> | :heavy_minus_sign: | The OAuth access token of the user, if any. | \ No newline at end of file diff --git a/docs/models/operations/GetOAuthApplicationRequest.md b/docs/models/operations/GetOAuthApplicationRequest.md new file mode 100644 index 0000000..41e4f30 --- /dev/null +++ b/docs/models/operations/GetOAuthApplicationRequest.md @@ -0,0 +1,8 @@ +# GetOAuthApplicationRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `oauthApplicationId` | *String* | :heavy_check_mark: | The ID of the OAuth application | \ No newline at end of file diff --git a/docs/models/operations/GetOAuthApplicationResponse.md b/docs/models/operations/GetOAuthApplicationResponse.md new file mode 100644 index 0000000..60980a9 --- /dev/null +++ b/docs/models/operations/GetOAuthApplicationResponse.md @@ -0,0 +1,11 @@ +# GetOAuthApplicationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `oAuthApplication` | [Optional](../../models/components/OAuthApplication.md) | :heavy_minus_sign: | An OAuth application | \ No newline at end of file diff --git a/docs/models/operations/GetOrganizationInvitationRequest.md b/docs/models/operations/GetOrganizationInvitationRequest.md new file mode 100644 index 0000000..78eeb93 --- /dev/null +++ b/docs/models/operations/GetOrganizationInvitationRequest.md @@ -0,0 +1,9 @@ +# GetOrganizationInvitationRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `invitationId` | *String* | :heavy_check_mark: | The organization invitation ID. | \ No newline at end of file diff --git a/docs/models/operations/GetOrganizationInvitationResponse.md b/docs/models/operations/GetOrganizationInvitationResponse.md new file mode 100644 index 0000000..73cc33b --- /dev/null +++ b/docs/models/operations/GetOrganizationInvitationResponse.md @@ -0,0 +1,11 @@ +# GetOrganizationInvitationResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationInvitation` | [Optional](../../models/components/OrganizationInvitation.md) | :heavy_minus_sign: | An organization invitation | \ No newline at end of file diff --git a/docs/models/operations/GetOrganizationRequest.md b/docs/models/operations/GetOrganizationRequest.md new file mode 100644 index 0000000..4a51894 --- /dev/null +++ b/docs/models/operations/GetOrganizationRequest.md @@ -0,0 +1,8 @@ +# GetOrganizationRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID or slug of the organization | \ No newline at end of file diff --git a/docs/models/operations/GetOrganizationResponse.md b/docs/models/operations/GetOrganizationResponse.md new file mode 100644 index 0000000..8a30447 --- /dev/null +++ b/docs/models/operations/GetOrganizationResponse.md @@ -0,0 +1,11 @@ +# GetOrganizationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organization` | [Optional](../../models/components/Organization.md) | :heavy_minus_sign: | An organization | \ No newline at end of file diff --git a/docs/models/operations/GetPhoneNumberRequest.md b/docs/models/operations/GetPhoneNumberRequest.md new file mode 100644 index 0000000..e9888c1 --- /dev/null +++ b/docs/models/operations/GetPhoneNumberRequest.md @@ -0,0 +1,8 @@ +# GetPhoneNumberRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `phoneNumberId` | *String* | :heavy_check_mark: | The ID of the phone number to retrieve | \ No newline at end of file diff --git a/docs/models/operations/GetPhoneNumberResponse.md b/docs/models/operations/GetPhoneNumberResponse.md new file mode 100644 index 0000000..f32c45c --- /dev/null +++ b/docs/models/operations/GetPhoneNumberResponse.md @@ -0,0 +1,11 @@ +# GetPhoneNumberResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `phoneNumber` | [Optional](../../models/components/PhoneNumber.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetPublicInterstitialRequest.md b/docs/models/operations/GetPublicInterstitialRequest.md new file mode 100644 index 0000000..4a14c6f --- /dev/null +++ b/docs/models/operations/GetPublicInterstitialRequest.md @@ -0,0 +1,9 @@ +# GetPublicInterstitialRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `frontendApi` | *Optional* | :heavy_minus_sign: | The Frontend API key of your instance | +| `publishableKey` | *Optional* | :heavy_minus_sign: | The publishable key of your instance | \ No newline at end of file diff --git a/docs/models/operations/GetPublicInterstitialResponse.md b/docs/models/operations/GetPublicInterstitialResponse.md new file mode 100644 index 0000000..789a67a --- /dev/null +++ b/docs/models/operations/GetPublicInterstitialResponse.md @@ -0,0 +1,10 @@ +# GetPublicInterstitialResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetRedirectURLRequest.md b/docs/models/operations/GetRedirectURLRequest.md new file mode 100644 index 0000000..239d94f --- /dev/null +++ b/docs/models/operations/GetRedirectURLRequest.md @@ -0,0 +1,8 @@ +# GetRedirectURLRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `id` | *String* | :heavy_check_mark: | The ID of the redirect URL | \ No newline at end of file diff --git a/docs/models/operations/GetRedirectURLResponse.md b/docs/models/operations/GetRedirectURLResponse.md new file mode 100644 index 0000000..66eab5a --- /dev/null +++ b/docs/models/operations/GetRedirectURLResponse.md @@ -0,0 +1,11 @@ +# GetRedirectURLResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `redirectURL` | [Optional](../../models/components/RedirectURL.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetSAMLConnectionRequest.md b/docs/models/operations/GetSAMLConnectionRequest.md new file mode 100644 index 0000000..098de19 --- /dev/null +++ b/docs/models/operations/GetSAMLConnectionRequest.md @@ -0,0 +1,8 @@ +# GetSAMLConnectionRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection | \ No newline at end of file diff --git a/docs/models/operations/GetSAMLConnectionResponse.md b/docs/models/operations/GetSAMLConnectionResponse.md new file mode 100644 index 0000000..d35aca2 --- /dev/null +++ b/docs/models/operations/GetSAMLConnectionResponse.md @@ -0,0 +1,11 @@ +# GetSAMLConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `samlConnection` | [Optional](../../models/components/SAMLConnection.md) | :heavy_minus_sign: | A SAML Connection | \ No newline at end of file diff --git a/docs/models/operations/GetSessionListRequest.md b/docs/models/operations/GetSessionListRequest.md new file mode 100644 index 0000000..7faf1cd --- /dev/null +++ b/docs/models/operations/GetSessionListRequest.md @@ -0,0 +1,12 @@ +# GetSessionListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | *Optional* | :heavy_minus_sign: | List sessions for the given client | +| `userId` | *Optional* | :heavy_minus_sign: | List sessions for the given user | +| `status` | [Optional](../../models/operations/Status.md) | :heavy_minus_sign: | Filter sessions by the provided status | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | \ No newline at end of file diff --git a/docs/models/operations/GetSessionListResponse.md b/docs/models/operations/GetSessionListResponse.md new file mode 100644 index 0000000..d892d20 --- /dev/null +++ b/docs/models/operations/GetSessionListResponse.md @@ -0,0 +1,11 @@ +# GetSessionListResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `sessionList` | List<[com.clerk.backend_api.models.components.Session](../../models/components/Session.md)> | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetSessionRequest.md b/docs/models/operations/GetSessionRequest.md new file mode 100644 index 0000000..c329978 --- /dev/null +++ b/docs/models/operations/GetSessionRequest.md @@ -0,0 +1,8 @@ +# GetSessionRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `sessionId` | *String* | :heavy_check_mark: | The ID of the session | \ No newline at end of file diff --git a/docs/models/operations/GetSessionResponse.md b/docs/models/operations/GetSessionResponse.md new file mode 100644 index 0000000..477ad70 --- /dev/null +++ b/docs/models/operations/GetSessionResponse.md @@ -0,0 +1,11 @@ +# GetSessionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `session` | [Optional](../../models/components/Session.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetTemplateListRequest.md b/docs/models/operations/GetTemplateListRequest.md new file mode 100644 index 0000000..cd5fed0 --- /dev/null +++ b/docs/models/operations/GetTemplateListRequest.md @@ -0,0 +1,8 @@ +# GetTemplateListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.TemplateType](../../models/operations/TemplateType.md) | :heavy_check_mark: | The type of templates to list (email or SMS) | \ No newline at end of file diff --git a/docs/models/operations/GetTemplateListResponse.md b/docs/models/operations/GetTemplateListResponse.md new file mode 100644 index 0000000..da950a7 --- /dev/null +++ b/docs/models/operations/GetTemplateListResponse.md @@ -0,0 +1,11 @@ +# GetTemplateListResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `templateList` | List<[com.clerk.backend_api.models.components.Template](../../models/components/Template.md)> | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetTemplateRequest.md b/docs/models/operations/GetTemplateRequest.md new file mode 100644 index 0000000..7aad703 --- /dev/null +++ b/docs/models/operations/GetTemplateRequest.md @@ -0,0 +1,9 @@ +# GetTemplateRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.PathParamTemplateType](../../models/operations/PathParamTemplateType.md) | :heavy_check_mark: | The type of templates to retrieve (email or SMS) | +| `slug` | *String* | :heavy_check_mark: | The slug (i.e. machine-friendly name) of the template to retrieve | \ No newline at end of file diff --git a/docs/models/operations/GetTemplateResponse.md b/docs/models/operations/GetTemplateResponse.md new file mode 100644 index 0000000..8bef704 --- /dev/null +++ b/docs/models/operations/GetTemplateResponse.md @@ -0,0 +1,11 @@ +# GetTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `template` | [Optional](../../models/components/Template.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetUserListRequest.md b/docs/models/operations/GetUserListRequest.md new file mode 100644 index 0000000..8e6ec31 --- /dev/null +++ b/docs/models/operations/GetUserListRequest.md @@ -0,0 +1,19 @@ +# GetUserListRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `emailAddress` | List<*String*> | :heavy_minus_sign: | Returns users with the specified email addresses.
Accepts up to 100 email addresses.
Any email addresses not found are ignored. | | +| `phoneNumber` | List<*String*> | :heavy_minus_sign: | Returns users with the specified phone numbers.
Accepts up to 100 phone numbers.
Any phone numbers not found are ignored. | | +| `externalId` | List<*String*> | :heavy_minus_sign: | Returns users with the specified external ids.
For each external id, the `+` and `-` can be
prepended to the id, which denote whether the
respective external id should be included or
excluded from the result set.
Accepts up to 100 external ids.
Any external ids not found are ignored. | | +| `username` | List<*String*> | :heavy_minus_sign: | Returns users with the specified usernames.
Accepts up to 100 usernames.
Any usernames not found are ignored. | | +| `web3Wallet` | List<*String*> | :heavy_minus_sign: | Returns users with the specified web3 wallet addresses.
Accepts up to 100 web3 wallet addresses.
Any web3 wallet addressed not found are ignored. | | +| `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. | | +| `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. | | +| `query` | *Optional* | :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. | | +| `lastActiveAtSince` | *Optional* | :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 | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | | +| `offset` | *Optional* | :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`. | | +| `orderBy` | *Optional* | :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/GetUserListResponse.md b/docs/models/operations/GetUserListResponse.md new file mode 100644 index 0000000..f840600 --- /dev/null +++ b/docs/models/operations/GetUserListResponse.md @@ -0,0 +1,11 @@ +# GetUserListResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `userList` | List<[com.clerk.backend_api.models.components.User](../../models/components/User.md)> | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetUserRequest.md b/docs/models/operations/GetUserRequest.md new file mode 100644 index 0000000..9059b8a --- /dev/null +++ b/docs/models/operations/GetUserRequest.md @@ -0,0 +1,8 @@ +# GetUserRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to retrieve | \ No newline at end of file diff --git a/docs/models/operations/GetUserResponse.md b/docs/models/operations/GetUserResponse.md new file mode 100644 index 0000000..f8079cd --- /dev/null +++ b/docs/models/operations/GetUserResponse.md @@ -0,0 +1,11 @@ +# GetUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/GetUsersCountRequest.md b/docs/models/operations/GetUsersCountRequest.md new file mode 100644 index 0000000..1a9cd66 --- /dev/null +++ b/docs/models/operations/GetUsersCountRequest.md @@ -0,0 +1,14 @@ +# GetUsersCountRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `emailAddress` | List<*String*> | :heavy_minus_sign: | Counts users with the specified email addresses.
Accepts up to 100 email addresses.
Any email addresses not found are ignored. | +| `phoneNumber` | List<*String*> | :heavy_minus_sign: | Counts users with the specified phone numbers.
Accepts up to 100 phone numbers.
Any phone numbers not found are ignored. | +| `externalId` | List<*String*> | :heavy_minus_sign: | Counts users with the specified external ids.
Accepts up to 100 external ids.
Any external ids not found are ignored. | +| `username` | List<*String*> | :heavy_minus_sign: | Counts users with the specified usernames.
Accepts up to 100 usernames.
Any usernames not found are ignored. | +| `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. | +| `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. | +| `query` | *Optional* | :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. | \ No newline at end of file diff --git a/docs/models/operations/GetUsersCountResponse.md b/docs/models/operations/GetUsersCountResponse.md new file mode 100644 index 0000000..27a4eaa --- /dev/null +++ b/docs/models/operations/GetUsersCountResponse.md @@ -0,0 +1,11 @@ +# GetUsersCountResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `totalCount` | [Optional](../../models/components/TotalCount.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/ListAllowlistIdentifiersResponse.md b/docs/models/operations/ListAllowlistIdentifiersResponse.md new file mode 100644 index 0000000..2264a79 --- /dev/null +++ b/docs/models/operations/ListAllowlistIdentifiersResponse.md @@ -0,0 +1,11 @@ +# ListAllowlistIdentifiersResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `allowlistIdentifierList` | List<[com.clerk.backend_api.models.components.AllowlistIdentifier](../../models/components/AllowlistIdentifier.md)> | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/ListBlocklistIdentifiersResponse.md b/docs/models/operations/ListBlocklistIdentifiersResponse.md new file mode 100644 index 0000000..b09ad77 --- /dev/null +++ b/docs/models/operations/ListBlocklistIdentifiersResponse.md @@ -0,0 +1,11 @@ +# ListBlocklistIdentifiersResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `blocklistIdentifiers` | [Optional](../../models/components/BlocklistIdentifiers.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/ListDomainsResponse.md b/docs/models/operations/ListDomainsResponse.md new file mode 100644 index 0000000..3df6af3 --- /dev/null +++ b/docs/models/operations/ListDomainsResponse.md @@ -0,0 +1,11 @@ +# ListDomainsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `domains` | [Optional](../../models/components/Domains.md) | :heavy_minus_sign: | A list of domains | \ No newline at end of file diff --git a/docs/models/operations/ListInvitationsRequest.md b/docs/models/operations/ListInvitationsRequest.md new file mode 100644 index 0000000..009e0d2 --- /dev/null +++ b/docs/models/operations/ListInvitationsRequest.md @@ -0,0 +1,10 @@ +# ListInvitationsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | +| `status` | [Optional](../../models/operations/QueryParamStatus.md) | :heavy_minus_sign: | Filter invitations based on their status | \ No newline at end of file diff --git a/docs/models/operations/ListInvitationsResponse.md b/docs/models/operations/ListInvitationsResponse.md new file mode 100644 index 0000000..5faeb6d --- /dev/null +++ b/docs/models/operations/ListInvitationsResponse.md @@ -0,0 +1,11 @@ +# ListInvitationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `invitationList` | List<[com.clerk.backend_api.models.components.Invitation](../../models/components/Invitation.md)> | :heavy_minus_sign: | List of invitations | \ No newline at end of file diff --git a/docs/models/operations/ListJWTTemplatesResponse.md b/docs/models/operations/ListJWTTemplatesResponse.md new file mode 100644 index 0000000..684668f --- /dev/null +++ b/docs/models/operations/ListJWTTemplatesResponse.md @@ -0,0 +1,11 @@ +# ListJWTTemplatesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `jwtTemplateList` | List<[com.clerk.backend_api.models.components.JWTTemplate](../../models/components/JWTTemplate.md)> | :heavy_minus_sign: | List of JWT templates | \ No newline at end of file diff --git a/docs/models/operations/ListOAuthApplicationsRequest.md b/docs/models/operations/ListOAuthApplicationsRequest.md new file mode 100644 index 0000000..3c92eb4 --- /dev/null +++ b/docs/models/operations/ListOAuthApplicationsRequest.md @@ -0,0 +1,9 @@ +# ListOAuthApplicationsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | \ No newline at end of file diff --git a/docs/models/operations/ListOAuthApplicationsResponse.md b/docs/models/operations/ListOAuthApplicationsResponse.md new file mode 100644 index 0000000..ddc6916 --- /dev/null +++ b/docs/models/operations/ListOAuthApplicationsResponse.md @@ -0,0 +1,11 @@ +# ListOAuthApplicationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `oAuthApplications` | [Optional](../../models/components/OAuthApplications.md) | :heavy_minus_sign: | A list of OAuth applications | \ No newline at end of file diff --git a/docs/models/operations/ListOrganizationInvitationsQueryParamStatus.md b/docs/models/operations/ListOrganizationInvitationsQueryParamStatus.md new file mode 100644 index 0000000..f7d0225 --- /dev/null +++ b/docs/models/operations/ListOrganizationInvitationsQueryParamStatus.md @@ -0,0 +1,12 @@ +# ListOrganizationInvitationsQueryParamStatus + +Filter organization invitations based on their status + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `ACCEPTED` | accepted | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/operations/ListOrganizationInvitationsRequest.md b/docs/models/operations/ListOrganizationInvitationsRequest.md new file mode 100644 index 0000000..f815917 --- /dev/null +++ b/docs/models/operations/ListOrganizationInvitationsRequest.md @@ -0,0 +1,11 @@ +# ListOrganizationInvitationsRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | +| `status` | [Optional](../../models/operations/ListOrganizationInvitationsQueryParamStatus.md) | :heavy_minus_sign: | Filter organization invitations based on their status | \ No newline at end of file diff --git a/docs/models/operations/ListOrganizationInvitationsResponse.md b/docs/models/operations/ListOrganizationInvitationsResponse.md new file mode 100644 index 0000000..fd468c0 --- /dev/null +++ b/docs/models/operations/ListOrganizationInvitationsResponse.md @@ -0,0 +1,11 @@ +# ListOrganizationInvitationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationInvitations` | [Optional](../../models/components/OrganizationInvitations.md) | :heavy_minus_sign: | A list of organization invitations | \ No newline at end of file diff --git a/docs/models/operations/ListOrganizationMembershipsRequest.md b/docs/models/operations/ListOrganizationMembershipsRequest.md new file mode 100644 index 0000000..00ef74e --- /dev/null +++ b/docs/models/operations/ListOrganizationMembershipsRequest.md @@ -0,0 +1,11 @@ +# ListOrganizationMembershipsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | +| `orderBy` | *Optional* | :heavy_minus_sign: | Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username.
By prepending one of those values with + or -,
we can choose to sort in ascending (ASC) or descending (DESC) order." | \ No newline at end of file diff --git a/docs/models/operations/ListOrganizationMembershipsResponse.md b/docs/models/operations/ListOrganizationMembershipsResponse.md new file mode 100644 index 0000000..f0ddaee --- /dev/null +++ b/docs/models/operations/ListOrganizationMembershipsResponse.md @@ -0,0 +1,11 @@ +# ListOrganizationMembershipsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationMemberships` | [Optional](../../models/components/OrganizationMemberships.md) | :heavy_minus_sign: | A list of organization memberships | \ No newline at end of file diff --git a/docs/models/operations/ListOrganizationsRequest.md b/docs/models/operations/ListOrganizationsRequest.md new file mode 100644 index 0000000..8a19a83 --- /dev/null +++ b/docs/models/operations/ListOrganizationsRequest.md @@ -0,0 +1,12 @@ +# ListOrganizationsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | +| `includeMembersCount` | *Optional* | :heavy_minus_sign: | Flag to denote whether the member counts of each organization should be included in the response or not. | +| `query` | *Optional* | :heavy_minus_sign: | Returns organizations with ID, name, or slug that match the given query.
Uses exact match for organization ID and partial match for name and slug. | +| `orderBy` | *Optional* | :heavy_minus_sign: | Allows to return organizations in a particular order.
At the moment, you can order the returned organizations either by their `name`, `created_at` or `members_count`.
In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by.
For example, if you want organizations to be returned in descending order according to their `created_at` property, you can use `-created_at`.
If you don't use `+` or `-`, then `+` is implied.
Defaults to `-created_at`. | \ No newline at end of file diff --git a/docs/models/operations/ListOrganizationsResponse.md b/docs/models/operations/ListOrganizationsResponse.md new file mode 100644 index 0000000..06c8076 --- /dev/null +++ b/docs/models/operations/ListOrganizationsResponse.md @@ -0,0 +1,11 @@ +# ListOrganizationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizations` | [Optional](../../models/components/Organizations.md) | :heavy_minus_sign: | A list of organizations | \ No newline at end of file diff --git a/docs/models/operations/ListPendingOrganizationInvitationsRequest.md b/docs/models/operations/ListPendingOrganizationInvitationsRequest.md new file mode 100644 index 0000000..c54c242 --- /dev/null +++ b/docs/models/operations/ListPendingOrganizationInvitationsRequest.md @@ -0,0 +1,10 @@ +# ListPendingOrganizationInvitationsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | \ No newline at end of file diff --git a/docs/models/operations/ListPendingOrganizationInvitationsResponse.md b/docs/models/operations/ListPendingOrganizationInvitationsResponse.md new file mode 100644 index 0000000..09beef9 --- /dev/null +++ b/docs/models/operations/ListPendingOrganizationInvitationsResponse.md @@ -0,0 +1,11 @@ +# ListPendingOrganizationInvitationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationInvitations` | [Optional](../../models/components/OrganizationInvitations.md) | :heavy_minus_sign: | A list of organization invitations | \ No newline at end of file diff --git a/docs/models/operations/ListRedirectURLsResponse.md b/docs/models/operations/ListRedirectURLsResponse.md new file mode 100644 index 0000000..b4ffe72 --- /dev/null +++ b/docs/models/operations/ListRedirectURLsResponse.md @@ -0,0 +1,11 @@ +# ListRedirectURLsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `redirectURLList` | List<[com.clerk.backend_api.models.components.RedirectURL](../../models/components/RedirectURL.md)> | :heavy_minus_sign: | List of Redirect URLs | \ No newline at end of file diff --git a/docs/models/operations/ListSAMLConnectionsRequest.md b/docs/models/operations/ListSAMLConnectionsRequest.md new file mode 100644 index 0000000..c2a8c6a --- /dev/null +++ b/docs/models/operations/ListSAMLConnectionsRequest.md @@ -0,0 +1,9 @@ +# ListSAMLConnectionsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | \ No newline at end of file diff --git a/docs/models/operations/ListSAMLConnectionsResponse.md b/docs/models/operations/ListSAMLConnectionsResponse.md new file mode 100644 index 0000000..3273387 --- /dev/null +++ b/docs/models/operations/ListSAMLConnectionsResponse.md @@ -0,0 +1,11 @@ +# ListSAMLConnectionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `samlConnections` | [Optional](../../models/components/SAMLConnections.md) | :heavy_minus_sign: | A list of SAML Connections | \ No newline at end of file diff --git a/docs/models/operations/LockUserRequest.md b/docs/models/operations/LockUserRequest.md new file mode 100644 index 0000000..fa83a4f --- /dev/null +++ b/docs/models/operations/LockUserRequest.md @@ -0,0 +1,8 @@ +# LockUserRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to lock | \ No newline at end of file diff --git a/docs/models/operations/LockUserResponse.md b/docs/models/operations/LockUserResponse.md new file mode 100644 index 0000000..6ae4ce8 --- /dev/null +++ b/docs/models/operations/LockUserResponse.md @@ -0,0 +1,11 @@ +# LockUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/MergeOrganizationMetadataPrivateMetadata.md b/docs/models/operations/MergeOrganizationMetadataPrivateMetadata.md new file mode 100644 index 0000000..cc4792e --- /dev/null +++ b/docs/models/operations/MergeOrganizationMetadataPrivateMetadata.md @@ -0,0 +1,10 @@ +# MergeOrganizationMetadataPrivateMetadata + +Metadata saved on the organization that is only visible to your backend. +The new object will be merged with the existing value. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/MergeOrganizationMetadataPublicMetadata.md b/docs/models/operations/MergeOrganizationMetadataPublicMetadata.md new file mode 100644 index 0000000..7dac9e8 --- /dev/null +++ b/docs/models/operations/MergeOrganizationMetadataPublicMetadata.md @@ -0,0 +1,10 @@ +# MergeOrganizationMetadataPublicMetadata + +Metadata saved on the organization, that is visible to both your frontend and backend. +The new object will be merged with the existing value. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/MergeOrganizationMetadataRequest.md b/docs/models/operations/MergeOrganizationMetadataRequest.md new file mode 100644 index 0000000..527dcfd --- /dev/null +++ b/docs/models/operations/MergeOrganizationMetadataRequest.md @@ -0,0 +1,9 @@ +# MergeOrganizationMetadataRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization for which metadata will be merged or updated | +| `requestBody` | [com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequestBody](../../models/operations/MergeOrganizationMetadataRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/MergeOrganizationMetadataRequestBody.md b/docs/models/operations/MergeOrganizationMetadataRequestBody.md new file mode 100644 index 0000000..ccae4af --- /dev/null +++ b/docs/models/operations/MergeOrganizationMetadataRequestBody.md @@ -0,0 +1,9 @@ +# MergeOrganizationMetadataRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `publicMetadata` | [Optional](../../models/operations/MergeOrganizationMetadataPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, that is visible to both your frontend and backend.
The new object will be merged with the existing value. | +| `privateMetadata` | [Optional](../../models/operations/MergeOrganizationMetadataPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization that is only visible to your backend.
The new object will be merged with the existing value. | \ No newline at end of file diff --git a/docs/models/operations/MergeOrganizationMetadataResponse.md b/docs/models/operations/MergeOrganizationMetadataResponse.md new file mode 100644 index 0000000..7b36082 --- /dev/null +++ b/docs/models/operations/MergeOrganizationMetadataResponse.md @@ -0,0 +1,11 @@ +# MergeOrganizationMetadataResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organization` | [Optional](../../models/components/Organization.md) | :heavy_minus_sign: | An organization | \ No newline at end of file diff --git a/docs/models/operations/Object.md b/docs/models/operations/Object.md new file mode 100644 index 0000000..8139b8a --- /dev/null +++ b/docs/models/operations/Object.md @@ -0,0 +1,8 @@ +# Object + + +## Values + +| Name | Value | +| ------- | ------- | +| `TOKEN` | token | \ No newline at end of file diff --git a/docs/models/operations/PasswordHasher.md b/docs/models/operations/PasswordHasher.md new file mode 100644 index 0000000..6eb3113 --- /dev/null +++ b/docs/models/operations/PasswordHasher.md @@ -0,0 +1,145 @@ +# PasswordHasher + +The hashing algorithm that was used to generate the password digest. +The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), +[md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), +[phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), +[scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) +and the [argon2](https://argon2.online/) variants argon2i and argon2id. + +If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + +Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. +Insecure schemes are marked with `(insecure)` in the list below. + +Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + +**bcrypt:** The digest should be of the following form: + +`$$$` + +**bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + +`bcrypt_sha256$$$$` + +**md5** (insecure): The digest should follow the regular form e.g.: + +`5f4dcc3b5aa765d61d8327deb882cf99` + +**pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + +`pbkdf2_sha256$$$` + +Note: Both the salt and the hash are expected to be base64-encoded. + +**pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + +`pbkdf2_sha512$$$` + + _iterations:_ The number of iterations used. Must be an integer less than 420000. + _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. + _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + +**pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + +`pbkdf2_sha256$$$` + +Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + +**pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: +1. uses sha1 instead of sha256 +2. accepts the hash as a hex-encoded string + +The format is the following: + +`pbkdf2_sha1$$$` + +**phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + +The format is the following: + +`$P$` + +- $P$ is the prefix used to identify phpass hashes. +- rounds is a single character encoding a 6-bit integer representing the number of rounds used. +- salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. +- checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + +**scrypt_firebase:** The Firebase-specific variant of scrypt. +The value is expected to have 6 segments separated by the $ character and include the following information: + +_hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. +_salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. +_signer key:_ The base64 encoded signer key. +_salt separator:_ The base64 encoded salt separator. +_rounds:_ The number of rounds the algorithm needs to run. +_memory cost:_ The cost of the algorithm run + +The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. +The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + +Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + +`$$$$$` + +**scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + + The value is expected to have 3 segments separated by the $ character and include the following information: + + _algorithm args:_ The algorithm used to generate the hash. + _salt:_ The salt used to generate the above hash. + _hash:_ The actual Base64 hash. + + The algorithm args are the parameters used to generate the hash and are included in the digest. + +**argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + +_version (v):_ The argon version, version 19 is assumed +_memory (m):_ The memory used by the algorithm (in kibibytes) +_iterations (t):_ The number of iterations to perform +_parallelism (p):_ The number of threads to use + +Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. +The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). +The final part is the actual digest. + +`$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + +**argon2id:** See the previous algorithm for an explanation of the formatting. + +For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + +`$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + +**sha256** (insecure): The digest should be a 64-length hex string, e.g.: + +`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + +**sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. + +The format is the following: + `$` + +The value is expected to have 2 segments separated by the $ character and include the following information: + _hash:_ The sha256 hash, a 64-length hex string. + _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `ARGON2I` | argon2i | +| `ARGON2ID` | argon2id | +| `BCRYPT` | bcrypt | +| `BCRYPT_SHA256_DJANGO` | bcrypt_sha256_django | +| `MD5` | md5 | +| `PBKDF2_SHA256` | pbkdf2_sha256 | +| `PBKDF2_SHA512` | pbkdf2_sha512 | +| `PBKDF2_SHA256_DJANGO` | pbkdf2_sha256_django | +| `PBKDF2_SHA1` | pbkdf2_sha1 | +| `PHPASS` | phpass | +| `SCRYPT_FIREBASE` | scrypt_firebase | +| `SCRYPT_WERKZEUG` | scrypt_werkzeug | +| `SHA256` | sha256 | +| `SHA256_SALTED` | sha256_salted | \ No newline at end of file diff --git a/docs/models/operations/PathParamTemplateType.md b/docs/models/operations/PathParamTemplateType.md new file mode 100644 index 0000000..2646b2f --- /dev/null +++ b/docs/models/operations/PathParamTemplateType.md @@ -0,0 +1,11 @@ +# PathParamTemplateType + +The type of templates to retrieve (email or SMS) + + +## Values + +| Name | Value | +| ------- | ------- | +| `EMAIL` | email | +| `SMS` | sms | \ No newline at end of file diff --git a/docs/models/operations/PreviewTemplateRequest.md b/docs/models/operations/PreviewTemplateRequest.md new file mode 100644 index 0000000..46803d8 --- /dev/null +++ b/docs/models/operations/PreviewTemplateRequest.md @@ -0,0 +1,10 @@ +# PreviewTemplateRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateType` | *String* | :heavy_check_mark: | The type of template to preview | +| `slug` | *String* | :heavy_check_mark: | The slug of the template to preview | +| `requestBody` | [Optional](../../models/operations/PreviewTemplateRequestBody.md) | :heavy_minus_sign: | Required parameters | \ No newline at end of file diff --git a/docs/models/operations/PreviewTemplateRequestBody.md b/docs/models/operations/PreviewTemplateRequestBody.md new file mode 100644 index 0000000..aebf7ec --- /dev/null +++ b/docs/models/operations/PreviewTemplateRequestBody.md @@ -0,0 +1,13 @@ +# PreviewTemplateRequestBody + +Required parameters + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `subject` | *JsonNullable* | :heavy_minus_sign: | The email subject.
Applicable only to email templates. | +| `body` | *Optional* | :heavy_minus_sign: | The template body before variable interpolation | +| `fromEmailName` | *Optional* | :heavy_minus_sign: | The local part of the From email address that will be used for emails.
For example, in the address 'hello@example.com', the local part is 'hello'.
Applicable only to email templates. | +| `replyToEmailName` | *Optional* | :heavy_minus_sign: | The local part of the Reply To email address that will be used for emails.
For example, in the address 'hello@example.com', the local part is 'hello'.
Applicable only to email templates. | \ No newline at end of file diff --git a/docs/models/operations/PreviewTemplateResponse.md b/docs/models/operations/PreviewTemplateResponse.md new file mode 100644 index 0000000..f634a11 --- /dev/null +++ b/docs/models/operations/PreviewTemplateResponse.md @@ -0,0 +1,11 @@ +# PreviewTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional](../../models/operations/PreviewTemplateResponseBody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/PreviewTemplateResponseBody.md b/docs/models/operations/PreviewTemplateResponseBody.md new file mode 100644 index 0000000..b930c48 --- /dev/null +++ b/docs/models/operations/PreviewTemplateResponseBody.md @@ -0,0 +1,9 @@ +# PreviewTemplateResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/PrivateMetadata.md b/docs/models/operations/PrivateMetadata.md new file mode 100644 index 0000000..b307941 --- /dev/null +++ b/docs/models/operations/PrivateMetadata.md @@ -0,0 +1,9 @@ +# PrivateMetadata + +Metadata saved on the user, that is only visible to your Backend API + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/Provider.md b/docs/models/operations/Provider.md new file mode 100644 index 0000000..1bed047 --- /dev/null +++ b/docs/models/operations/Provider.md @@ -0,0 +1,13 @@ +# Provider + +The IdP provider of the connection. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `SAML_CUSTOM` | saml_custom | +| `SAML_OKTA` | saml_okta | +| `SAML_GOOGLE` | saml_google | +| `SAML_MICROSOFT` | saml_microsoft | \ No newline at end of file diff --git a/docs/models/operations/PublicMetadata.md b/docs/models/operations/PublicMetadata.md new file mode 100644 index 0000000..7332bd0 --- /dev/null +++ b/docs/models/operations/PublicMetadata.md @@ -0,0 +1,9 @@ +# PublicMetadata + +Metadata saved on the user, that is visible to both your Frontend and Backend APIs + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/QueryParamStatus.md b/docs/models/operations/QueryParamStatus.md new file mode 100644 index 0000000..f452811 --- /dev/null +++ b/docs/models/operations/QueryParamStatus.md @@ -0,0 +1,12 @@ +# QueryParamStatus + +Filter invitations based on their status + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `ACCEPTED` | accepted | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/operations/RequestBody.md b/docs/models/operations/RequestBody.md new file mode 100644 index 0000000..ced36bc --- /dev/null +++ b/docs/models/operations/RequestBody.md @@ -0,0 +1,13 @@ +# RequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `emailAddress` | *String* | :heavy_check_mark: | The email address of the new member that is going to be invited to the organization | +| `inviterUserId` | *String* | :heavy_check_mark: | The ID of the user that invites the new member to the organization.
Must be an administrator in the organization. | +| `role` | *String* | :heavy_check_mark: | The role of the new member in the organization. | +| `publicMetadata` | [Optional](../../models/operations/CreateOrganizationInvitationBulkPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. | +| `privateMetadata` | [Optional](../../models/operations/CreateOrganizationInvitationBulkPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. | +| `redirectUrl` | *Optional* | :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. | \ No newline at end of file diff --git a/docs/models/operations/ResponseBody.md b/docs/models/operations/ResponseBody.md new file mode 100644 index 0000000..e30f876 --- /dev/null +++ b/docs/models/operations/ResponseBody.md @@ -0,0 +1,16 @@ +# ResponseBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `object` | *Optional* | :heavy_minus_sign: | N/A | +| `externalAccountId` | *Optional* | :heavy_minus_sign: | External account ID | +| `providerUserId` | *Optional* | :heavy_minus_sign: | The unique ID of the user in the external provider's system | +| `token` | *Optional* | :heavy_minus_sign: | The access token | +| `provider` | *Optional* | :heavy_minus_sign: | The ID of the provider | +| `publicMetadata` | [Optional](../../models/operations/GetOAuthAccessTokenPublicMetadata.md) | :heavy_minus_sign: | N/A | +| `label` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `scopes` | List<*String*> | :heavy_minus_sign: | The list of scopes that the token is valid for.
Only present for OAuth 2.0 tokens. | +| `tokenSecret` | *Optional* | :heavy_minus_sign: | The token secret. Only present for OAuth 1.0 tokens. | \ No newline at end of file diff --git a/docs/models/operations/RevertTemplatePathParamTemplateType.md b/docs/models/operations/RevertTemplatePathParamTemplateType.md new file mode 100644 index 0000000..f93ca38 --- /dev/null +++ b/docs/models/operations/RevertTemplatePathParamTemplateType.md @@ -0,0 +1,11 @@ +# RevertTemplatePathParamTemplateType + +The type of template to revert + + +## Values + +| Name | Value | +| ------- | ------- | +| `EMAIL` | email | +| `SMS` | sms | \ No newline at end of file diff --git a/docs/models/operations/RevertTemplateRequest.md b/docs/models/operations/RevertTemplateRequest.md new file mode 100644 index 0000000..5db4cff --- /dev/null +++ b/docs/models/operations/RevertTemplateRequest.md @@ -0,0 +1,9 @@ +# RevertTemplateRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.RevertTemplatePathParamTemplateType](../../models/operations/RevertTemplatePathParamTemplateType.md) | :heavy_check_mark: | The type of template to revert | +| `slug` | *String* | :heavy_check_mark: | The slug of the template to revert | \ No newline at end of file diff --git a/docs/models/operations/RevertTemplateResponse.md b/docs/models/operations/RevertTemplateResponse.md new file mode 100644 index 0000000..8a440b2 --- /dev/null +++ b/docs/models/operations/RevertTemplateResponse.md @@ -0,0 +1,11 @@ +# RevertTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `template` | [Optional](../../models/components/Template.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/RevokeActorTokenRequest.md b/docs/models/operations/RevokeActorTokenRequest.md new file mode 100644 index 0000000..053f97e --- /dev/null +++ b/docs/models/operations/RevokeActorTokenRequest.md @@ -0,0 +1,8 @@ +# RevokeActorTokenRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `actorTokenId` | *String* | :heavy_check_mark: | The ID of the actor token to be revoked. | \ No newline at end of file diff --git a/docs/models/operations/RevokeActorTokenResponse.md b/docs/models/operations/RevokeActorTokenResponse.md new file mode 100644 index 0000000..e5ddcc7 --- /dev/null +++ b/docs/models/operations/RevokeActorTokenResponse.md @@ -0,0 +1,11 @@ +# RevokeActorTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `actorToken` | [Optional](../../models/components/ActorToken.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/RevokeInvitationRequest.md b/docs/models/operations/RevokeInvitationRequest.md new file mode 100644 index 0000000..2cc5f9c --- /dev/null +++ b/docs/models/operations/RevokeInvitationRequest.md @@ -0,0 +1,8 @@ +# RevokeInvitationRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `invitationId` | *String* | :heavy_check_mark: | The ID of the invitation to be revoked | \ No newline at end of file diff --git a/docs/models/operations/RevokeInvitationResponse.md b/docs/models/operations/RevokeInvitationResponse.md new file mode 100644 index 0000000..ec3eb69 --- /dev/null +++ b/docs/models/operations/RevokeInvitationResponse.md @@ -0,0 +1,11 @@ +# RevokeInvitationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `invitationRevoked` | [Optional](../../models/components/InvitationRevoked.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/RevokeOrganizationInvitationRequest.md b/docs/models/operations/RevokeOrganizationInvitationRequest.md new file mode 100644 index 0000000..14d6edd --- /dev/null +++ b/docs/models/operations/RevokeOrganizationInvitationRequest.md @@ -0,0 +1,10 @@ +# RevokeOrganizationInvitationRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `invitationId` | *String* | :heavy_check_mark: | The organization invitation ID. | +| `requestBody` | [com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequestBody](../../models/operations/RevokeOrganizationInvitationRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/RevokeOrganizationInvitationRequestBody.md b/docs/models/operations/RevokeOrganizationInvitationRequestBody.md new file mode 100644 index 0000000..e7cbc8d --- /dev/null +++ b/docs/models/operations/RevokeOrganizationInvitationRequestBody.md @@ -0,0 +1,8 @@ +# RevokeOrganizationInvitationRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `requestingUserId` | *String* | :heavy_check_mark: | The ID of the user that revokes the invitation.
Must be an administrator in the organization. | \ No newline at end of file diff --git a/docs/models/operations/RevokeOrganizationInvitationResponse.md b/docs/models/operations/RevokeOrganizationInvitationResponse.md new file mode 100644 index 0000000..1ff33fa --- /dev/null +++ b/docs/models/operations/RevokeOrganizationInvitationResponse.md @@ -0,0 +1,11 @@ +# RevokeOrganizationInvitationResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationInvitation` | [Optional](../../models/components/OrganizationInvitation.md) | :heavy_minus_sign: | An organization invitation | \ No newline at end of file diff --git a/docs/models/operations/RevokeSessionRequest.md b/docs/models/operations/RevokeSessionRequest.md new file mode 100644 index 0000000..44a21d3 --- /dev/null +++ b/docs/models/operations/RevokeSessionRequest.md @@ -0,0 +1,8 @@ +# RevokeSessionRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `sessionId` | *String* | :heavy_check_mark: | The ID of the session | \ No newline at end of file diff --git a/docs/models/operations/RevokeSessionResponse.md b/docs/models/operations/RevokeSessionResponse.md new file mode 100644 index 0000000..dd25474 --- /dev/null +++ b/docs/models/operations/RevokeSessionResponse.md @@ -0,0 +1,11 @@ +# RevokeSessionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `session` | [Optional](../../models/components/Session.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/RevokeSignInTokenRequest.md b/docs/models/operations/RevokeSignInTokenRequest.md new file mode 100644 index 0000000..42dcb80 --- /dev/null +++ b/docs/models/operations/RevokeSignInTokenRequest.md @@ -0,0 +1,8 @@ +# RevokeSignInTokenRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `signInTokenId` | *String* | :heavy_check_mark: | The ID of the sign-in token to be revoked | \ No newline at end of file diff --git a/docs/models/operations/RevokeSignInTokenResponse.md b/docs/models/operations/RevokeSignInTokenResponse.md new file mode 100644 index 0000000..a02372a --- /dev/null +++ b/docs/models/operations/RevokeSignInTokenResponse.md @@ -0,0 +1,11 @@ +# RevokeSignInTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `signInToken` | [Optional](../../models/components/SignInToken.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/RotateOAuthApplicationSecretRequest.md b/docs/models/operations/RotateOAuthApplicationSecretRequest.md new file mode 100644 index 0000000..aa835df --- /dev/null +++ b/docs/models/operations/RotateOAuthApplicationSecretRequest.md @@ -0,0 +1,8 @@ +# RotateOAuthApplicationSecretRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `oauthApplicationId` | *String* | :heavy_check_mark: | The ID of the OAuth application for which to rotate the client secret | \ No newline at end of file diff --git a/docs/models/operations/RotateOAuthApplicationSecretResponse.md b/docs/models/operations/RotateOAuthApplicationSecretResponse.md new file mode 100644 index 0000000..19fbdc0 --- /dev/null +++ b/docs/models/operations/RotateOAuthApplicationSecretResponse.md @@ -0,0 +1,11 @@ +# RotateOAuthApplicationSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `oAuthApplicationWithSecret` | [Optional](../../models/components/OAuthApplicationWithSecret.md) | :heavy_minus_sign: | An OAuth application with client secret | \ No newline at end of file diff --git a/docs/models/operations/SetUserProfileImageRequest.md b/docs/models/operations/SetUserProfileImageRequest.md new file mode 100644 index 0000000..3e8a334 --- /dev/null +++ b/docs/models/operations/SetUserProfileImageRequest.md @@ -0,0 +1,9 @@ +# SetUserProfileImageRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to update the profile image for | +| `requestBody` | [com.clerk.backend_api.models.operations.SetUserProfileImageRequestBody](../../models/operations/SetUserProfileImageRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/SetUserProfileImageRequestBody.md b/docs/models/operations/SetUserProfileImageRequestBody.md new file mode 100644 index 0000000..239694c --- /dev/null +++ b/docs/models/operations/SetUserProfileImageRequestBody.md @@ -0,0 +1,8 @@ +# SetUserProfileImageRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `file` | [Optional](../../models/operations/File.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/SetUserProfileImageResponse.md b/docs/models/operations/SetUserProfileImageResponse.md new file mode 100644 index 0000000..8116cbb --- /dev/null +++ b/docs/models/operations/SetUserProfileImageResponse.md @@ -0,0 +1,11 @@ +# SetUserProfileImageResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/Status.md b/docs/models/operations/Status.md new file mode 100644 index 0000000..8d6cf58 --- /dev/null +++ b/docs/models/operations/Status.md @@ -0,0 +1,16 @@ +# Status + +Filter sessions by the provided status + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ABANDONED` | abandoned | +| `ACTIVE` | active | +| `ENDED` | ended | +| `EXPIRED` | expired | +| `REMOVED` | removed | +| `REPLACED` | replaced | +| `REVOKED` | revoked | \ No newline at end of file diff --git a/docs/models/operations/TemplateType.md b/docs/models/operations/TemplateType.md new file mode 100644 index 0000000..cabd96a --- /dev/null +++ b/docs/models/operations/TemplateType.md @@ -0,0 +1,11 @@ +# TemplateType + +The type of templates to list (email or SMS) + + +## Values + +| Name | Value | +| ------- | ------- | +| `EMAIL` | email | +| `SMS` | sms | \ No newline at end of file diff --git a/docs/models/operations/ToggleTemplateDeliveryPathParamTemplateType.md b/docs/models/operations/ToggleTemplateDeliveryPathParamTemplateType.md new file mode 100644 index 0000000..11aebaf --- /dev/null +++ b/docs/models/operations/ToggleTemplateDeliveryPathParamTemplateType.md @@ -0,0 +1,11 @@ +# ToggleTemplateDeliveryPathParamTemplateType + +The type of template to toggle delivery for + + +## Values + +| Name | Value | +| ------- | ------- | +| `EMAIL` | email | +| `SMS` | sms | \ No newline at end of file diff --git a/docs/models/operations/ToggleTemplateDeliveryRequest.md b/docs/models/operations/ToggleTemplateDeliveryRequest.md new file mode 100644 index 0000000..e2fb194 --- /dev/null +++ b/docs/models/operations/ToggleTemplateDeliveryRequest.md @@ -0,0 +1,10 @@ +# ToggleTemplateDeliveryRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.ToggleTemplateDeliveryPathParamTemplateType](../../models/operations/ToggleTemplateDeliveryPathParamTemplateType.md) | :heavy_check_mark: | The type of template to toggle delivery for | +| `slug` | *String* | :heavy_check_mark: | The slug of the template for which to toggle delivery | +| `requestBody` | [Optional](../../models/operations/ToggleTemplateDeliveryRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/ToggleTemplateDeliveryRequestBody.md b/docs/models/operations/ToggleTemplateDeliveryRequestBody.md new file mode 100644 index 0000000..f7a4211 --- /dev/null +++ b/docs/models/operations/ToggleTemplateDeliveryRequestBody.md @@ -0,0 +1,8 @@ +# ToggleTemplateDeliveryRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `deliveredByClerk` | *JsonNullable* | :heavy_minus_sign: | Whether Clerk should deliver emails or SMS messages based on the current template | \ No newline at end of file diff --git a/docs/models/operations/ToggleTemplateDeliveryResponse.md b/docs/models/operations/ToggleTemplateDeliveryResponse.md new file mode 100644 index 0000000..1fcbd31 --- /dev/null +++ b/docs/models/operations/ToggleTemplateDeliveryResponse.md @@ -0,0 +1,11 @@ +# ToggleTemplateDeliveryResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `template` | [Optional](../../models/components/Template.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UnbanUserRequest.md b/docs/models/operations/UnbanUserRequest.md new file mode 100644 index 0000000..dc12e69 --- /dev/null +++ b/docs/models/operations/UnbanUserRequest.md @@ -0,0 +1,8 @@ +# UnbanUserRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to unban | \ No newline at end of file diff --git a/docs/models/operations/UnbanUserResponse.md b/docs/models/operations/UnbanUserResponse.md new file mode 100644 index 0000000..c2f5bdd --- /dev/null +++ b/docs/models/operations/UnbanUserResponse.md @@ -0,0 +1,11 @@ +# UnbanUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UnlockUserRequest.md b/docs/models/operations/UnlockUserRequest.md new file mode 100644 index 0000000..aae5a36 --- /dev/null +++ b/docs/models/operations/UnlockUserRequest.md @@ -0,0 +1,8 @@ +# UnlockUserRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to unlock | \ No newline at end of file diff --git a/docs/models/operations/UnlockUserResponse.md b/docs/models/operations/UnlockUserResponse.md new file mode 100644 index 0000000..5e64db5 --- /dev/null +++ b/docs/models/operations/UnlockUserResponse.md @@ -0,0 +1,11 @@ +# UnlockUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UnsafeMetadata.md b/docs/models/operations/UnsafeMetadata.md new file mode 100644 index 0000000..6415331 --- /dev/null +++ b/docs/models/operations/UnsafeMetadata.md @@ -0,0 +1,10 @@ +# UnsafeMetadata + +Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. +Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UpdateDomainRequest.md b/docs/models/operations/UpdateDomainRequest.md new file mode 100644 index 0000000..cb615e2 --- /dev/null +++ b/docs/models/operations/UpdateDomainRequest.md @@ -0,0 +1,9 @@ +# UpdateDomainRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `domainId` | *String* | :heavy_check_mark: | The ID of the domain that will be updated. | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateDomainRequestBody](../../models/operations/UpdateDomainRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateDomainRequestBody.md b/docs/models/operations/UpdateDomainRequestBody.md new file mode 100644 index 0000000..d3b9d5a --- /dev/null +++ b/docs/models/operations/UpdateDomainRequestBody.md @@ -0,0 +1,9 @@ +# UpdateDomainRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *JsonNullable* | :heavy_minus_sign: | The new domain name. For development instances, can contain the port,
i.e `myhostname:3000`. For production instances, must be a valid FQDN,
i.e `mysite.com`. Cannot contain protocol scheme. | +| `proxyUrl` | *JsonNullable* | :heavy_minus_sign: | The full URL of the proxy that will forward requests to Clerk's Frontend API.
Can only be updated for production instances. | \ No newline at end of file diff --git a/docs/models/operations/UpdateDomainResponse.md b/docs/models/operations/UpdateDomainResponse.md new file mode 100644 index 0000000..c6d7df3 --- /dev/null +++ b/docs/models/operations/UpdateDomainResponse.md @@ -0,0 +1,11 @@ +# UpdateDomainResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `domain` | [Optional](../../models/components/Domain.md) | :heavy_minus_sign: | A domain | \ No newline at end of file diff --git a/docs/models/operations/UpdateEmailAddressRequest.md b/docs/models/operations/UpdateEmailAddressRequest.md new file mode 100644 index 0000000..58e04bb --- /dev/null +++ b/docs/models/operations/UpdateEmailAddressRequest.md @@ -0,0 +1,9 @@ +# UpdateEmailAddressRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `emailAddressId` | *String* | :heavy_check_mark: | The ID of the email address to update | +| `requestBody` | [Optional](../../models/operations/UpdateEmailAddressRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateEmailAddressRequestBody.md b/docs/models/operations/UpdateEmailAddressRequestBody.md new file mode 100644 index 0000000..eb66d8d --- /dev/null +++ b/docs/models/operations/UpdateEmailAddressRequestBody.md @@ -0,0 +1,9 @@ +# UpdateEmailAddressRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `verified` | *JsonNullable* | :heavy_minus_sign: | The email address will be marked as verified. | +| `primary` | *JsonNullable* | :heavy_minus_sign: | Set this email address as the primary email address for the user. | \ No newline at end of file diff --git a/docs/models/operations/UpdateEmailAddressResponse.md b/docs/models/operations/UpdateEmailAddressResponse.md new file mode 100644 index 0000000..bc2f9b8 --- /dev/null +++ b/docs/models/operations/UpdateEmailAddressResponse.md @@ -0,0 +1,11 @@ +# UpdateEmailAddressResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `emailAddress` | [Optional](../../models/components/EmailAddress.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateInstanceAuthConfigRequestBody.md b/docs/models/operations/UpdateInstanceAuthConfigRequestBody.md new file mode 100644 index 0000000..194f066 --- /dev/null +++ b/docs/models/operations/UpdateInstanceAuthConfigRequestBody.md @@ -0,0 +1,13 @@ +# UpdateInstanceAuthConfigRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `restrictedToAllowlist` | *JsonNullable* | :heavy_minus_sign: | Whether sign up is restricted to email addresses, phone numbers and usernames that are on the allowlist. | +| `fromEmailAddress` | *JsonNullable* | :heavy_minus_sign: | The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent.
Only alphanumeric values are allowed.
Note that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`). | +| `progressiveSignUp` | *JsonNullable* | :heavy_minus_sign: | Enable the Progressive Sign Up algorithm. Refer to the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) for more info. | +| `sessionTokenTemplate` | *JsonNullable* | :heavy_minus_sign: | The name of the JWT Template used to augment your session tokens. To disable this, pass an empty string. | +| `enhancedEmailDeliverability` | *JsonNullable* | :heavy_minus_sign: | The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain.
This can be helpful if you do not have a high domain reputation. | +| `testMode` | *JsonNullable* | :heavy_minus_sign: | Toggles test mode for this instance, allowing the use of test email addresses and phone numbers.
Defaults to true for development instances. | \ No newline at end of file diff --git a/docs/models/operations/UpdateInstanceAuthConfigResponse.md b/docs/models/operations/UpdateInstanceAuthConfigResponse.md new file mode 100644 index 0000000..eef6deb --- /dev/null +++ b/docs/models/operations/UpdateInstanceAuthConfigResponse.md @@ -0,0 +1,11 @@ +# UpdateInstanceAuthConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `instanceSettings` | [Optional](../../models/components/InstanceSettings.md) | :heavy_minus_sign: | InstanceSettings Server API | \ No newline at end of file diff --git a/docs/models/operations/UpdateInstanceOrganizationSettingsRequestBody.md b/docs/models/operations/UpdateInstanceOrganizationSettingsRequestBody.md new file mode 100644 index 0000000..4464f4b --- /dev/null +++ b/docs/models/operations/UpdateInstanceOrganizationSettingsRequestBody.md @@ -0,0 +1,14 @@ +# UpdateInstanceOrganizationSettingsRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `enabled` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `maxAllowedMemberships` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `adminDeleteEnabled` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `domainsEnabled` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `domainsEnrollmentModes` | List<*String*> | :heavy_minus_sign: | Specify which enrollment modes to enable for your Organization Domains.
Supported modes are 'automatic_invitation' & 'automatic_suggestion'. | +| `creatorRoleId` | *Optional* | :heavy_minus_sign: | Specify what the default organization role is for an organization creator. | +| `domainsDefaultRoleId` | *Optional* | :heavy_minus_sign: | Specify what the default organization role is for the organization domains. | \ No newline at end of file diff --git a/docs/models/operations/UpdateInstanceOrganizationSettingsResponse.md b/docs/models/operations/UpdateInstanceOrganizationSettingsResponse.md new file mode 100644 index 0000000..f5bf3bc --- /dev/null +++ b/docs/models/operations/UpdateInstanceOrganizationSettingsResponse.md @@ -0,0 +1,11 @@ +# UpdateInstanceOrganizationSettingsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationSettings` | [Optional](../../models/components/OrganizationSettings.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateInstanceRequestBody.md b/docs/models/operations/UpdateInstanceRequestBody.md new file mode 100644 index 0000000..7868848 --- /dev/null +++ b/docs/models/operations/UpdateInstanceRequestBody.md @@ -0,0 +1,16 @@ +# UpdateInstanceRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `testMode` | *JsonNullable* | :heavy_minus_sign: | Toggles test mode for this instance, allowing the use of test email addresses and phone numbers.
Defaults to true for development instances. | +| `hibp` | *JsonNullable* | :heavy_minus_sign: | Whether the instance should be using the HIBP service to check passwords for breaches | +| `enhancedEmailDeliverability` | *JsonNullable* | :heavy_minus_sign: | The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain.
This can be helpful if you do not have a high domain reputation. | +| `supportEmail` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `clerkJsVersion` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `developmentOrigin` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `allowedOrigins` | List<*String*> | :heavy_minus_sign: | For browser-like stacks such as browser extensions, Electron, or Capacitor.js the instance allowed origins need to be updated with the request origin value.
For Chrome extensions popup, background, or service worker pages the origin is chrome-extension://extension_uiid. For Electron apps the default origin is http://localhost:3000. For Capacitor, the origin is capacitor://localhost. | +| ~~`cookielessDev`~~ | *Optional* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Whether the instance should operate in cookieless development mode (i.e. without third-party cookies).
Deprecated: Please use `url_based_session_syncing` instead. | +| `urlBasedSessionSyncing` | *Optional* | :heavy_minus_sign: | Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies). | \ No newline at end of file diff --git a/docs/models/operations/UpdateInstanceResponse.md b/docs/models/operations/UpdateInstanceResponse.md new file mode 100644 index 0000000..0994d8b --- /dev/null +++ b/docs/models/operations/UpdateInstanceResponse.md @@ -0,0 +1,10 @@ +# UpdateInstanceResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/UpdateInstanceRestrictionsRequestBody.md b/docs/models/operations/UpdateInstanceRestrictionsRequestBody.md new file mode 100644 index 0000000..19cf748 --- /dev/null +++ b/docs/models/operations/UpdateInstanceRestrictionsRequestBody.md @@ -0,0 +1,12 @@ +# UpdateInstanceRestrictionsRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `allowlist` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `blocklist` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `blockEmailSubaddresses` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `blockDisposableEmailDomains` | *JsonNullable* | :heavy_minus_sign: | N/A | +| `ignoreDotsForGmailAddresses` | *JsonNullable* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateInstanceRestrictionsResponse.md b/docs/models/operations/UpdateInstanceRestrictionsResponse.md new file mode 100644 index 0000000..afa22e4 --- /dev/null +++ b/docs/models/operations/UpdateInstanceRestrictionsResponse.md @@ -0,0 +1,11 @@ +# UpdateInstanceRestrictionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `instanceRestrictions` | [Optional](../../models/components/InstanceRestrictions.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateJWTTemplateClaims.md b/docs/models/operations/UpdateJWTTemplateClaims.md new file mode 100644 index 0000000..554249b --- /dev/null +++ b/docs/models/operations/UpdateJWTTemplateClaims.md @@ -0,0 +1,9 @@ +# UpdateJWTTemplateClaims + +JWT template claims in JSON format + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UpdateJWTTemplateRequest.md b/docs/models/operations/UpdateJWTTemplateRequest.md new file mode 100644 index 0000000..5540acc --- /dev/null +++ b/docs/models/operations/UpdateJWTTemplateRequest.md @@ -0,0 +1,9 @@ +# UpdateJWTTemplateRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateId` | *String* | :heavy_check_mark: | The ID of the JWT template to update | +| `requestBody` | [Optional](../../models/operations/UpdateJWTTemplateRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateJWTTemplateRequestBody.md b/docs/models/operations/UpdateJWTTemplateRequestBody.md new file mode 100644 index 0000000..62eb52e --- /dev/null +++ b/docs/models/operations/UpdateJWTTemplateRequestBody.md @@ -0,0 +1,14 @@ +# UpdateJWTTemplateRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *Optional* | :heavy_minus_sign: | JWT template name | +| `claims` | [Optional](../../models/operations/UpdateJWTTemplateClaims.md) | :heavy_minus_sign: | JWT template claims in JSON format | +| `lifetime` | *JsonNullable* | :heavy_minus_sign: | JWT token lifetime | +| `allowedClockSkew` | *JsonNullable* | :heavy_minus_sign: | JWT token allowed clock skew | +| `customSigningKey` | *Optional* | :heavy_minus_sign: | Whether a custom signing key/algorithm is also provided for this template | +| `signingAlgorithm` | *JsonNullable* | :heavy_minus_sign: | The custom signing algorithm to use when minting JWTs | +| `signingKey` | *JsonNullable* | :heavy_minus_sign: | The custom signing private key to use when minting JWTs | \ No newline at end of file diff --git a/docs/models/operations/UpdateJWTTemplateResponse.md b/docs/models/operations/UpdateJWTTemplateResponse.md new file mode 100644 index 0000000..21a571d --- /dev/null +++ b/docs/models/operations/UpdateJWTTemplateResponse.md @@ -0,0 +1,11 @@ +# UpdateJWTTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `jwtTemplate` | [Optional](../../models/components/JWTTemplate.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateOAuthApplicationRequest.md b/docs/models/operations/UpdateOAuthApplicationRequest.md new file mode 100644 index 0000000..90dc7c2 --- /dev/null +++ b/docs/models/operations/UpdateOAuthApplicationRequest.md @@ -0,0 +1,9 @@ +# UpdateOAuthApplicationRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `oauthApplicationId` | *String* | :heavy_check_mark: | The ID of the OAuth application to update | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequestBody](../../models/operations/UpdateOAuthApplicationRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateOAuthApplicationRequestBody.md b/docs/models/operations/UpdateOAuthApplicationRequestBody.md new file mode 100644 index 0000000..4889784 --- /dev/null +++ b/docs/models/operations/UpdateOAuthApplicationRequestBody.md @@ -0,0 +1,10 @@ +# UpdateOAuthApplicationRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *Optional* | :heavy_minus_sign: | The new name of the OAuth application | | +| `callbackUrl` | *Optional* | :heavy_minus_sign: | The new callback URL of the OAuth application | | +| `scopes` | *Optional* | :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 private_metadata | \ No newline at end of file diff --git a/docs/models/operations/UpdateOAuthApplicationResponse.md b/docs/models/operations/UpdateOAuthApplicationResponse.md new file mode 100644 index 0000000..14ceb93 --- /dev/null +++ b/docs/models/operations/UpdateOAuthApplicationResponse.md @@ -0,0 +1,11 @@ +# UpdateOAuthApplicationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `oAuthApplication` | [Optional](../../models/components/OAuthApplication.md) | :heavy_minus_sign: | An OAuth application | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.md b/docs/models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.md new file mode 100644 index 0000000..8fae50e --- /dev/null +++ b/docs/models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.md @@ -0,0 +1,10 @@ +# UpdateOrganizationMembershipMetadataPrivateMetadata + +Metadata saved on the organization membership that is only visible to your backend. +The new object will be merged with the existing value. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.md b/docs/models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.md new file mode 100644 index 0000000..dc1db80 --- /dev/null +++ b/docs/models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.md @@ -0,0 +1,10 @@ +# UpdateOrganizationMembershipMetadataPublicMetadata + +Metadata saved on the organization membership, that is visible to both your frontend and backend. +The new object will be merged with the existing value. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationMembershipMetadataRequest.md b/docs/models/operations/UpdateOrganizationMembershipMetadataRequest.md new file mode 100644 index 0000000..5b1d08a --- /dev/null +++ b/docs/models/operations/UpdateOrganizationMembershipMetadataRequest.md @@ -0,0 +1,10 @@ +# UpdateOrganizationMembershipMetadataRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization the membership belongs to | +| `userId` | *String* | :heavy_check_mark: | The ID of the user that this membership belongs to | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequestBody](../../models/operations/UpdateOrganizationMembershipMetadataRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationMembershipMetadataRequestBody.md b/docs/models/operations/UpdateOrganizationMembershipMetadataRequestBody.md new file mode 100644 index 0000000..0ea6634 --- /dev/null +++ b/docs/models/operations/UpdateOrganizationMembershipMetadataRequestBody.md @@ -0,0 +1,9 @@ +# UpdateOrganizationMembershipMetadataRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `publicMetadata` | [Optional](../../models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization membership, that is visible to both your frontend and backend.
The new object will be merged with the existing value. | +| `privateMetadata` | [Optional](../../models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization membership that is only visible to your backend.
The new object will be merged with the existing value. | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationMembershipMetadataResponse.md b/docs/models/operations/UpdateOrganizationMembershipMetadataResponse.md new file mode 100644 index 0000000..7527fba --- /dev/null +++ b/docs/models/operations/UpdateOrganizationMembershipMetadataResponse.md @@ -0,0 +1,11 @@ +# UpdateOrganizationMembershipMetadataResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationMembership` | [Optional](../../models/components/OrganizationMembership.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationMembershipRequest.md b/docs/models/operations/UpdateOrganizationMembershipRequest.md new file mode 100644 index 0000000..2b4ceca --- /dev/null +++ b/docs/models/operations/UpdateOrganizationMembershipRequest.md @@ -0,0 +1,10 @@ +# UpdateOrganizationMembershipRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization the membership belongs to | +| `userId` | *String* | :heavy_check_mark: | The ID of the user that this membership belongs to | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequestBody](../../models/operations/UpdateOrganizationMembershipRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationMembershipRequestBody.md b/docs/models/operations/UpdateOrganizationMembershipRequestBody.md new file mode 100644 index 0000000..46ff5b9 --- /dev/null +++ b/docs/models/operations/UpdateOrganizationMembershipRequestBody.md @@ -0,0 +1,8 @@ +# UpdateOrganizationMembershipRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `role` | *String* | :heavy_check_mark: | The new role of the given membership. | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationMembershipResponse.md b/docs/models/operations/UpdateOrganizationMembershipResponse.md new file mode 100644 index 0000000..9e1a948 --- /dev/null +++ b/docs/models/operations/UpdateOrganizationMembershipResponse.md @@ -0,0 +1,11 @@ +# UpdateOrganizationMembershipResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationMembership` | [Optional](../../models/components/OrganizationMembership.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationPrivateMetadata.md b/docs/models/operations/UpdateOrganizationPrivateMetadata.md new file mode 100644 index 0000000..b095281 --- /dev/null +++ b/docs/models/operations/UpdateOrganizationPrivateMetadata.md @@ -0,0 +1,9 @@ +# UpdateOrganizationPrivateMetadata + +Metadata saved on the organization that is only visible to your backend. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationPublicMetadata.md b/docs/models/operations/UpdateOrganizationPublicMetadata.md new file mode 100644 index 0000000..a83dfeb --- /dev/null +++ b/docs/models/operations/UpdateOrganizationPublicMetadata.md @@ -0,0 +1,9 @@ +# UpdateOrganizationPublicMetadata + +Metadata saved on the organization, that is visible to both your frontend and backend. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationRequest.md b/docs/models/operations/UpdateOrganizationRequest.md new file mode 100644 index 0000000..2c5087d --- /dev/null +++ b/docs/models/operations/UpdateOrganizationRequest.md @@ -0,0 +1,9 @@ +# UpdateOrganizationRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization to update | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateOrganizationRequestBody](../../models/operations/UpdateOrganizationRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationRequestBody.md b/docs/models/operations/UpdateOrganizationRequestBody.md new file mode 100644 index 0000000..7c98239 --- /dev/null +++ b/docs/models/operations/UpdateOrganizationRequestBody.md @@ -0,0 +1,13 @@ +# UpdateOrganizationRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `publicMetadata` | [Optional](../../models/operations/UpdateOrganizationPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization, that is visible to both your frontend and backend. | +| `privateMetadata` | [Optional](../../models/operations/UpdateOrganizationPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the organization that is only visible to your backend. | +| `name` | *JsonNullable* | :heavy_minus_sign: | The new name of the organization | +| `slug` | *JsonNullable* | :heavy_minus_sign: | The new slug of the organization, which needs to be unique in the instance | +| `maxAllowedMemberships` | *JsonNullable* | :heavy_minus_sign: | The maximum number of memberships allowed for this organization | +| `adminDeleteEnabled` | *JsonNullable* | :heavy_minus_sign: | If true, an admin can delete this organization with the Frontend API. | \ No newline at end of file diff --git a/docs/models/operations/UpdateOrganizationResponse.md b/docs/models/operations/UpdateOrganizationResponse.md new file mode 100644 index 0000000..2db9090 --- /dev/null +++ b/docs/models/operations/UpdateOrganizationResponse.md @@ -0,0 +1,11 @@ +# UpdateOrganizationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organization` | [Optional](../../models/components/Organization.md) | :heavy_minus_sign: | An organization | \ No newline at end of file diff --git a/docs/models/operations/UpdatePhoneNumberRequest.md b/docs/models/operations/UpdatePhoneNumberRequest.md new file mode 100644 index 0000000..e566d5b --- /dev/null +++ b/docs/models/operations/UpdatePhoneNumberRequest.md @@ -0,0 +1,9 @@ +# UpdatePhoneNumberRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `phoneNumberId` | *String* | :heavy_check_mark: | The ID of the phone number to update | +| `requestBody` | [Optional](../../models/operations/UpdatePhoneNumberRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdatePhoneNumberRequestBody.md b/docs/models/operations/UpdatePhoneNumberRequestBody.md new file mode 100644 index 0000000..50ab521 --- /dev/null +++ b/docs/models/operations/UpdatePhoneNumberRequestBody.md @@ -0,0 +1,10 @@ +# UpdatePhoneNumberRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verified` | *JsonNullable* | :heavy_minus_sign: | The phone number will be marked as verified. | +| `primary` | *JsonNullable* | :heavy_minus_sign: | Set this phone number as the primary phone number for the user. | +| `reservedForSecondFactor` | *JsonNullable* | :heavy_minus_sign: | Set this phone number as reserved for multi-factor authentication.
The phone number must also be verified.
If there are no other reserved second factors, the phone number will be set as the default second factor. | \ No newline at end of file diff --git a/docs/models/operations/UpdatePhoneNumberResponse.md b/docs/models/operations/UpdatePhoneNumberResponse.md new file mode 100644 index 0000000..0c04f50 --- /dev/null +++ b/docs/models/operations/UpdatePhoneNumberResponse.md @@ -0,0 +1,11 @@ +# UpdatePhoneNumberResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `phoneNumber` | [Optional](../../models/components/PhoneNumber.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateProductionInstanceDomainRequestBody.md b/docs/models/operations/UpdateProductionInstanceDomainRequestBody.md new file mode 100644 index 0000000..dfb8fea --- /dev/null +++ b/docs/models/operations/UpdateProductionInstanceDomainRequestBody.md @@ -0,0 +1,8 @@ +# UpdateProductionInstanceDomainRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `homeUrl` | *Optional* | :heavy_minus_sign: | The new home URL of the production instance e.g. https://www.example.com | \ No newline at end of file diff --git a/docs/models/operations/UpdateProductionInstanceDomainResponse.md b/docs/models/operations/UpdateProductionInstanceDomainResponse.md new file mode 100644 index 0000000..af88a52 --- /dev/null +++ b/docs/models/operations/UpdateProductionInstanceDomainResponse.md @@ -0,0 +1,10 @@ +# UpdateProductionInstanceDomainResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/UpdateSAMLConnectionAttributeMapping.md b/docs/models/operations/UpdateSAMLConnectionAttributeMapping.md new file mode 100644 index 0000000..36ceeb3 --- /dev/null +++ b/docs/models/operations/UpdateSAMLConnectionAttributeMapping.md @@ -0,0 +1,13 @@ +# UpdateSAMLConnectionAttributeMapping + +Define the atrtibute name mapping between Identity Provider and Clerk's user properties + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `userId` | *Optional* | :heavy_minus_sign: | N/A | +| `emailAddress` | *Optional* | :heavy_minus_sign: | N/A | +| `firstName` | *Optional* | :heavy_minus_sign: | N/A | +| `lastName` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateSAMLConnectionRequest.md b/docs/models/operations/UpdateSAMLConnectionRequest.md new file mode 100644 index 0000000..786ab81 --- /dev/null +++ b/docs/models/operations/UpdateSAMLConnectionRequest.md @@ -0,0 +1,9 @@ +# UpdateSAMLConnectionRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection to update | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBody](../../models/operations/UpdateSAMLConnectionRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateSAMLConnectionRequestBody.md b/docs/models/operations/UpdateSAMLConnectionRequestBody.md new file mode 100644 index 0000000..d12ae89 --- /dev/null +++ b/docs/models/operations/UpdateSAMLConnectionRequestBody.md @@ -0,0 +1,19 @@ +# UpdateSAMLConnectionRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *JsonNullable* | :heavy_minus_sign: | The name of the new SAML Connection | +| `domain` | *JsonNullable* | :heavy_minus_sign: | The domain to use for the new SAML Connection | +| `idpEntityId` | *JsonNullable* | :heavy_minus_sign: | The entity id as provided by the IdP | +| `idpSsoUrl` | *JsonNullable* | :heavy_minus_sign: | The SSO url as provided by the IdP | +| `idpCertificate` | *JsonNullable* | :heavy_minus_sign: | The x509 certificated as provided by the IdP | +| `idpMetadataUrl` | *JsonNullable* | :heavy_minus_sign: | The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them | +| `idpMetadata` | *JsonNullable* | :heavy_minus_sign: | The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties | +| `attributeMapping` | [JsonNullable](../../models/operations/UpdateSAMLConnectionAttributeMapping.md) | :heavy_minus_sign: | Define the atrtibute name mapping between Identity Provider and Clerk's user properties | +| `active` | *JsonNullable* | :heavy_minus_sign: | Activate or de-activate the SAML Connection | +| `syncUserAttributes` | *JsonNullable* | :heavy_minus_sign: | Controls whether to update the user's attributes in each sign-in | +| `allowSubdomains` | *JsonNullable* | :heavy_minus_sign: | Allow users with an email address subdomain to use this connection in order to authenticate | +| `allowIdpInitiated` | *JsonNullable* | :heavy_minus_sign: | Enable or deactivate IdP-initiated flows | \ No newline at end of file diff --git a/docs/models/operations/UpdateSAMLConnectionResponse.md b/docs/models/operations/UpdateSAMLConnectionResponse.md new file mode 100644 index 0000000..164e347 --- /dev/null +++ b/docs/models/operations/UpdateSAMLConnectionResponse.md @@ -0,0 +1,11 @@ +# UpdateSAMLConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `samlConnection` | [Optional](../../models/components/SAMLConnection.md) | :heavy_minus_sign: | A SAML Connection | \ No newline at end of file diff --git a/docs/models/operations/UpdateSignUpRequest.md b/docs/models/operations/UpdateSignUpRequest.md new file mode 100644 index 0000000..8c69766 --- /dev/null +++ b/docs/models/operations/UpdateSignUpRequest.md @@ -0,0 +1,9 @@ +# UpdateSignUpRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The ID of the sign-up to update | +| `requestBody` | [Optional](../../models/operations/UpdateSignUpRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateSignUpRequestBody.md b/docs/models/operations/UpdateSignUpRequestBody.md new file mode 100644 index 0000000..a072f44 --- /dev/null +++ b/docs/models/operations/UpdateSignUpRequestBody.md @@ -0,0 +1,9 @@ +# UpdateSignUpRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `customAction` | *Optional* | :heavy_minus_sign: | Specifies whether a custom action has run for this sign-up attempt.
This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user.
After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. | +| `externalId` | *JsonNullable* | :heavy_minus_sign: | The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution.
This will be copied to the resulting user when the sign-up is completed. | \ No newline at end of file diff --git a/docs/models/operations/UpdateSignUpResponse.md b/docs/models/operations/UpdateSignUpResponse.md new file mode 100644 index 0000000..93490a5 --- /dev/null +++ b/docs/models/operations/UpdateSignUpResponse.md @@ -0,0 +1,11 @@ +# UpdateSignUpResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `signUp` | [Optional](../../models/components/SignUp.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateUserMetadataPrivateMetadata.md b/docs/models/operations/UpdateUserMetadataPrivateMetadata.md new file mode 100644 index 0000000..628afe0 --- /dev/null +++ b/docs/models/operations/UpdateUserMetadataPrivateMetadata.md @@ -0,0 +1,10 @@ +# UpdateUserMetadataPrivateMetadata + +Metadata saved on the user that is only visible to your backend. +The new object will be merged with the existing value. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UpdateUserMetadataPublicMetadata.md b/docs/models/operations/UpdateUserMetadataPublicMetadata.md new file mode 100644 index 0000000..2759779 --- /dev/null +++ b/docs/models/operations/UpdateUserMetadataPublicMetadata.md @@ -0,0 +1,10 @@ +# UpdateUserMetadataPublicMetadata + +Metadata saved on the user, that is visible to both your frontend and backend. +The new object will be merged with the existing value. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UpdateUserMetadataRequest.md b/docs/models/operations/UpdateUserMetadataRequest.md new file mode 100644 index 0000000..6dc1006 --- /dev/null +++ b/docs/models/operations/UpdateUserMetadataRequest.md @@ -0,0 +1,9 @@ +# UpdateUserMetadataRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user whose metadata will be updated and merged | +| `requestBody` | [Optional](../../models/operations/UpdateUserMetadataRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpdateUserMetadataRequestBody.md b/docs/models/operations/UpdateUserMetadataRequestBody.md new file mode 100644 index 0000000..08d977c --- /dev/null +++ b/docs/models/operations/UpdateUserMetadataRequestBody.md @@ -0,0 +1,10 @@ +# UpdateUserMetadataRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `publicMetadata` | [Optional](../../models/operations/UpdateUserMetadataPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your frontend and backend.
The new object will be merged with the existing value. | +| `privateMetadata` | [Optional](../../models/operations/UpdateUserMetadataPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the user that is only visible to your backend.
The new object will be merged with the existing value. | +| `unsafeMetadata` | [Optional](../../models/operations/UpdateUserMetadataUnsafeMetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
The new object will be merged with the existing value.

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

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

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

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

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

`$$$`

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

`bcrypt_sha256$$$$`

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

`5f4dcc3b5aa765d61d8327deb882cf99`

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

`pbkdf2_sha256$$$`

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

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

`pbkdf2_sha512$$$`

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

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

`pbkdf2_sha256$$$`

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

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

The format is the following:

`pbkdf2_sha1$$$`

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

The format is the following:

`$P$`

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

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

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

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

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

`$$$$$`

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

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

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

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

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

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

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

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

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

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

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

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

`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` | +| `skipPasswordChecks` | *JsonNullable* | :heavy_minus_sign: | Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. | +| `signOutOfOtherSessions` | *JsonNullable* | :heavy_minus_sign: | Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. | +| `totpSecret` | *Optional* | :heavy_minus_sign: | In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it.
Please note that currently the supported options are:
* Period: 30 seconds
* Code length: 6 digits
* Algorithm: SHA1 | +| `backupCodes` | List<*String*> | :heavy_minus_sign: | If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them.
You must provide the backup codes in plain format or the corresponding bcrypt digest. | +| `publicMetadata` | [Optional](../../models/operations/UpdateUserPublicMetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is visible to both your Frontend and Backend APIs | +| `privateMetadata` | [Optional](../../models/operations/UpdateUserPrivateMetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that is only visible to your Backend API | +| `unsafeMetadata` | [Optional](../../models/operations/UpdateUserUnsafeMetadata.md) | :heavy_minus_sign: | Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. | +| `deleteSelfEnabled` | *JsonNullable* | :heavy_minus_sign: | If true, the user can delete themselves with the Frontend API. | +| `createOrganizationEnabled` | *JsonNullable* | :heavy_minus_sign: | If true, the user can create organizations with the Frontend API. | +| `createdAt` | *Optional* | :heavy_minus_sign: | A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). | \ No newline at end of file diff --git a/docs/models/operations/UpdateUserResponse.md b/docs/models/operations/UpdateUserResponse.md new file mode 100644 index 0000000..f35334e --- /dev/null +++ b/docs/models/operations/UpdateUserResponse.md @@ -0,0 +1,11 @@ +# UpdateUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `user` | [Optional](../../models/components/User.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UpdateUserUnsafeMetadata.md b/docs/models/operations/UpdateUserUnsafeMetadata.md new file mode 100644 index 0000000..1cc911b --- /dev/null +++ b/docs/models/operations/UpdateUserUnsafeMetadata.md @@ -0,0 +1,10 @@ +# UpdateUserUnsafeMetadata + +Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. +Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/UploadOrganizationLogoFile.md b/docs/models/operations/UploadOrganizationLogoFile.md new file mode 100644 index 0000000..22a16bc --- /dev/null +++ b/docs/models/operations/UploadOrganizationLogoFile.md @@ -0,0 +1,9 @@ +# UploadOrganizationLogoFile + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `fileName` | *String* | :heavy_check_mark: | N/A | +| `content` | *byte[]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UploadOrganizationLogoRequest.md b/docs/models/operations/UploadOrganizationLogoRequest.md new file mode 100644 index 0000000..80014a4 --- /dev/null +++ b/docs/models/operations/UploadOrganizationLogoRequest.md @@ -0,0 +1,9 @@ +# UploadOrganizationLogoRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization for which to upload a logo | +| `requestBody` | [Optional](../../models/operations/UploadOrganizationLogoRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UploadOrganizationLogoRequestBody.md b/docs/models/operations/UploadOrganizationLogoRequestBody.md new file mode 100644 index 0000000..ca110fc --- /dev/null +++ b/docs/models/operations/UploadOrganizationLogoRequestBody.md @@ -0,0 +1,9 @@ +# UploadOrganizationLogoRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `uploaderUserId` | *String* | :heavy_check_mark: | The ID of the user that will be credited with the image upload. | +| `file` | [com.clerk.backend_api.models.operations.UploadOrganizationLogoFile](../../models/operations/UploadOrganizationLogoFile.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UploadOrganizationLogoResponse.md b/docs/models/operations/UploadOrganizationLogoResponse.md new file mode 100644 index 0000000..03dc8ed --- /dev/null +++ b/docs/models/operations/UploadOrganizationLogoResponse.md @@ -0,0 +1,11 @@ +# UploadOrganizationLogoResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationWithLogo` | [Optional](../../models/components/OrganizationWithLogo.md) | :heavy_minus_sign: | An organization with a logo URL. | \ No newline at end of file diff --git a/docs/models/operations/UpsertTemplatePathParamTemplateType.md b/docs/models/operations/UpsertTemplatePathParamTemplateType.md new file mode 100644 index 0000000..347c260 --- /dev/null +++ b/docs/models/operations/UpsertTemplatePathParamTemplateType.md @@ -0,0 +1,11 @@ +# UpsertTemplatePathParamTemplateType + +The type of template to update + + +## Values + +| Name | Value | +| ------- | ------- | +| `EMAIL` | email | +| `SMS` | sms | \ No newline at end of file diff --git a/docs/models/operations/UpsertTemplateRequest.md b/docs/models/operations/UpsertTemplateRequest.md new file mode 100644 index 0000000..9a6ccd2 --- /dev/null +++ b/docs/models/operations/UpsertTemplateRequest.md @@ -0,0 +1,10 @@ +# UpsertTemplateRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.UpsertTemplatePathParamTemplateType](../../models/operations/UpsertTemplatePathParamTemplateType.md) | :heavy_check_mark: | The type of template to update | +| `slug` | *String* | :heavy_check_mark: | The slug of the template to update | +| `requestBody` | [Optional](../../models/operations/UpsertTemplateRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/UpsertTemplateRequestBody.md b/docs/models/operations/UpsertTemplateRequestBody.md new file mode 100644 index 0000000..7f8bdb1 --- /dev/null +++ b/docs/models/operations/UpsertTemplateRequestBody.md @@ -0,0 +1,14 @@ +# UpsertTemplateRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *Optional* | :heavy_minus_sign: | The user-friendly name of the template | +| `subject` | *JsonNullable* | :heavy_minus_sign: | The email subject.
Applicable only to email templates. | +| `markup` | *JsonNullable* | :heavy_minus_sign: | The editor markup used to generate the body of the template | +| `body` | *Optional* | :heavy_minus_sign: | The template body before variable interpolation | +| `deliveredByClerk` | *JsonNullable* | :heavy_minus_sign: | Whether Clerk should deliver emails or SMS messages based on the current template | +| `fromEmailName` | *Optional* | :heavy_minus_sign: | The local part of the From email address that will be used for emails.
For example, in the address 'hello@example.com', the local part is 'hello'.
Applicable only to email templates. | +| `replyToEmailName` | *Optional* | :heavy_minus_sign: | The local part of the Reply To email address that will be used for emails.
For example, in the address 'hello@example.com', the local part is 'hello'.
Applicable only to email templates. | \ No newline at end of file diff --git a/docs/models/operations/UpsertTemplateResponse.md b/docs/models/operations/UpsertTemplateResponse.md new file mode 100644 index 0000000..7029c62 --- /dev/null +++ b/docs/models/operations/UpsertTemplateResponse.md @@ -0,0 +1,11 @@ +# UpsertTemplateResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `template` | [Optional](../../models/components/Template.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/UsersGetOrganizationMembershipsRequest.md b/docs/models/operations/UsersGetOrganizationMembershipsRequest.md new file mode 100644 index 0000000..fcb358a --- /dev/null +++ b/docs/models/operations/UsersGetOrganizationMembershipsRequest.md @@ -0,0 +1,10 @@ +# UsersGetOrganizationMembershipsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user whose organization memberships we want to retrieve | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | \ No newline at end of file diff --git a/docs/models/operations/UsersGetOrganizationMembershipsResponse.md b/docs/models/operations/UsersGetOrganizationMembershipsResponse.md new file mode 100644 index 0000000..f3df469 --- /dev/null +++ b/docs/models/operations/UsersGetOrganizationMembershipsResponse.md @@ -0,0 +1,11 @@ +# UsersGetOrganizationMembershipsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `organizationMemberships` | [Optional](../../models/components/OrganizationMemberships.md) | :heavy_minus_sign: | A list of organization memberships | \ No newline at end of file diff --git a/docs/models/operations/VerifyClientRequestBody.md b/docs/models/operations/VerifyClientRequestBody.md new file mode 100644 index 0000000..7bdd607 --- /dev/null +++ b/docs/models/operations/VerifyClientRequestBody.md @@ -0,0 +1,10 @@ +# VerifyClientRequestBody + +Parameters. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `token` | *Optional* | :heavy_minus_sign: | A JWT Token that represents the active client. | \ No newline at end of file diff --git a/docs/models/operations/VerifyClientResponse.md b/docs/models/operations/VerifyClientResponse.md new file mode 100644 index 0000000..b0b2667 --- /dev/null +++ b/docs/models/operations/VerifyClientResponse.md @@ -0,0 +1,11 @@ +# VerifyClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `client` | [Optional](../../models/components/Client.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/VerifyDomainProxyRequestBody.md b/docs/models/operations/VerifyDomainProxyRequestBody.md new file mode 100644 index 0000000..7e3b33c --- /dev/null +++ b/docs/models/operations/VerifyDomainProxyRequestBody.md @@ -0,0 +1,9 @@ +# VerifyDomainProxyRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `domainId` | *Optional* | :heavy_minus_sign: | The ID of the domain that will be updated. | +| `proxyUrl` | *Optional* | :heavy_minus_sign: | The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. e.g. https://example.com/__clerk | \ No newline at end of file diff --git a/docs/models/operations/VerifyDomainProxyResponse.md b/docs/models/operations/VerifyDomainProxyResponse.md new file mode 100644 index 0000000..656ec9e --- /dev/null +++ b/docs/models/operations/VerifyDomainProxyResponse.md @@ -0,0 +1,11 @@ +# VerifyDomainProxyResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `proxyCheck` | [Optional](../../models/components/ProxyCheck.md) | :heavy_minus_sign: | Health check information about a domain's proxy configuration validation attempt. | \ No newline at end of file diff --git a/docs/models/operations/VerifyPasswordRequest.md b/docs/models/operations/VerifyPasswordRequest.md new file mode 100644 index 0000000..34580b7 --- /dev/null +++ b/docs/models/operations/VerifyPasswordRequest.md @@ -0,0 +1,9 @@ +# VerifyPasswordRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user for whom to verify the password | +| `requestBody` | [Optional](../../models/operations/VerifyPasswordRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/VerifyPasswordRequestBody.md b/docs/models/operations/VerifyPasswordRequestBody.md new file mode 100644 index 0000000..14ddfa0 --- /dev/null +++ b/docs/models/operations/VerifyPasswordRequestBody.md @@ -0,0 +1,8 @@ +# VerifyPasswordRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `password` | *String* | :heavy_check_mark: | The user password to verify | \ No newline at end of file diff --git a/docs/models/operations/VerifyPasswordResponse.md b/docs/models/operations/VerifyPasswordResponse.md new file mode 100644 index 0000000..204234e --- /dev/null +++ b/docs/models/operations/VerifyPasswordResponse.md @@ -0,0 +1,11 @@ +# VerifyPasswordResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional](../../models/operations/VerifyPasswordResponseBody.md) | :heavy_minus_sign: | The provided password was correct. | \ No newline at end of file diff --git a/docs/models/operations/VerifyPasswordResponseBody.md b/docs/models/operations/VerifyPasswordResponseBody.md new file mode 100644 index 0000000..ea4fb87 --- /dev/null +++ b/docs/models/operations/VerifyPasswordResponseBody.md @@ -0,0 +1,10 @@ +# VerifyPasswordResponseBody + +The provided password was correct. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `verified` | *Optional* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/VerifySessionRequest.md b/docs/models/operations/VerifySessionRequest.md new file mode 100644 index 0000000..71dc1de --- /dev/null +++ b/docs/models/operations/VerifySessionRequest.md @@ -0,0 +1,9 @@ +# VerifySessionRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `sessionId` | *String* | :heavy_check_mark: | The ID of the session | +| `requestBody` | [Optional](../../models/operations/VerifySessionRequestBody.md) | :heavy_minus_sign: | Parameters. | \ No newline at end of file diff --git a/docs/models/operations/VerifySessionRequestBody.md b/docs/models/operations/VerifySessionRequestBody.md new file mode 100644 index 0000000..eab7d92 --- /dev/null +++ b/docs/models/operations/VerifySessionRequestBody.md @@ -0,0 +1,10 @@ +# VerifySessionRequestBody + +Parameters. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `token` | *Optional* | :heavy_minus_sign: | The JWT that is sent via the `__session` cookie from your frontend.
Note: this JWT must be associated with the supplied session ID. | \ No newline at end of file diff --git a/docs/models/operations/VerifySessionResponse.md b/docs/models/operations/VerifySessionResponse.md new file mode 100644 index 0000000..214fba9 --- /dev/null +++ b/docs/models/operations/VerifySessionResponse.md @@ -0,0 +1,11 @@ +# VerifySessionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `session` | [Optional](../../models/components/Session.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/VerifyTOTPRequest.md b/docs/models/operations/VerifyTOTPRequest.md new file mode 100644 index 0000000..5265729 --- /dev/null +++ b/docs/models/operations/VerifyTOTPRequest.md @@ -0,0 +1,9 @@ +# VerifyTOTPRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user for whom to verify the TOTP | +| `requestBody` | [Optional](../../models/operations/VerifyTOTPRequestBody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/VerifyTOTPRequestBody.md b/docs/models/operations/VerifyTOTPRequestBody.md new file mode 100644 index 0000000..31191c1 --- /dev/null +++ b/docs/models/operations/VerifyTOTPRequestBody.md @@ -0,0 +1,8 @@ +# VerifyTOTPRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `code` | *String* | :heavy_check_mark: | The TOTP or backup code to verify | \ No newline at end of file diff --git a/docs/models/operations/VerifyTOTPResponse.md b/docs/models/operations/VerifyTOTPResponse.md new file mode 100644 index 0000000..2c465d0 --- /dev/null +++ b/docs/models/operations/VerifyTOTPResponse.md @@ -0,0 +1,11 @@ +# VerifyTOTPResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional](../../models/operations/VerifyTOTPResponseBody.md) | :heavy_minus_sign: | The provided TOTP or backup code was correct. | \ No newline at end of file diff --git a/docs/models/operations/VerifyTOTPResponseBody.md b/docs/models/operations/VerifyTOTPResponseBody.md new file mode 100644 index 0000000..e983c95 --- /dev/null +++ b/docs/models/operations/VerifyTOTPResponseBody.md @@ -0,0 +1,11 @@ +# VerifyTOTPResponseBody + +The provided TOTP or backup code was correct. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `verified` | *Optional* | :heavy_minus_sign: | N/A | +| `codeType` | [Optional](../../models/operations/CodeType.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdks/actors/README.md b/docs/sdks/actors/README.md new file mode 100644 index 0000000..d7cd85a --- /dev/null +++ b/docs/sdks/actors/README.md @@ -0,0 +1,152 @@ +# Actors +(*actors()*) + +### Available Operations + +* [createToken](#createtoken) - Create actor token +* [revokeToken](#revoketoken) - Revoke actor token + +## createToken + +Create an actor token that can be used to impersonate the given user. +The `actor` parameter needs to include at least a "sub" key whose value is the ID of the actor (impersonating) user. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateActorTokenRequestBody req = CreateActorTokenRequestBody.builder() + .userId("") + .actor(java.util.Map.ofEntries( + entry("sub", "user_2OEpKhcCN1Lat9NQ0G6puh7q5Rb"))) + .build(); + + CreateActorTokenResponse res = sdk.actors().createToken() + .request(req) + .call(); + + if (res.actorToken().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateActorTokenRequestBody](../../models/operations/CreateActorTokenRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateActorTokenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,402,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## revokeToken + +Revokes a pending actor token. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + RevokeActorTokenResponse res = sdk.actors().revokeToken() + .actorTokenId("") + .call(); + + if (res.actorToken().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `actorTokenId` | *String* | :heavy_check_mark: | The ID of the actor token to be revoked. | + + +### Response + +**[Optional](../../models/operations/RevokeActorTokenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/allowlist/README.md b/docs/sdks/allowlist/README.md new file mode 100644 index 0000000..275aa5b --- /dev/null +++ b/docs/sdks/allowlist/README.md @@ -0,0 +1,212 @@ +# Allowlist +(*allowlist()*) + +### Available Operations + +* [list](#list) - List all identifiers on the allow-list +* [create](#create) - Add identifier to the allow-list +* [delete](#delete) - Delete identifier from allow-list + +## list + +Get a list of all identifiers allowed to sign up to an instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListAllowlistIdentifiersResponse res = sdk.allowlist().list() + .call(); + + if (res.allowlistIdentifierList().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/ListAllowlistIdentifiersResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 401,402 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## create + +Create an identifier allowed to sign up to an instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateAllowlistIdentifierRequestBody req = CreateAllowlistIdentifierRequestBody.builder() + .identifier("") + .build(); + + CreateAllowlistIdentifierResponse res = sdk.allowlist().create() + .request(req) + .call(); + + if (res.allowlistIdentifier().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateAllowlistIdentifierRequestBody](../../models/operations/CreateAllowlistIdentifierRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateAllowlistIdentifierResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,402,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Delete an identifier from the instance allow-list + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteAllowlistIdentifierResponse res = sdk.allowlist().delete() + .identifierId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `identifierId` | *String* | :heavy_check_mark: | The ID of the identifier to delete from the allow-list | + + +### Response + +**[Optional](../../models/operations/DeleteAllowlistIdentifierResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/blocklist/README.md b/docs/sdks/blocklist/README.md new file mode 100644 index 0000000..b40728b --- /dev/null +++ b/docs/sdks/blocklist/README.md @@ -0,0 +1,212 @@ +# Blocklist +(*blocklist()*) + +### Available Operations + +* [list](#list) - List all identifiers on the block-list +* [create](#create) - Add identifier to the block-list +* [delete](#delete) - Delete identifier from block-list + +## list + +Get a list of all identifiers which are not allowed to access an instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListBlocklistIdentifiersResponse res = sdk.blocklist().list() + .call(); + + if (res.blocklistIdentifiers().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/ListBlocklistIdentifiersResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 401,402 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## create + +Create an identifier that is blocked from accessing an instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateBlocklistIdentifierRequestBody req = CreateBlocklistIdentifierRequestBody.builder() + .identifier("") + .build(); + + CreateBlocklistIdentifierResponse res = sdk.blocklist().create() + .request(req) + .call(); + + if (res.blocklistIdentifier().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateBlocklistIdentifierRequestBody](../../models/operations/CreateBlocklistIdentifierRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateBlocklistIdentifierResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,402,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Delete an identifier from the instance block-list + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteBlocklistIdentifierResponse res = sdk.blocklist().delete() + .identifierId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `identifierId` | *String* | :heavy_check_mark: | The ID of the identifier to delete from the block-list | + + +### Response + +**[Optional](../../models/operations/DeleteBlocklistIdentifierResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/clerk/README.md b/docs/sdks/clerk/README.md new file mode 100644 index 0000000..7571e84 --- /dev/null +++ b/docs/sdks/clerk/README.md @@ -0,0 +1,19 @@ +# Clerk SDK + + +## Overview + +Clerk Backend API: The Clerk REST Backend API, meant to be accessed by backend +servers. + +### Versions + +When the API changes in a way that isn't compatible with older versions, a new version is released. +Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/backend-requests/versioning/overview). + + +Please see https://clerk.com/docs for more information. + + +### Available Operations + diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md new file mode 100644 index 0000000..162039d --- /dev/null +++ b/docs/sdks/clients/README.md @@ -0,0 +1,232 @@ +# Clients +(*clients()*) + +### Available Operations + +* [~~list~~](#list) - List all clients :warning: **Deprecated** +* [verify](#verify) - Verify a client +* [get](#get) - Get a client + +## ~~list~~ + +Returns a list of all clients. The clients are returned sorted by creation date, +with the newest clients appearing first. +Warning: the endpoint is being deprecated and will be removed in future versions. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetClientListResponse res = sdk.clients().list() + .limit(10L) + .offset(0L) + .call(); + + while (true) { + if (res.clientList().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | + + +### Response + +**[Optional](../../models/operations/GetClientListResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,410,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## verify + +Verifies the client in the provided token + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + VerifyClientRequestBody req = VerifyClientRequestBody.builder() + .build(); + + VerifyClientResponse res = sdk.clients().verify() + .request(req) + .call(); + + if (res.client().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.VerifyClientRequestBody](../../models/operations/VerifyClientRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/VerifyClientResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Returns the details of a client. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetClientResponse res = sdk.clients().get() + .clientId("") + .call(); + + if (res.client().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `clientId` | *String* | :heavy_check_mark: | Client ID. | + + +### Response + +**[Optional](../../models/operations/GetClientResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/domains/README.md b/docs/sdks/domains/README.md new file mode 100644 index 0000000..c5c1c12 --- /dev/null +++ b/docs/sdks/domains/README.md @@ -0,0 +1,295 @@ +# Domains +(*domains()*) + +### Available Operations + +* [list](#list) - List all instance domains +* [add](#add) - Add a domain +* [delete](#delete) - Delete a satellite domain +* [update](#update) - Update a domain + +## list + +Use this endpoint to get a list of all domains for an instance. +The response will contain the primary domain for the instance and any satellite domains. Each domain in the response contains information about the URLs where Clerk operates and the required CNAME targets. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListDomainsResponse res = sdk.domains().list() + .call(); + + if (res.domains().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/ListDomainsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/SDKError | 4xx-5xx | */* | + +## add + +Add a new domain for your instance. +Useful in the case of multi-domain instances, allows adding satellite domains to an instance. +The new domain must have a `name`. The domain name can contain the port for development instances, like `localhost:3000`. +At the moment, instances can have only one primary domain, so the `is_satellite` parameter must be set to `true`. +If you're planning to configure the new satellite domain to run behind a proxy, pass the `proxy_url` parameter accordingly. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + AddDomainRequestBody req = AddDomainRequestBody.builder() + .name("") + .isSatellite(false) + .build(); + + AddDomainResponse res = sdk.domains().add() + .request(req) + .call(); + + if (res.domain().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.AddDomainRequestBody](../../models/operations/AddDomainRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/AddDomainResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,402,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Deletes a satellite domain for the instance. +It is currently not possible to delete the instance's primary domain. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteDomainResponse res = sdk.domains().delete() + .domainId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `domainId` | *String* | :heavy_check_mark: | The ID of the domain that will be deleted. Must be a satellite domain. | + + +### Response + +**[Optional](../../models/operations/DeleteDomainResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +The `proxy_url` can be updated only for production instances. +Update one of the instance's domains. Both primary and satellite domains can be updated. +If you choose to use Clerk via proxy, use this endpoint to specify the `proxy_url`. +Whenever you decide you'd rather switch to DNS setup for Clerk, simply set `proxy_url` +to `null` for the domain. When you update a production instance's primary domain name, +you have to make sure that you've completed all the necessary setup steps for DNS and +emails to work. Expect downtime otherwise. Updating a primary domain's name will also +update the instance's home origin, affecting the default application paths. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateDomainResponse res = sdk.domains().update() + .domainId("") + .requestBody(UpdateDomainRequestBody.builder() + .build()) + .call(); + + if (res.domain().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `domainId` | *String* | :heavy_check_mark: | The ID of the domain that will be updated. | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateDomainRequestBody](../../models/operations/UpdateDomainRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateDomainResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/emailaddresses/README.md b/docs/sdks/emailaddresses/README.md new file mode 100644 index 0000000..7cc9d1a --- /dev/null +++ b/docs/sdks/emailaddresses/README.md @@ -0,0 +1,291 @@ +# EmailAddresses +(*emailAddresses()*) + +### Available Operations + +* [create](#create) - Create an email address +* [get](#get) - Retrieve an email address +* [delete](#delete) - Delete an email address +* [update](#update) - Update an email address + +## create + +Create a new email address + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateEmailAddressRequestBody req = CreateEmailAddressRequestBody.builder() + .build(); + + CreateEmailAddressResponse res = sdk.emailAddresses().create() + .request(req) + .call(); + + if (res.emailAddress().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateEmailAddressRequestBody](../../models/operations/CreateEmailAddressRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateEmailAddressResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Returns the details of an email address. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetEmailAddressResponse res = sdk.emailAddresses().get() + .emailAddressId("") + .call(); + + if (res.emailAddress().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `emailAddressId` | *String* | :heavy_check_mark: | The ID of the email address to retrieve | + + +### Response + +**[Optional](../../models/operations/GetEmailAddressResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Delete the email address with the given ID + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteEmailAddressResponse res = sdk.emailAddresses().delete() + .emailAddressId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `emailAddressId` | *String* | :heavy_check_mark: | The ID of the email address to delete | + + +### Response + +**[Optional](../../models/operations/DeleteEmailAddressResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +Updates an email address. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateEmailAddressResponse res = sdk.emailAddresses().update() + .emailAddressId("") + .requestBody(UpdateEmailAddressRequestBody.builder() + .build()) + .call(); + + if (res.emailAddress().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `emailAddressId` | *String* | :heavy_check_mark: | The ID of the email address to update | +| `requestBody` | [Optional](../../models/operations/UpdateEmailAddressRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateEmailAddressResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/instance/README.md b/docs/sdks/instance/README.md new file mode 100644 index 0000000..148875c --- /dev/null +++ b/docs/sdks/instance/README.md @@ -0,0 +1,447 @@ +# Instance +(*instance()*) + +### Available Operations + +* [updateAuthConfig](#updateauthconfig) - Update instance settings +* [~~updateProductionDomain~~](#updateproductiondomain) - Update production instance domain :warning: **Deprecated** +* [update](#update) - Update instance settings +* [updateRestrictions](#updaterestrictions) - Update instance restrictions +* [changeProductionDomain](#changeproductiondomain) - Update production instance domain +* [updateOrganizationSettings](#updateorganizationsettings) - Update instance organization settings + +## updateAuthConfig + +Updates the settings of an instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateInstanceAuthConfigRequestBody req = UpdateInstanceAuthConfigRequestBody.builder() + .build(); + + UpdateInstanceAuthConfigResponse res = sdk.instance().updateAuthConfig() + .request(req) + .call(); + + if (res.instanceSettings().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigRequestBody](../../models/operations/UpdateInstanceAuthConfigRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/UpdateInstanceAuthConfigResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## ~~updateProductionDomain~~ + +Change the domain of a production instance. + +Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + +WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateProductionInstanceDomainRequestBody req = UpdateProductionInstanceDomainRequestBody.builder() + .build(); + + UpdateProductionInstanceDomainResponse res = sdk.instance().updateProductionDomain() + .request(req) + .call(); + + // handle response + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainRequestBody](../../models/operations/UpdateProductionInstanceDomainRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/UpdateProductionInstanceDomainResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +Updates the settings of an instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateInstanceRequestBody req = UpdateInstanceRequestBody.builder() + .build(); + + UpdateInstanceResponse res = sdk.instance().update() + .request(req) + .call(); + + // handle response + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.UpdateInstanceRequestBody](../../models/operations/UpdateInstanceRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/UpdateInstanceResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## updateRestrictions + +Updates the restriction settings of an instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateInstanceRestrictionsRequestBody req = UpdateInstanceRestrictionsRequestBody.builder() + .build(); + + UpdateInstanceRestrictionsResponse res = sdk.instance().updateRestrictions() + .request(req) + .call(); + + if (res.instanceRestrictions().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsRequestBody](../../models/operations/UpdateInstanceRestrictionsRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/UpdateInstanceRestrictionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## changeProductionDomain + +Change the domain of a production instance. + +Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + +WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ChangeProductionInstanceDomainRequestBody req = ChangeProductionInstanceDomainRequestBody.builder() + .build(); + + ChangeProductionInstanceDomainResponse res = sdk.instance().changeProductionDomain() + .request(req) + .call(); + + // handle response + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainRequestBody](../../models/operations/ChangeProductionInstanceDomainRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ChangeProductionInstanceDomainResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## updateOrganizationSettings + +Updates the organization settings of the instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateInstanceOrganizationSettingsRequestBody req = UpdateInstanceOrganizationSettingsRequestBody.builder() + .build(); + + UpdateInstanceOrganizationSettingsResponse res = sdk.instance().updateOrganizationSettings() + .request(req) + .call(); + + if (res.organizationSettings().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsRequestBody](../../models/operations/UpdateInstanceOrganizationSettingsRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/UpdateInstanceOrganizationSettingsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/invitations/README.md b/docs/sdks/invitations/README.md new file mode 100644 index 0000000..1d9aefb --- /dev/null +++ b/docs/sdks/invitations/README.md @@ -0,0 +1,232 @@ +# Invitations +(*invitations()*) + +### Available Operations + +* [create](#create) - Create an invitation +* [list](#list) - List all invitations +* [revoke](#revoke) - Revokes an invitation + +## create + +Creates a new invitation for the given email address and sends the invitation email. +Keep in mind that you cannot create an invitation if there is already one for the given email address. +Also, trying to create an invitation for an email address that already exists in your application will result to an error. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateInvitationRequestBody req = CreateInvitationRequestBody.builder() + .emailAddress("") + .build(); + + CreateInvitationResponse res = sdk.invitations().create() + .request(req) + .call(); + + if (res.invitation().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateInvitationRequestBody](../../models/operations/CreateInvitationRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateInvitationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## list + +Returns all non-revoked invitations for your application, sorted by creation date + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListInvitationsResponse res = sdk.invitations().list() + .limit(10L) + .offset(0L) + .status(QueryParamStatus.REVOKED) + .call(); + + while (true) { + if (res.invitationList().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | +| `status` | [Optional](../../models/operations/QueryParamStatus.md) | :heavy_minus_sign: | Filter invitations based on their status | + + +### Response + +**[Optional](../../models/operations/ListInvitationsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/SDKError | 4xx-5xx | */* | + +## revoke + +Revokes the given invitation. +Revoking an invitation will prevent the user from using the invitation link that was sent to them. +However, it doesn't prevent the user from signing up if they follow the sign up flow. +Only active (i.e. non-revoked) invitations can be revoked. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + RevokeInvitationResponse res = sdk.invitations().revoke() + .invitationId("") + .call(); + + if (res.invitationRevoked().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `invitationId` | *String* | :heavy_check_mark: | The ID of the invitation to be revoked | + + +### Response + +**[Optional](../../models/operations/RevokeInvitationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/jwks/README.md b/docs/sdks/jwks/README.md new file mode 100644 index 0000000..dce90ef --- /dev/null +++ b/docs/sdks/jwks/README.md @@ -0,0 +1,62 @@ +# Jwks +(*jwks()*) + +### Available Operations + +* [getJWKS](#getjwks) - Retrieve the JSON Web Key Set of the instance + +## getJWKS + +Retrieve the JSON Web Key Set of the instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetJWKSResponse res = sdk.jwks().getJWKS() + .call(); + + // handle response + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/GetJWKSResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/jwttemplates/README.md b/docs/sdks/jwttemplates/README.md new file mode 100644 index 0000000..88e6ece --- /dev/null +++ b/docs/sdks/jwttemplates/README.md @@ -0,0 +1,350 @@ +# JwtTemplates +(*jwtTemplates()*) + +### Available Operations + +* [list](#list) - List all templates +* [create](#create) - Create a JWT template +* [get](#get) - Retrieve a template +* [update](#update) - Update a JWT template +* [delete](#delete) - Delete a Template + +## list + +List all templates + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListJWTTemplatesResponse res = sdk.jwtTemplates().list() + .call(); + + if (res.jwtTemplateList().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/ListJWTTemplatesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/SDKError | 4xx-5xx | */* | + +## create + +Create a new JWT template + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateJWTTemplateRequestBody req = CreateJWTTemplateRequestBody.builder() + .build(); + + CreateJWTTemplateResponse res = sdk.jwtTemplates().create() + .request(req) + .call(); + + if (res.jwtTemplate().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateJWTTemplateRequestBody](../../models/operations/CreateJWTTemplateRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateJWTTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,402,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Retrieve the details of a given JWT template + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetJWTTemplateResponse res = sdk.jwtTemplates().get() + .templateId("") + .call(); + + if (res.jwtTemplate().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `templateId` | *String* | :heavy_check_mark: | JWT Template ID | + + +### Response + +**[Optional](../../models/operations/GetJWTTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +Updates an existing JWT template + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateJWTTemplateResponse res = sdk.jwtTemplates().update() + .templateId("") + .requestBody(UpdateJWTTemplateRequestBody.builder() + .build()) + .call(); + + if (res.jwtTemplate().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateId` | *String* | :heavy_check_mark: | The ID of the JWT template to update | +| `requestBody` | [Optional](../../models/operations/UpdateJWTTemplateRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateJWTTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,402,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Delete a Template + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteJWTTemplateResponse res = sdk.jwtTemplates().delete() + .templateId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `templateId` | *String* | :heavy_check_mark: | JWT Template ID | + + +### Response + +**[Optional](../../models/operations/DeleteJWTTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/miscellaneous/README.md b/docs/sdks/miscellaneous/README.md new file mode 100644 index 0000000..cc47464 --- /dev/null +++ b/docs/sdks/miscellaneous/README.md @@ -0,0 +1,70 @@ +# Miscellaneous +(*miscellaneous()*) + +### Available Operations + +* [getPublicInterstitial](#getpublicinterstitial) - Returns the markup for the interstitial page + +## getPublicInterstitial + +The Clerk interstitial endpoint serves an html page that loads clerk.js in order to check the user's authentication state. +It is used by Clerk SDKs when the user's authentication state cannot be immediately determined. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .build(); + + GetPublicInterstitialResponse res = sdk.miscellaneous().getPublicInterstitial() + .frontendApi("") + .publishableKey("") + .call(); + + // handle response + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `frontendApi` | *Optional* | :heavy_minus_sign: | The Frontend API key of your instance | +| `publishableKey` | *Optional* | :heavy_minus_sign: | The publishable key of your instance | + + +### Response + +**[Optional](../../models/operations/GetPublicInterstitialResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/oauthapplications/README.md b/docs/sdks/oauthapplications/README.md new file mode 100644 index 0000000..a9f2e67 --- /dev/null +++ b/docs/sdks/oauthapplications/README.md @@ -0,0 +1,452 @@ +# OAuthApplications +(*oAuthApplications()*) + +### Available Operations + +* [list](#list) - Get a list of OAuth applications for an instance +* [create](#create) - Create an OAuth application +* [get](#get) - Retrieve an OAuth application by ID +* [updateApplication](#updateapplication) - Update an OAuth application +* [delete](#delete) - Delete an OAuth application +* [rotateSecret](#rotatesecret) - Rotate the client secret of the given OAuth application + +## list + +This request returns the list of OAuth applications for an instance. +Results can be paginated using the optional `limit` and `offset` query parameters. +The OAuth applications are ordered by descending creation date. +Most recent OAuth applications will be returned first. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListOAuthApplicationsResponse res = sdk.oAuthApplications().list() + .limit(10L) + .offset(0L) + .call(); + + while (true) { + if (res.oAuthApplications().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | + + +### Response + +**[Optional](../../models/operations/ListOAuthApplicationsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## create + +Creates a new OAuth application with the given name and callback URL for an instance. +The callback URL must be a valid url. +All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateOAuthApplicationRequestBody req = CreateOAuthApplicationRequestBody.builder() + .name("") + .callbackUrl("") + .scopes("profile email public_metadata") + .build(); + + CreateOAuthApplicationResponse res = sdk.oAuthApplications().create() + .request(req) + .call(); + + if (res.oAuthApplicationWithSecret().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateOAuthApplicationRequestBody](../../models/operations/CreateOAuthApplicationRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateOAuthApplicationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Fetches the OAuth application whose ID matches the provided `id` in the path. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetOAuthApplicationResponse res = sdk.oAuthApplications().get() + .oauthApplicationId("") + .call(); + + if (res.oAuthApplication().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `oauthApplicationId` | *String* | :heavy_check_mark: | The ID of the OAuth application | + + +### Response + +**[Optional](../../models/operations/GetOAuthApplicationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## updateApplication + +Updates an existing OAuth application + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateOAuthApplicationResponse res = sdk.oAuthApplications().updateApplication() + .oauthApplicationId("") + .requestBody(UpdateOAuthApplicationRequestBody.builder() + .scopes("profile email public_metadata private_metadata") + .build()) + .call(); + + if (res.oAuthApplication().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `oauthApplicationId` | *String* | :heavy_check_mark: | The ID of the OAuth application to update | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequestBody](../../models/operations/UpdateOAuthApplicationRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateOAuthApplicationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Deletes the given OAuth application. +This is not reversible. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteOAuthApplicationResponse res = sdk.oAuthApplications().delete() + .oauthApplicationId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `oauthApplicationId` | *String* | :heavy_check_mark: | The ID of the OAuth application to delete | + + +### Response + +**[Optional](../../models/operations/DeleteOAuthApplicationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## rotateSecret + +Rotates the OAuth application's client secret. +When the client secret is rotated, make sure to update it in authorized OAuth clients. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + RotateOAuthApplicationSecretResponse res = sdk.oAuthApplications().rotateSecret() + .oauthApplicationId("") + .call(); + + if (res.oAuthApplicationWithSecret().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `oauthApplicationId` | *String* | :heavy_check_mark: | The ID of the OAuth application for which to rotate the client secret | + + +### Response + +**[Optional](../../models/operations/RotateOAuthApplicationSecretResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/organizationinvitations/README.md b/docs/sdks/organizationinvitations/README.md new file mode 100644 index 0000000..1f6165f --- /dev/null +++ b/docs/sdks/organizationinvitations/README.md @@ -0,0 +1,515 @@ +# OrganizationInvitations +(*organizationInvitations()*) + +### Available Operations + +* [create](#create) - Create and send an organization invitation +* [list](#list) - Get a list of organization invitations +* [createBulk](#createbulk) - Bulk create and send organization invitations +* [~~listPending~~](#listpending) - Get a list of pending organization invitations :warning: **Deprecated** +* [get](#get) - Retrieve an organization invitation by ID +* [revoke](#revoke) - Revoke a pending organization invitation + +## create + +Creates a new organization invitation and sends an email to the provided `email_address` with a link to accept the invitation and join the organization. +You can specify the `role` for the invited organization member. + +New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. + +The request body supports passing an optional `redirect_url` parameter. +When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. +Use this parameter to implement a custom invitation acceptance flow. + +You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. +That user must be a member with administrator privileges in the organization. +Only "admin" members can create organization invitations. + +You can optionally provide public and private metadata for the organization invitation. +The public metadata are visible by both the Frontend and the Backend whereas the private ones only by the Backend. +When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateOrganizationInvitationResponse res = sdk.organizationInvitations().create() + .organizationId("") + .requestBody(CreateOrganizationInvitationRequestBody.builder() + .emailAddress("") + .inviterUserId("") + .role("") + .build()) + .call(); + + if (res.organizationInvitation().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization for which to send the invitation | +| `requestBody` | [com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequestBody](../../models/operations/CreateOrganizationInvitationRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/CreateOrganizationInvitationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## list + +This request returns the list of organization invitations. +Results can be paginated using the optional `limit` and `offset` query parameters. +You can filter them by providing the 'status' query parameter, that accepts multiple values. +The organization invitations are ordered by descending creation date. +Most recent invitations will be returned first. +Any invitations created as a result of an Organization Domain are not included in the results. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListOrganizationInvitationsResponse res = sdk.organizationInvitations().list() + .organizationId("") + .limit(10L) + .offset(0L) + .status(ListOrganizationInvitationsQueryParamStatus.REVOKED) + .call(); + + while (true) { + if (res.organizationInvitations().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | +| `status` | [Optional](../../models/operations/ListOrganizationInvitationsQueryParamStatus.md) | :heavy_minus_sign: | Filter organization invitations based on their status | + + +### Response + +**[Optional](../../models/operations/ListOrganizationInvitationsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## createBulk + +Creates new organization invitations in bulk and sends out emails to the provided email addresses with a link to accept the invitation and join the organization. +You can specify a different `role` for each invited organization member. +New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. +The request body supports passing an optional `redirect_url` parameter for each invitation. +When the invited user clicks the link to accept the invitation, they will be redirected to the provided URL. +Use this parameter to implement a custom invitation acceptance flow. +You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation +can have a different inviter user. +Inviter users must be members with administrator privileges in the organization. +Only "admin" members can create organization invitations. +You can optionally provide public and private metadata for each organization invitation. The public metadata are visible +by both the Frontend and the Backend, whereas the private metadata are only visible by the Backend. +When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateOrganizationInvitationBulkResponse res = sdk.organizationInvitations().createBulk() + .organizationId("") + .requestBody(java.util.List.of( + RequestBody.builder() + .emailAddress("") + .inviterUserId("") + .role("") + .build())) + .call(); + + if (res.organizationInvitations().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `requestBody` | List<[com.clerk.backend_api.models.operations.RequestBody](../../models/operations/RequestBody.md)> | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/CreateOrganizationInvitationBulkResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## ~~listPending~~ + +This request returns the list of organization invitations with "pending" status. +These are the organization invitations that can still be used to join the organization, but have not been accepted by the invited user yet. +Results can be paginated using the optional `limit` and `offset` query parameters. +The organization invitations are ordered by descending creation date. +Most recent invitations will be returned first. +Any invitations created as a result of an Organization Domain are not included in the results. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListPendingOrganizationInvitationsResponse res = sdk.organizationInvitations().listPending() + .organizationId("") + .limit(10L) + .offset(0L) + .call(); + + while (true) { + if (res.organizationInvitations().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | + + +### Response + +**[Optional](../../models/operations/ListPendingOrganizationInvitationsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Use this request to get an existing organization invitation by ID. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetOrganizationInvitationResponse res = sdk.organizationInvitations().get() + .organizationId("") + .invitationId("") + .call(); + + if (res.organizationInvitation().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `invitationId` | *String* | :heavy_check_mark: | The organization invitation ID. | + + +### Response + +**[Optional](../../models/operations/GetOrganizationInvitationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## revoke + +Use this request to revoke a previously issued organization invitation. +Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. +Only organization invitations with "pending" status can be revoked. +The request needs the `requesting_user_id` parameter to specify the user which revokes the invitation. +Only users with "admin" role can revoke invitations. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + RevokeOrganizationInvitationResponse res = sdk.organizationInvitations().revoke() + .organizationId("") + .invitationId("") + .requestBody(RevokeOrganizationInvitationRequestBody.builder() + .requestingUserId("") + .build()) + .call(); + + if (res.organizationInvitation().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `invitationId` | *String* | :heavy_check_mark: | The organization invitation ID. | +| `requestBody` | [com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequestBody](../../models/operations/RevokeOrganizationInvitationRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/RevokeOrganizationInvitationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/organizationmemberships/README.md b/docs/sdks/organizationmemberships/README.md new file mode 100644 index 0000000..90f1abe --- /dev/null +++ b/docs/sdks/organizationmemberships/README.md @@ -0,0 +1,390 @@ +# OrganizationMemberships +(*organizationMemberships()*) + +### Available Operations + +* [create](#create) - Create a new organization membership +* [list](#list) - Get a list of all members of an organization +* [update](#update) - Update an organization membership +* [delete](#delete) - Remove a member from an organization +* [updateMetadata](#updatemetadata) - Merge and update organization membership metadata + +## create + +Adds a user as a member to the given organization. +Only users in the same instance as the organization can be added as members. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateOrganizationMembershipResponse res = sdk.organizationMemberships().create() + .organizationId("") + .requestBody(CreateOrganizationMembershipRequestBody.builder() + .userId("") + .role("") + .build()) + .call(); + + if (res.organizationMembership().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization where the new membership will be created | +| `requestBody` | [com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequestBody](../../models/operations/CreateOrganizationMembershipRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/CreateOrganizationMembershipResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## list + +Retrieves all user memberships for the given organization + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListOrganizationMembershipsResponse res = sdk.organizationMemberships().list() + .organizationId("") + .limit(10L) + .offset(0L) + .orderBy("") + .call(); + + while (true) { + if (res.organizationMemberships().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The organization ID. | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | +| `orderBy` | *Optional* | :heavy_minus_sign: | Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username.
By prepending one of those values with + or -,
we can choose to sort in ascending (ASC) or descending (DESC) order." | + + +### Response + +**[Optional](../../models/operations/ListOrganizationMembershipsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 401,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +Updates the properties of an existing organization membership + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateOrganizationMembershipResponse res = sdk.organizationMemberships().update() + .organizationId("") + .userId("") + .requestBody(UpdateOrganizationMembershipRequestBody.builder() + .role("") + .build()) + .call(); + + if (res.organizationMembership().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization the membership belongs to | +| `userId` | *String* | :heavy_check_mark: | The ID of the user that this membership belongs to | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequestBody](../../models/operations/UpdateOrganizationMembershipRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateOrganizationMembershipResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Removes the given membership from the organization + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteOrganizationMembershipResponse res = sdk.organizationMemberships().delete() + .organizationId("") + .userId("") + .call(); + + if (res.organizationMembership().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization the membership belongs to | +| `userId` | *String* | :heavy_check_mark: | The ID of the user that this membership belongs to | + + +### Response + +**[Optional](../../models/operations/DeleteOrganizationMembershipResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## updateMetadata + +Update an organization membership's metadata attributes by merging existing values with the provided parameters. +Metadata values will be updated via a deep merge. Deep means that any nested JSON objects will be merged as well. +You can remove metadata keys at any level by setting their value to `null`. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateOrganizationMembershipMetadataResponse res = sdk.organizationMemberships().updateMetadata() + .organizationId("") + .userId("") + .requestBody(UpdateOrganizationMembershipMetadataRequestBody.builder() + .build()) + .call(); + + if (res.organizationMembership().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization the membership belongs to | +| `userId` | *String* | :heavy_check_mark: | The ID of the user that this membership belongs to | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequestBody](../../models/operations/UpdateOrganizationMembershipMetadataRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateOrganizationMembershipMetadataResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md new file mode 100644 index 0000000..00818d8 --- /dev/null +++ b/docs/sdks/organizations/README.md @@ -0,0 +1,614 @@ +# Organizations +(*organizations()*) + +### Available Operations + +* [list](#list) - Get a list of organizations for an instance +* [create](#create) - Create an organization +* [get](#get) - Retrieve an organization by ID or slug +* [update](#update) - Update an organization +* [delete](#delete) - Delete an organization +* [mergeMetadata](#mergemetadata) - Merge and update metadata for an organization +* [uploadLogo](#uploadlogo) - Upload a logo for the organization +* [deleteLogo](#deletelogo) - Delete the organization's logo. + +## list + +This request returns the list of organizations for an instance. +Results can be paginated using the optional `limit` and `offset` query parameters. +The organizations are ordered by descending creation date. +Most recent organizations will be returned first. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListOrganizationsRequest req = ListOrganizationsRequest.builder() + .build(); + + ListOrganizationsResponse res = sdk.organizations().list() + .request(req) + .call(); + + while (true) { + if (res.organizations().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.ListOrganizationsRequest](../../models/operations/ListOrganizationsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListOrganizationsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## 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. +You can provide additional metadata for the organization and set any custom attribute you want. +Organizations support private and public metadata. +Private metadata can only be accessed from the Backend API. +Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateOrganizationRequestBody req = CreateOrganizationRequestBody.builder() + .name("") + .createdBy("") + .build(); + + CreateOrganizationResponse res = sdk.organizations().create() + .request(req) + .call(); + + if (res.organization().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateOrganizationRequestBody](../../models/operations/CreateOrganizationRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateOrganizationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Fetches the organization whose ID or slug matches the provided `id_or_slug` URL query parameter. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetOrganizationResponse res = sdk.organizations().get() + .organizationId("") + .call(); + + if (res.organization().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID or slug of the organization | + + +### Response + +**[Optional](../../models/operations/GetOrganizationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +Updates an existing organization + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateOrganizationResponse res = sdk.organizations().update() + .organizationId("") + .requestBody(UpdateOrganizationRequestBody.builder() + .build()) + .call(); + + if (res.organization().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization to update | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateOrganizationRequestBody](../../models/operations/UpdateOrganizationRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateOrganizationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Deletes the given organization. +Please note that deleting an organization will also delete all memberships and invitations. +This is not reversible. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteOrganizationResponse res = sdk.organizations().delete() + .organizationId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization to delete | + + +### Response + +**[Optional](../../models/operations/DeleteOrganizationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## mergeMetadata + +Update organization metadata attributes by merging existing values with the provided parameters. +Metadata values will be updated via a deep merge. +Deep meaning that any nested JSON objects will be merged as well. +You can remove metadata keys at any level by setting their value to `null`. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + MergeOrganizationMetadataResponse res = sdk.organizations().mergeMetadata() + .organizationId("") + .requestBody(MergeOrganizationMetadataRequestBody.builder() + .build()) + .call(); + + if (res.organization().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization for which metadata will be merged or updated | +| `requestBody` | [com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequestBody](../../models/operations/MergeOrganizationMetadataRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/MergeOrganizationMetadataResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## uploadLogo + +Set or replace an organization's logo, by uploading an image file. +This endpoint uses the `multipart/form-data` request content type and accepts a file of image type. +The file size cannot exceed 10MB. +Only the following file content types are supported: `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `image/x-icon`, `image/vnd.microsoft.icon`. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UploadOrganizationLogoResponse res = sdk.organizations().uploadLogo() + .organizationId("") + .requestBody(UploadOrganizationLogoRequestBody.builder() + .uploaderUserId("") + .file(UploadOrganizationLogoFile.builder() + .fileName("") + .content("0x07D3D6E1EC".getBytes()) + .build()) + .build()) + .call(); + + if (res.organizationWithLogo().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization for which to upload a logo | +| `requestBody` | [Optional](../../models/operations/UploadOrganizationLogoRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/UploadOrganizationLogoResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,403,404,413 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## deleteLogo + +Delete the organization's logo. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteOrganizationLogoResponse res = sdk.organizations().deleteLogo() + .organizationId("") + .call(); + + if (res.organization().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `organizationId` | *String* | :heavy_check_mark: | The ID of the organization for which the logo will be deleted. | + + +### Response + +**[Optional](../../models/operations/DeleteOrganizationLogoResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/phonenumbers/README.md b/docs/sdks/phonenumbers/README.md new file mode 100644 index 0000000..57ef489 --- /dev/null +++ b/docs/sdks/phonenumbers/README.md @@ -0,0 +1,291 @@ +# PhoneNumbers +(*phoneNumbers()*) + +### Available Operations + +* [create](#create) - Create a phone number +* [get](#get) - Retrieve a phone number +* [delete](#delete) - Delete a phone number +* [update](#update) - Update a phone number + +## create + +Create a new phone number + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreatePhoneNumberRequestBody req = CreatePhoneNumberRequestBody.builder() + .build(); + + CreatePhoneNumberResponse res = sdk.phoneNumbers().create() + .request(req) + .call(); + + if (res.phoneNumber().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreatePhoneNumberRequestBody](../../models/operations/CreatePhoneNumberRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreatePhoneNumberResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Returns the details of a phone number + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetPhoneNumberResponse res = sdk.phoneNumbers().get() + .phoneNumberId("") + .call(); + + if (res.phoneNumber().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `phoneNumberId` | *String* | :heavy_check_mark: | The ID of the phone number to retrieve | + + +### Response + +**[Optional](../../models/operations/GetPhoneNumberResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Delete the phone number with the given ID + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeletePhoneNumberResponse res = sdk.phoneNumbers().delete() + .phoneNumberId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `phoneNumberId` | *String* | :heavy_check_mark: | The ID of the phone number to delete | + + +### Response + +**[Optional](../../models/operations/DeletePhoneNumberResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +Updates a phone number + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdatePhoneNumberResponse res = sdk.phoneNumbers().update() + .phoneNumberId("") + .requestBody(UpdatePhoneNumberRequestBody.builder() + .build()) + .call(); + + if (res.phoneNumber().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `phoneNumberId` | *String* | :heavy_check_mark: | The ID of the phone number to update | +| `requestBody` | [Optional](../../models/operations/UpdatePhoneNumberRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdatePhoneNumberResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/proxy/README.md b/docs/sdks/proxy/README.md new file mode 100644 index 0000000..5f44305 --- /dev/null +++ b/docs/sdks/proxy/README.md @@ -0,0 +1,85 @@ +# Proxy +(*proxy()*) + +### Available Operations + +* [verifyDomain](#verifydomain) - Verify the proxy configuration for your domain + +## verifyDomain + +This endpoint can be used to validate that a proxy-enabled domain is operational. +It tries to verify that the proxy URL provided in the parameters maps to a functional proxy that can reach the Clerk Frontend API. + +You can use this endpoint before you set a proxy URL for a domain. This way you can ensure that switching to proxy-based +configuration will not lead to downtime for your instance. + +The `proxy_url` parameter allows for testing proxy configurations for domains that don't have a proxy URL yet, or operate on +a different proxy URL than the one provided. It can also be used to re-validate a domain that is already configured to work with a proxy. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + VerifyDomainProxyRequestBody req = VerifyDomainProxyRequestBody.builder() + .build(); + + VerifyDomainProxyResponse res = sdk.proxy().verifyDomain() + .request(req) + .call(); + + if (res.proxyCheck().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.VerifyDomainProxyRequestBody](../../models/operations/VerifyDomainProxyRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/VerifyDomainProxyResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/redirecturls/README.md b/docs/sdks/redirecturls/README.md new file mode 100644 index 0000000..435aa47 --- /dev/null +++ b/docs/sdks/redirecturls/README.md @@ -0,0 +1,277 @@ +# RedirectURLs +(*redirectURLs()*) + +### Available Operations + +* [list](#list) - List all redirect URLs +* [create](#create) - Create a redirect URL +* [get](#get) - Retrieve a redirect URL +* [delete](#delete) - Delete a redirect URL + +## list + +Lists all whitelisted redirect_urls for the instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListRedirectURLsResponse res = sdk.redirectURLs().list() + .call(); + + if (res.redirectURLList().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/ListRedirectURLsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/SDKError | 4xx-5xx | */* | + +## create + +Create a redirect URL + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateRedirectURLRequestBody req = CreateRedirectURLRequestBody.builder() + .build(); + + CreateRedirectURLResponse res = sdk.redirectURLs().create() + .request(req) + .call(); + + if (res.redirectURL().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateRedirectURLRequestBody](../../models/operations/CreateRedirectURLRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateRedirectURLResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Retrieve the details of the redirect URL with the given ID + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetRedirectURLResponse res = sdk.redirectURLs().get() + .id("") + .call(); + + if (res.redirectURL().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `id` | *String* | :heavy_check_mark: | The ID of the redirect URL | + + +### Response + +**[Optional](../../models/operations/GetRedirectURLResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Remove the selected redirect URL from the whitelist of the instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteRedirectURLResponse res = sdk.redirectURLs().delete() + .id("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `id` | *String* | :heavy_check_mark: | The ID of the redirect URL | + + +### Response + +**[Optional](../../models/operations/DeleteRedirectURLResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/samlconnections/README.md b/docs/sdks/samlconnections/README.md new file mode 100644 index 0000000..d6a8ae8 --- /dev/null +++ b/docs/sdks/samlconnections/README.md @@ -0,0 +1,376 @@ +# SamlConnections +(*samlConnections()*) + +### Available Operations + +* [list](#list) - Get a list of SAML Connections for an instance +* [create](#create) - Create a SAML Connection +* [get](#get) - Retrieve a SAML Connection by ID +* [update](#update) - Update a SAML Connection +* [delete](#delete) - Delete a SAML Connection + +## list + +Returns the list of SAML Connections for an instance. +Results can be paginated using the optional `limit` and `offset` query parameters. +The SAML Connections are ordered by descending creation date and the most recent will be returned first. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ListSAMLConnectionsResponse res = sdk.samlConnections().list() + .limit(10L) + .offset(0L) + .call(); + + while (true) { + if (res.samlConnections().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | + + +### Response + +**[Optional](../../models/operations/ListSAMLConnectionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,403,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## create + +Create a new SAML Connection. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateSAMLConnectionRequestBody req = CreateSAMLConnectionRequestBody.builder() + .name("") + .domain("") + .provider(Provider.SAML_OKTA) + .build(); + + CreateSAMLConnectionResponse res = sdk.samlConnections().create() + .request(req) + .call(); + + if (res.samlConnection().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateSAMLConnectionRequestBody](../../models/operations/CreateSAMLConnectionRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateSAMLConnectionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,403,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Fetches the SAML Connection whose ID matches the provided `saml_connection_id` in the path. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetSAMLConnectionResponse res = sdk.samlConnections().get() + .samlConnectionId("") + .call(); + + if (res.samlConnection().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection | + + +### Response + +**[Optional](../../models/operations/GetSAMLConnectionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +Updates the SAML Connection whose ID matches the provided `id` in the path. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateSAMLConnectionResponse res = sdk.samlConnections().update() + .samlConnectionId("") + .requestBody(UpdateSAMLConnectionRequestBody.builder() + .build()) + .call(); + + if (res.samlConnection().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection to update | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBody](../../models/operations/UpdateSAMLConnectionRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateSAMLConnectionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,403,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Deletes the SAML Connection whose ID matches the provided `id` in the path. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteSAMLConnectionResponse res = sdk.samlConnections().delete() + .samlConnectionId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection to delete | + + +### Response + +**[Optional](../../models/operations/DeleteSAMLConnectionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402,403,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md new file mode 100644 index 0000000..ca1c135 --- /dev/null +++ b/docs/sdks/sessions/README.md @@ -0,0 +1,380 @@ +# Sessions +(*sessions()*) + +### Available Operations + +* [list](#list) - List all sessions +* [get](#get) - Retrieve a session +* [revoke](#revoke) - Revoke a session +* [~~verify~~](#verify) - Verify a session :warning: **Deprecated** +* [createTokenFromTemplate](#createtokenfromtemplate) - Create a session token from a jwt template + +## list + +Returns a list of all sessions. +The sessions are returned sorted by creation date, with the newest sessions appearing first. +**Deprecation Notice (2024-01-01):** All parameters were initially considered optional, however +moving forward at least one of `client_id` or `user_id` parameters should be provided. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetSessionListRequest req = GetSessionListRequest.builder() + .build(); + + GetSessionListResponse res = sdk.sessions().list() + .request(req) + .call(); + + while (true) { + if (res.sessionList().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.GetSessionListRequest](../../models/operations/GetSessionListRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetSessionListResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Retrieve the details of a session + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetSessionResponse res = sdk.sessions().get() + .sessionId("") + .call(); + + if (res.session().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `sessionId` | *String* | :heavy_check_mark: | The ID of the session | + + +### Response + +**[Optional](../../models/operations/GetSessionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## revoke + +Sets the status of a session as "revoked", which is an unauthenticated state. +In multi-session mode, a revoked session will still be returned along with its client object, however the user will need to sign in again. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + RevokeSessionResponse res = sdk.sessions().revoke() + .sessionId("") + .call(); + + if (res.session().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `sessionId` | *String* | :heavy_check_mark: | The ID of the session | + + +### Response + +**[Optional](../../models/operations/RevokeSessionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## ~~verify~~ + +Returns the session if it is authenticated, otherwise returns an error. +WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, + which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#clerk-express-require-auth)). + For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + VerifySessionResponse res = sdk.sessions().verify() + .sessionId("") + .requestBody(VerifySessionRequestBody.builder() + .build()) + .call(); + + if (res.session().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `sessionId` | *String* | :heavy_check_mark: | The ID of the session | +| `requestBody` | [Optional](../../models/operations/VerifySessionRequestBody.md) | :heavy_minus_sign: | Parameters. | + + +### Response + +**[Optional](../../models/operations/VerifySessionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404,410 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## createTokenFromTemplate + +Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined for your instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateSessionTokenFromTemplateResponse res = sdk.sessions().createTokenFromTemplate() + .sessionId("") + .templateName("") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `sessionId` | *String* | :heavy_check_mark: | The ID of the session | +| `templateName` | *String* | :heavy_check_mark: | The name of the JWT Template defined in your instance (e.g. `custom_hasura`). | + + +### Response + +**[Optional](../../models/operations/CreateSessionTokenFromTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/signintokens/README.md b/docs/sdks/signintokens/README.md new file mode 100644 index 0000000..baf03e4 --- /dev/null +++ b/docs/sdks/signintokens/README.md @@ -0,0 +1,150 @@ +# SignInTokens +(*signInTokens()*) + +### Available Operations + +* [create](#create) - Create sign-in token +* [revoke](#revoke) - Revoke the given sign-in token + +## create + +Creates a new sign-in token and associates it with the given user. +By default, sign-in tokens expire in 30 days. +You can optionally supply a different duration in seconds using the `expires_in_seconds` property. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateSignInTokenRequestBody req = CreateSignInTokenRequestBody.builder() + .build(); + + CreateSignInTokenResponse res = sdk.signInTokens().create() + .request(req) + .call(); + + if (res.signInToken().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateSignInTokenRequestBody](../../models/operations/CreateSignInTokenRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateSignInTokenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## revoke + +Revokes a pending sign-in token + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + RevokeSignInTokenResponse res = sdk.signInTokens().revoke() + .signInTokenId("") + .call(); + + if (res.signInToken().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `signInTokenId` | *String* | :heavy_check_mark: | The ID of the sign-in token to be revoked | + + +### Response + +**[Optional](../../models/operations/RevokeSignInTokenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/signups/README.md b/docs/sdks/signups/README.md new file mode 100644 index 0000000..a301424 --- /dev/null +++ b/docs/sdks/signups/README.md @@ -0,0 +1,78 @@ +# SignUps +(*signUps()*) + +### Available Operations + +* [update](#update) - Update a sign-up + +## update + +Update the sign-up with the given ID + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateSignUpResponse res = sdk.signUps().update() + .id("") + .requestBody(UpdateSignUpRequestBody.builder() + .build()) + .call(); + + if (res.signUp().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The ID of the sign-up to update | +| `requestBody` | [Optional](../../models/operations/UpdateSignUpRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateSignUpResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/templates/README.md b/docs/sdks/templates/README.md new file mode 100644 index 0000000..776309d --- /dev/null +++ b/docs/sdks/templates/README.md @@ -0,0 +1,447 @@ +# Templates +(*templates()*) + +### Available Operations + +* [list](#list) - List all templates +* [get](#get) - Retrieve a template +* [upsert](#upsert) - Update a template for a given type and slug +* [revert](#revert) - Revert a template +* [preview](#preview) - Preview changes to a template +* [toggleDelivery](#toggledelivery) - Toggle the delivery by Clerk for a template of a given type and slug + +## list + +Returns a list of all templates. +The templates are returned sorted by position. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetTemplateListResponse res = sdk.templates().list() + .templateType(TemplateType.SMS) + .call(); + + if (res.templateList().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.TemplateType](../../models/operations/TemplateType.md) | :heavy_check_mark: | The type of templates to list (email or SMS) | + + +### Response + +**[Optional](../../models/operations/GetTemplateListResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Returns the details of a template + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetTemplateResponse res = sdk.templates().get() + .templateType(PathParamTemplateType.SMS) + .slug("") + .call(); + + if (res.template().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.PathParamTemplateType](../../models/operations/PathParamTemplateType.md) | :heavy_check_mark: | The type of templates to retrieve (email or SMS) | +| `slug` | *String* | :heavy_check_mark: | The slug (i.e. machine-friendly name) of the template to retrieve | + + +### Response + +**[Optional](../../models/operations/GetTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## upsert + +Updates the existing template of the given type and slug + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpsertTemplateResponse res = sdk.templates().upsert() + .templateType(UpsertTemplatePathParamTemplateType.SMS) + .slug("") + .requestBody(UpsertTemplateRequestBody.builder() + .build()) + .call(); + + if (res.template().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.UpsertTemplatePathParamTemplateType](../../models/operations/UpsertTemplatePathParamTemplateType.md) | :heavy_check_mark: | The type of template to update | +| `slug` | *String* | :heavy_check_mark: | The slug of the template to update | +| `requestBody` | [Optional](../../models/operations/UpsertTemplateRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/UpsertTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,402,403,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## revert + +Reverts an updated template to its default state + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + RevertTemplateResponse res = sdk.templates().revert() + .templateType(RevertTemplatePathParamTemplateType.EMAIL) + .slug("") + .call(); + + if (res.template().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.RevertTemplatePathParamTemplateType](../../models/operations/RevertTemplatePathParamTemplateType.md) | :heavy_check_mark: | The type of template to revert | +| `slug` | *String* | :heavy_check_mark: | The slug of the template to revert | + + +### Response + +**[Optional](../../models/operations/RevertTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,402,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## preview + +Returns a preview of a template for a given template_type, slug and body + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + PreviewTemplateResponse res = sdk.templates().preview() + .templateType("") + .slug("") + .requestBody(PreviewTemplateRequestBody.builder() + .build()) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateType` | *String* | :heavy_check_mark: | The type of template to preview | +| `slug` | *String* | :heavy_check_mark: | The slug of the template to preview | +| `requestBody` | [Optional](../../models/operations/PreviewTemplateRequestBody.md) | :heavy_minus_sign: | Required parameters | + + +### Response + +**[Optional](../../models/operations/PreviewTemplateResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## toggleDelivery + +Toggles the delivery by Clerk for a template of a given type and slug. +If disabled, Clerk will not deliver the resulting email or SMS. +The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + ToggleTemplateDeliveryResponse res = sdk.templates().toggleDelivery() + .templateType(ToggleTemplateDeliveryPathParamTemplateType.EMAIL) + .slug("") + .requestBody(ToggleTemplateDeliveryRequestBody.builder() + .build()) + .call(); + + if (res.template().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `templateType` | [com.clerk.backend_api.models.operations.ToggleTemplateDeliveryPathParamTemplateType](../../models/operations/ToggleTemplateDeliveryPathParamTemplateType.md) | :heavy_check_mark: | The type of template to toggle delivery for | +| `slug` | *String* | :heavy_check_mark: | The slug of the template for which to toggle delivery | +| `requestBody` | [Optional](../../models/operations/ToggleTemplateDeliveryRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/ToggleTemplateDeliveryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/testingtokens/README.md b/docs/sdks/testingtokens/README.md new file mode 100644 index 0000000..869a958 --- /dev/null +++ b/docs/sdks/testingtokens/README.md @@ -0,0 +1,64 @@ +# TestingTokens +(*testingTokens()*) + +### Available Operations + +* [create](#create) - Retrieve a new testing token + +## create + +Retrieve a new testing token. Only available for development instances. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateTestingTokenResponse res = sdk.testingTokens().create() + .call(); + + if (res.testingToken().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/CreateTestingTokenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ---------------------- | ---------------------- | ---------------------- | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md new file mode 100644 index 0000000..cd7e1c1 --- /dev/null +++ b/docs/sdks/users/README.md @@ -0,0 +1,1345 @@ +# Users +(*users()*) + +### Available Operations + +* [list](#list) - List all users +* [create](#create) - Create a new user +* [count](#count) - Count users +* [get](#get) - Retrieve a user +* [update](#update) - Update a user +* [delete](#delete) - Delete a user +* [ban](#ban) - Ban a user +* [unban](#unban) - Unban a user +* [lock](#lock) - Lock a user +* [unlock](#unlock) - Unlock a user +* [setProfileImage](#setprofileimage) - Set user profile image +* [deleteProfileImage](#deleteprofileimage) - Delete user profile image +* [updateMetadata](#updatemetadata) - Merge and update a user's metadata +* [getOAuthAccessToken](#getoauthaccesstoken) - Retrieve the OAuth access token of a user +* [getOrganizationMemberships](#getorganizationmemberships) - Retrieve all memberships for a user +* [verifyPassword](#verifypassword) - Verify the password of a user +* [verifyTOTP](#verifytotp) - Verify a TOTP or backup code for a user +* [disableMFA](#disablemfa) - Disable a user's MFA methods + +## list + +Returns a list of all users. +The users are returned sorted by creation date, with the newest users appearing first. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetUserListRequest req = GetUserListRequest.builder() + .lastActiveAtSince(1700690400000L) + .build(); + + GetUserListResponse res = sdk.users().list() + .request(req) + .call(); + + while (true) { + if (res.userList().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.GetUserListRequest](../../models/operations/GetUserListRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetUserListResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## create + +Creates a new user. Your user management settings determine how you should setup your user model. + +Any email address and phone number created using this method will be marked as verified. + +Note: If you are performing a migration, check out our guide on [zero downtime migrations](https://clerk.com/docs/deployments/migrate-overview). + +A rate limit rule of 20 requests per 10 seconds is applied to this endpoint. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateUserRequestBody req = CreateUserRequestBody.builder() + .build(); + + CreateUserResponse res = sdk.users().create() + .request(req) + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.CreateUserRequestBody](../../models/operations/CreateUserRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateUserResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,403,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## count + +Returns a total count of all users that match the given filtering criteria. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetUsersCountRequest req = GetUsersCountRequest.builder() + .build(); + + GetUsersCountResponse res = sdk.users().count() + .request(req) + .call(); + + if (res.totalCount().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `request` | [com.clerk.backend_api.models.operations.GetUsersCountRequest](../../models/operations/GetUsersCountRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetUsersCountResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## get + +Retrieve the details of a user + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetUserResponse res = sdk.users().get() + .userId("") + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to retrieve | + + +### Response + +**[Optional](../../models/operations/GetUserResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## update + +Update a user's attributes. + +You can set the user's primary contact identifiers (email address and phone numbers) by updating the `primary_email_address_id` and `primary_phone_number_id` attributes respectively. +Both IDs should correspond to verified identifications that belong to the user. + +You can remove a user's username by setting the username attribute to null or the blank string "". +This is a destructive action; the identification will be deleted forever. +Usernames can be removed only if they are optional in your instance settings and there's at least one other identifier which can be used for authentication. + +This endpoint allows changing a user's password. When passing the `password` parameter directly you have two further options. +You can ignore the password policy checks for your instance by setting the `skip_password_checks` parameter to `true`. +You can also choose to sign the user out of all their active sessions on any device once the password is updated. Just set `sign_out_of_other_sessions` to `true`. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateUserResponse res = sdk.users().update() + .userId("") + .requestBody(UpdateUserRequestBody.builder() + .build()) + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to update | +| `requestBody` | [com.clerk.backend_api.models.operations.UpdateUserRequestBody](../../models/operations/UpdateUserRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateUserResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## delete + +Delete the specified user + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteUserResponse res = sdk.users().delete() + .userId("") + .call(); + + if (res.deletedObject().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to delete | + + +### Response + +**[Optional](../../models/operations/DeleteUserResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## ban + +Marks the given user as banned, which means that all their sessions are revoked and they are not allowed to sign in again. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + BanUserResponse res = sdk.users().ban() + .userId("") + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to ban | + + +### Response + +**[Optional](../../models/operations/BanUserResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## unban + +Removes the ban mark from the given user. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UnbanUserResponse res = sdk.users().unban() + .userId("") + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to unban | + + +### Response + +**[Optional](../../models/operations/UnbanUserResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 402 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## lock + +Marks the given user as locked, which means they are not allowed to sign in again until the lock expires. +Lock duration can be configured in the instance's restrictions settings. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + LockUserResponse res = sdk.users().lock() + .userId("") + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to lock | + + +### Response + +**[Optional](../../models/operations/LockUserResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## unlock + +Removes the lock from the given user. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UnlockUserResponse res = sdk.users().unlock() + .userId("") + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to unlock | + + +### Response + +**[Optional](../../models/operations/UnlockUserResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## setProfileImage + +Update a user's profile image + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + SetUserProfileImageResponse res = sdk.users().setProfileImage() + .userId("") + .requestBody(SetUserProfileImageRequestBody.builder() + .build()) + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to update the profile image for | +| `requestBody` | [com.clerk.backend_api.models.operations.SetUserProfileImageRequestBody](../../models/operations/SetUserProfileImageRequestBody.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Optional](../../models/operations/SetUserProfileImageResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## deleteProfileImage + +Delete a user's profile image + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteUserProfileImageResponse res = sdk.users().deleteProfileImage() + .userId("") + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user to delete the profile image for | + + +### Response + +**[Optional](../../models/operations/DeleteUserProfileImageResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 404 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## updateMetadata + +Update a user's metadata attributes by merging existing values with the provided parameters. + +This endpoint behaves differently than the *Update a user* endpoint. +Metadata values will not be replaced entirely. +Instead, a deep merge will be performed. +Deep means that any nested JSON objects will be merged as well. + +You can remove metadata keys at any level by setting their value to `null`. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UpdateUserMetadataResponse res = sdk.users().updateMetadata() + .userId("") + .requestBody(UpdateUserMetadataRequestBody.builder() + .build()) + .call(); + + if (res.user().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user whose metadata will be updated and merged | +| `requestBody` | [Optional](../../models/operations/UpdateUserMetadataRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/UpdateUserMetadataResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400,401,404,422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## getOAuthAccessToken + +Fetch the corresponding OAuth access token for a user that has previously authenticated with a particular OAuth provider. +For OAuth 2.0, if the access token has expired and we have a corresponding refresh token, the access token will be refreshed transparently the new one will be returned. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GetOAuthAccessTokenResponse res = sdk.users().getOAuthAccessToken() + .userId("") + .provider("") + .call(); + + if (res.responseBodies().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user for which to retrieve the OAuth access token | +| `provider` | *String* | :heavy_check_mark: | The ID of the OAuth provider (e.g. `oauth_google`) | + + +### Response + +**[Optional](../../models/operations/GetOAuthAccessTokenResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 422 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## getOrganizationMemberships + +Retrieve a paginated list of the user's organization memberships + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + UsersGetOrganizationMembershipsResponse res = sdk.users().getOrganizationMemberships() + .userId("") + .limit(10L) + .offset(0L) + .call(); + + while (true) { + if (res.organizationMemberships().isPresent()) { + // handle response + Optional nextRes = res.next(); + if (nextRes.isPresent()) { + res = nextRes.get(); + } else { + break; + } + } + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user whose organization memberships we want to retrieve | +| `limit` | *Optional* | :heavy_minus_sign: | Applies a limit to the number of results returned.
Can be used for paginating the results together with `offset`. | +| `offset` | *Optional* | :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`. | + + +### Response + +**[Optional](../../models/operations/UsersGetOrganizationMembershipsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 403 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## verifyPassword + +Check that the user's password matches the supplied input. +Useful for custom auth flows and re-verification. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + VerifyPasswordResponse res = sdk.users().verifyPassword() + .userId("") + .requestBody(VerifyPasswordRequestBody.builder() + .password("") + .build()) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user for whom to verify the password | +| `requestBody` | [Optional](../../models/operations/VerifyPasswordRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/VerifyPasswordResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 500 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## verifyTOTP + +Verify that the provided TOTP or backup code is valid for the user. +Verifying a backup code will result it in being consumed (i.e. it will +become invalid). +Useful for custom auth flows and re-verification. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + VerifyTOTPResponse res = sdk.users().verifyTOTP() + .userId("") + .requestBody(VerifyTOTPRequestBody.builder() + .code("") + .build()) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user for whom to verify the TOTP | +| `requestBody` | [Optional](../../models/operations/VerifyTOTPRequestBody.md) | :heavy_minus_sign: | N/A | + + +### Response + +**[Optional](../../models/operations/VerifyTOTPResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 500 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## disableMFA + +Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once. + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DisableMFAResponse res = sdk.users().disableMFA() + .userId("") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `userId` | *String* | :heavy_check_mark: | The ID of the user whose MFA methods are to be disabled | + + +### Response + +**[Optional](../../models/operations/DisableMFAResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 404,500 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md new file mode 100644 index 0000000..618d259 --- /dev/null +++ b/docs/sdks/webhooks/README.md @@ -0,0 +1,192 @@ +# Webhooks +(*webhooks()*) + +### Available Operations + +* [createSvixApp](#createsvixapp) - Create a Svix app +* [deleteSvixApp](#deletesvixapp) - Delete a Svix app +* [generateSvixAuthURL](#generatesvixauthurl) - Create a Svix Dashboard URL + +## createSvixApp + +Create a Svix app and associate it with the current instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + CreateSvixAppResponse res = sdk.webhooks().createSvixApp() + .call(); + + if (res.svixURL().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/CreateSvixAppResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## deleteSvixApp + +Delete a Svix app and disassociate it from the current instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + DeleteSvixAppResponse res = sdk.webhooks().deleteSvixApp() + .call(); + + // handle response + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/DeleteSvixAppResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | + +## generateSvixAuthURL + +Generate a new url for accessing the Svix's management dashboard for that particular instance + +### Example Usage + +```java +package hello.world; + +import com.clerk.backend_api.Clerk; +import com.clerk.backend_api.models.components.*; +import com.clerk.backend_api.models.components.Security; +import com.clerk.backend_api.models.operations.*; +import com.clerk.backend_api.utils.EventStream; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) throws Exception { + try { + Clerk sdk = Clerk.builder() + .bearerAuth("") + .build(); + + GenerateSvixAuthURLResponse res = sdk.webhooks().generateSvixAuthURL() + .call(); + + if (res.svixURL().isPresent()) { + // handle response + } + } catch (com.clerk.backend_api.models.errors.ClerkErrors e) { + // handle exception + throw e; + } catch (com.clerk.backend_api.models.errors.SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + } +} +``` + + +### Response + +**[Optional](../../models/operations/GenerateSvixAuthURLResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| models/errors/ClerkErrors | 400 | application/json | +| models/errors/SDKError | 4xx-5xx | */* | diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..d64cd49 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..1af9e09 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..1aa94a4 --- /dev/null +++ b/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100755 index 0000000..93e3f59 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..12ff7d3 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,10 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * The settings file is used to specify which projects to include in your build. + * + * Detailed information about configuring a multi-project build in Gradle can be found + * in the user manual at https://docs.gradle.org/7.5.1/userguide/multi_project_builds.html + */ + +rootProject.name = 'openapi' diff --git a/src/main/java/com/clerk/backend_api/Actors.java b/src/main/java/com/clerk/backend_api/Actors.java new file mode 100644 index 0000000..88cdb52 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Actors.java @@ -0,0 +1,297 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Actors implements + MethodCallCreateActorToken, + MethodCallRevokeActorToken { + + private final SDKConfiguration sdkConfiguration; + + Actors(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Create actor token + * Create an actor token that can be used to impersonate the given user. + * The `actor` parameter needs to include at least a "sub" key whose value is the ID of the actor (impersonating) user. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateActorTokenRequestBuilder createToken() { + return new com.clerk.backend_api.models.operations.CreateActorTokenRequestBuilder(this); + } + + /** + * Create actor token + * Create an actor token that can be used to impersonate the given user. + * The `actor` parameter needs to include at least a "sub" key whose value is the ID of the actor (impersonating) user. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateActorTokenResponse createTokenDirect() throws Exception { + return createToken(Optional.empty()); + } + /** + * Create actor token + * Create an actor token that can be used to impersonate the given user. + * The `actor` parameter needs to include at least a "sub" key whose value is the ID of the actor (impersonating) user. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateActorTokenResponse createToken( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/actor_tokens"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateActorToken", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateActorToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateActorToken", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateActorToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateActorTokenResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateActorTokenResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateActorTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.ActorToken _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withActorToken(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Revoke actor token + * Revokes a pending actor token. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.RevokeActorTokenRequestBuilder revokeToken() { + return new com.clerk.backend_api.models.operations.RevokeActorTokenRequestBuilder(this); + } + + /** + * Revoke actor token + * Revokes a pending actor token. + * @param actorTokenId The ID of the actor token to be revoked. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.RevokeActorTokenResponse revokeToken( + String actorTokenId) throws Exception { + com.clerk.backend_api.models.operations.RevokeActorTokenRequest request = + com.clerk.backend_api.models.operations.RevokeActorTokenRequest + .builder() + .actorTokenId(actorTokenId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.RevokeActorTokenRequest.class, + _baseUrl, + "/actor_tokens/{actor_token_id}/revoke", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("RevokeActorToken", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("RevokeActorToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("RevokeActorToken", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("RevokeActorToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.RevokeActorTokenResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.RevokeActorTokenResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.RevokeActorTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.ActorToken _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withActorToken(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Allowlist.java b/src/main/java/com/clerk/backend_api/Allowlist.java new file mode 100644 index 0000000..9ee6a2b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Allowlist.java @@ -0,0 +1,410 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Allowlist implements + MethodCallListAllowlistIdentifiers, + MethodCallCreateAllowlistIdentifier, + MethodCallDeleteAllowlistIdentifier { + + private final SDKConfiguration sdkConfiguration; + + Allowlist(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all identifiers on the allow-list + * Get a list of all identifiers allowed to sign up to an instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListAllowlistIdentifiersRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListAllowlistIdentifiersRequestBuilder(this); + } + + /** + * List all identifiers on the allow-list + * Get a list of all identifiers allowed to sign up to an instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListAllowlistIdentifiersResponse listDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/allowlist_identifiers"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListAllowlistIdentifiers", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "402", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListAllowlistIdentifiers", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListAllowlistIdentifiers", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListAllowlistIdentifiers", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.ListAllowlistIdentifiersResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListAllowlistIdentifiersResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.ListAllowlistIdentifiersResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference>() {}); + _res.withAllowlistIdentifierList(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "402")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Add identifier to the allow-list + * Create an identifier allowed to sign up to an instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateAllowlistIdentifierRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateAllowlistIdentifierRequestBuilder(this); + } + + /** + * Add identifier to the allow-list + * Create an identifier allowed to sign up to an instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateAllowlistIdentifierResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Add identifier to the allow-list + * Create an identifier allowed to sign up to an instance + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateAllowlistIdentifierResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/allowlist_identifiers"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateAllowlistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateAllowlistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateAllowlistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateAllowlistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateAllowlistIdentifierResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateAllowlistIdentifierResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateAllowlistIdentifierResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.AllowlistIdentifier _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withAllowlistIdentifier(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete identifier from allow-list + * Delete an identifier from the instance allow-list + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierRequestBuilder(this); + } + + /** + * Delete identifier from allow-list + * Delete an identifier from the instance allow-list + * @param identifierId The ID of the identifier to delete from the allow-list + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierResponse delete( + String identifierId) throws Exception { + com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierRequest request = + com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierRequest + .builder() + .identifierId(identifierId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierRequest.class, + _baseUrl, + "/allowlist_identifiers/{identifier_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteAllowlistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteAllowlistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteAllowlistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteAllowlistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Blocklist.java b/src/main/java/com/clerk/backend_api/Blocklist.java new file mode 100644 index 0000000..a53a04d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Blocklist.java @@ -0,0 +1,410 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Blocklist implements + MethodCallListBlocklistIdentifiers, + MethodCallCreateBlocklistIdentifier, + MethodCallDeleteBlocklistIdentifier { + + private final SDKConfiguration sdkConfiguration; + + Blocklist(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all identifiers on the block-list + * Get a list of all identifiers which are not allowed to access an instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListBlocklistIdentifiersRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListBlocklistIdentifiersRequestBuilder(this); + } + + /** + * List all identifiers on the block-list + * Get a list of all identifiers which are not allowed to access an instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListBlocklistIdentifiersResponse listDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/blocklist_identifiers"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListBlocklistIdentifiers", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "402", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListBlocklistIdentifiers", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListBlocklistIdentifiers", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListBlocklistIdentifiers", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.ListBlocklistIdentifiersResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListBlocklistIdentifiersResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.ListBlocklistIdentifiersResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.BlocklistIdentifiers _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withBlocklistIdentifiers(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "402")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Add identifier to the block-list + * Create an identifier that is blocked from accessing an instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateBlocklistIdentifierRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateBlocklistIdentifierRequestBuilder(this); + } + + /** + * Add identifier to the block-list + * Create an identifier that is blocked from accessing an instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateBlocklistIdentifierResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Add identifier to the block-list + * Create an identifier that is blocked from accessing an instance + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateBlocklistIdentifierResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/blocklist_identifiers"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateBlocklistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateBlocklistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateBlocklistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateBlocklistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateBlocklistIdentifierResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateBlocklistIdentifierResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateBlocklistIdentifierResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.BlocklistIdentifier _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withBlocklistIdentifier(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete identifier from block-list + * Delete an identifier from the instance block-list + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierRequestBuilder(this); + } + + /** + * Delete identifier from block-list + * Delete an identifier from the instance block-list + * @param identifierId The ID of the identifier to delete from the block-list + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierResponse delete( + String identifierId) throws Exception { + com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierRequest request = + com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierRequest + .builder() + .identifierId(identifierId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierRequest.class, + _baseUrl, + "/blocklist_identifiers/{identifier_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteBlocklistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteBlocklistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteBlocklistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteBlocklistIdentifier", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Clerk.java b/src/main/java/com/clerk/backend_api/Clerk.java new file mode 100644 index 0000000..aad48a3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Clerk.java @@ -0,0 +1,359 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.RetryConfig; +import com.clerk.backend_api.utils.SpeakeasyHTTPClient; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Clerk Backend API: The Clerk REST Backend API, meant to be accessed by backend + * servers. + * + * ### Versions + * + * When the API changes in a way that isn't compatible with older versions, a new version is released. + * Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/backend-requests/versioning/overview). + * + * + * Please see https://clerk.com/docs for more information. + * https://clerk.com/docs + */ +public class Clerk { + + + /** + * SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] SERVERS = { + "https://api.clerk.com/v1", + }; + + private final Miscellaneous miscellaneous; + + private final Jwks jwks; + + private final Clients clients; + + private final EmailAddresses emailAddresses; + + private final PhoneNumbers phoneNumbers; + + private final Sessions sessions; + + private final Templates templates; + + private final Users users; + + private final Invitations invitations; + + private final Allowlist allowlist; + + private final Blocklist blocklist; + + private final Instance instance; + + private final Actors actors; + + private final Domains domains; + + private final Webhooks webhooks; + + private final JwtTemplates jwtTemplates; + + private final Organizations organizations; + + private final OrganizationInvitations organizationInvitations; + + private final OrganizationMemberships organizationMemberships; + + private final Proxy proxy; + + private final RedirectURLs redirectURLs; + + private final SignInTokens signInTokens; + + private final SignUps signUps; + + private final OAuthApplications oAuthApplications; + + private final SamlConnections samlConnections; + + private final TestingTokens testingTokens; + + public Miscellaneous miscellaneous() { + return miscellaneous; + } + + public Jwks jwks() { + return jwks; + } + + public Clients clients() { + return clients; + } + + public EmailAddresses emailAddresses() { + return emailAddresses; + } + + public PhoneNumbers phoneNumbers() { + return phoneNumbers; + } + + public Sessions sessions() { + return sessions; + } + + public Templates templates() { + return templates; + } + + public Users users() { + return users; + } + + public Invitations invitations() { + return invitations; + } + + public Allowlist allowlist() { + return allowlist; + } + + public Blocklist blocklist() { + return blocklist; + } + + public Instance instance() { + return instance; + } + + public Actors actors() { + return actors; + } + + public Domains domains() { + return domains; + } + + public Webhooks webhooks() { + return webhooks; + } + + public JwtTemplates jwtTemplates() { + return jwtTemplates; + } + + public Organizations organizations() { + return organizations; + } + + public OrganizationInvitations organizationInvitations() { + return organizationInvitations; + } + + public OrganizationMemberships organizationMemberships() { + return organizationMemberships; + } + + public Proxy proxy() { + return proxy; + } + + public RedirectURLs redirectURLs() { + return redirectURLs; + } + + public SignInTokens signInTokens() { + return signInTokens; + } + + public SignUps signUps() { + return signUps; + } + + public OAuthApplications oAuthApplications() { + return oAuthApplications; + } + + public SamlConnections samlConnections() { + return samlConnections; + } + + public TestingTokens testingTokens() { + return testingTokens; + } + + private final SDKConfiguration sdkConfiguration; + + /** + * The Builder class allows the configuration of a new instance of the SDK. + */ + public static class Builder { + + private final SDKConfiguration sdkConfiguration = new SDKConfiguration(); + + private Builder() { + } + + /** + * Allows the default HTTP client to be overridden with a custom implementation. + * + * @param client The HTTP client to use for all requests. + * @return The builder instance. + */ + public Builder client(HTTPClient client) { + this.sdkConfiguration.defaultClient = client; + return this; + } + /** + * Configures the SDK security to use the provided secret. + * + * @param bearerAuth The secret to use for all requests. + * @return The builder instance. + */ + public Builder bearerAuth(String bearerAuth) { + this.sdkConfiguration.securitySource = SecuritySource.of(com.clerk.backend_api.models.components.Security.builder() + .bearerAuth(bearerAuth) + .build()); + return this; + } + + /** + * Configures the SDK to use a custom security source. + * @param securitySource The security source to use for all requests. + * @return The builder instance. + */ + public Builder securitySource(SecuritySource securitySource) { + this.sdkConfiguration.securitySource = securitySource; + return this; + } + + /** + * Overrides the default server URL. + * + * @param serverUrl The server URL to use for all requests. + * @return The builder instance. + */ + public Builder serverURL(String serverUrl) { + this.sdkConfiguration.serverUrl = serverUrl; + return this; + } + + /** + * Overrides the default server URL with a templated URL populated with the provided parameters. + * + * @param serverUrl The server URL to use for all requests. + * @param params The parameters to use when templating the URL. + * @return The builder instance. + */ + public Builder serverURL(String serverUrl, java.util.Map params) { + this.sdkConfiguration.serverUrl = com.clerk.backend_api.utils.Utils.templateUrl(serverUrl, params); + return this; + } + + /** + * Overrides the default server by index. + * + * @param serverIdx The server to use for all requests. + * @return The builder instance. + */ + public Builder serverIndex(int serverIdx) { + this.sdkConfiguration.serverIdx = serverIdx; + this.sdkConfiguration.serverUrl = SERVERS[serverIdx]; + return this; + } + + /** + * Overrides the default configuration for retries + * + * @param retryConfig The retry configuration to use for all requests. + * @return The builder instance. + */ + public Builder retryConfig(RetryConfig retryConfig) { + this.sdkConfiguration.retryConfig = Optional.of(retryConfig); + return this; + } + // Visible for testing, will be accessed via reflection + void _hooks(com.clerk.backend_api.utils.Hooks hooks) { + sdkConfiguration.setHooks(hooks); + } + + /** + * Builds a new instance of the SDK. + * @return The SDK instance. + */ + public Clerk build() { + if (sdkConfiguration.defaultClient == null) { + sdkConfiguration.defaultClient = new SpeakeasyHTTPClient(); + } + if (sdkConfiguration.securitySource == null) { + sdkConfiguration.securitySource = SecuritySource.of(null); + } + if (sdkConfiguration.serverUrl == null || sdkConfiguration.serverUrl.isBlank()) { + sdkConfiguration.serverUrl = SERVERS[0]; + sdkConfiguration.serverIdx = 0; + } + if (sdkConfiguration.serverUrl.endsWith("/")) { + sdkConfiguration.serverUrl = sdkConfiguration.serverUrl.substring(0, sdkConfiguration.serverUrl.length() - 1); + } + return new Clerk(sdkConfiguration); + } + } + + /** + * Get a new instance of the SDK builder to configure a new instance of the SDK. + * @return The SDK builder instance. + */ + public static Builder builder() { + return new Builder(); + } + + private Clerk(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.miscellaneous = new Miscellaneous(sdkConfiguration); + this.jwks = new Jwks(sdkConfiguration); + this.clients = new Clients(sdkConfiguration); + this.emailAddresses = new EmailAddresses(sdkConfiguration); + this.phoneNumbers = new PhoneNumbers(sdkConfiguration); + this.sessions = new Sessions(sdkConfiguration); + this.templates = new Templates(sdkConfiguration); + this.users = new Users(sdkConfiguration); + this.invitations = new Invitations(sdkConfiguration); + this.allowlist = new Allowlist(sdkConfiguration); + this.blocklist = new Blocklist(sdkConfiguration); + this.instance = new Instance(sdkConfiguration); + this.actors = new Actors(sdkConfiguration); + this.domains = new Domains(sdkConfiguration); + this.webhooks = new Webhooks(sdkConfiguration); + this.jwtTemplates = new JwtTemplates(sdkConfiguration); + this.organizations = new Organizations(sdkConfiguration); + this.organizationInvitations = new OrganizationInvitations(sdkConfiguration); + this.organizationMemberships = new OrganizationMemberships(sdkConfiguration); + this.proxy = new Proxy(sdkConfiguration); + this.redirectURLs = new RedirectURLs(sdkConfiguration); + this.signInTokens = new SignInTokens(sdkConfiguration); + this.signUps = new SignUps(sdkConfiguration); + this.oAuthApplications = new OAuthApplications(sdkConfiguration); + this.samlConnections = new SamlConnections(sdkConfiguration); + this.testingTokens = new TestingTokens(sdkConfiguration); + this.sdkConfiguration.initialize(); + }} diff --git a/src/main/java/com/clerk/backend_api/Clients.java b/src/main/java/com/clerk/backend_api/Clients.java new file mode 100644 index 0000000..ea2c01b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Clients.java @@ -0,0 +1,482 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Clients implements + MethodCallGetClientList, + MethodCallVerifyClient, + MethodCallGetClient { + + private final SDKConfiguration sdkConfiguration; + + Clients(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all clients + * Returns a list of all clients. The clients are returned sorted by creation date, + * with the newest clients appearing first. + * Warning: the endpoint is being deprecated and will be removed in future versions. + * @return The call builder + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.GetClientListRequestBuilder list() { + return new com.clerk.backend_api.models.operations.GetClientListRequestBuilder(this); + } + + /** + * List all clients + * Returns a list of all clients. The clients are returned sorted by creation date, + * with the newest clients appearing first. + * Warning: the endpoint is being deprecated and will be removed in future versions. + * @return The response from the API call + * @throws Exception if the API call fails + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.GetClientListResponse listDirect() throws Exception { + return list(Optional.empty(), Optional.empty()); + } + /** + * List all clients + * Returns a list of all clients. The clients are returned sorted by creation date, + * with the newest clients appearing first. + * Warning: the endpoint is being deprecated and will be removed in future versions. + * @param limit Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + * @param offset Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + * @return The response from the API call + * @throws Exception if the API call fails + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.GetClientListResponse list( + Optional limit, + Optional offset) throws Exception { + com.clerk.backend_api.models.operations.GetClientListRequest request = + com.clerk.backend_api.models.operations.GetClientListRequest + .builder() + .limit(limit) + .offset(offset) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/clients"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.GetClientListRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetClientList", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "410", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetClientList", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetClientList", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetClientList", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.GetClientListResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetClientListResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.GetClientListRequestBuilder _ret = list(); + _ret.limit(_resolvedLimit); + _ret.offset(_newOffset); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.GetClientListResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference>() {}); + _res.withClientList(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "410", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Verify a client + * Verifies the client in the provided token + * @return The call builder + */ + public com.clerk.backend_api.models.operations.VerifyClientRequestBuilder verify() { + return new com.clerk.backend_api.models.operations.VerifyClientRequestBuilder(this); + } + + /** + * Verify a client + * Verifies the client in the provided token + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.VerifyClientResponse verifyDirect() throws Exception { + return verify(Optional.empty()); + } + /** + * Verify a client + * Verifies the client in the provided token + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.VerifyClientResponse verify( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/clients/verify"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("VerifyClient", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("VerifyClient", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("VerifyClient", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("VerifyClient", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.VerifyClientResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.VerifyClientResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.VerifyClientResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Client _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withClient(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Get a client + * Returns the details of a client. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetClientRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetClientRequestBuilder(this); + } + + /** + * Get a client + * Returns the details of a client. + * @param clientId Client ID. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetClientResponse get( + String clientId) throws Exception { + com.clerk.backend_api.models.operations.GetClientRequest request = + com.clerk.backend_api.models.operations.GetClientRequest + .builder() + .clientId(clientId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetClientRequest.class, + _baseUrl, + "/clients/{client_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetClient", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetClient", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetClient", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetClient", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetClientResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetClientResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetClientResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Client _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withClient(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Domains.java b/src/main/java/com/clerk/backend_api/Domains.java new file mode 100644 index 0000000..d2ea2d0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Domains.java @@ -0,0 +1,563 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Domains implements + MethodCallListDomains, + MethodCallAddDomain, + MethodCallDeleteDomain, + MethodCallUpdateDomain { + + private final SDKConfiguration sdkConfiguration; + + Domains(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all instance domains + * Use this endpoint to get a list of all domains for an instance. + * The response will contain the primary domain for the instance and any satellite domains. Each domain in the response contains information about the URLs where Clerk operates and the required CNAME targets. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListDomainsRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListDomainsRequestBuilder(this); + } + + /** + * List all instance domains + * Use this endpoint to get a list of all domains for an instance. + * The response will contain the primary domain for the instance and any satellite domains. Each domain in the response contains information about the URLs where Clerk operates and the required CNAME targets. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListDomainsResponse listDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/domains"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListDomains", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListDomains", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListDomains", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListDomains", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.ListDomainsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListDomainsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.ListDomainsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Domains _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDomains(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Add a domain + * Add a new domain for your instance. + * Useful in the case of multi-domain instances, allows adding satellite domains to an instance. + * The new domain must have a `name`. The domain name can contain the port for development instances, like `localhost:3000`. + * At the moment, instances can have only one primary domain, so the `is_satellite` parameter must be set to `true`. + * If you're planning to configure the new satellite domain to run behind a proxy, pass the `proxy_url` parameter accordingly. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.AddDomainRequestBuilder add() { + return new com.clerk.backend_api.models.operations.AddDomainRequestBuilder(this); + } + + /** + * Add a domain + * Add a new domain for your instance. + * Useful in the case of multi-domain instances, allows adding satellite domains to an instance. + * The new domain must have a `name`. The domain name can contain the port for development instances, like `localhost:3000`. + * At the moment, instances can have only one primary domain, so the `is_satellite` parameter must be set to `true`. + * If you're planning to configure the new satellite domain to run behind a proxy, pass the `proxy_url` parameter accordingly. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.AddDomainResponse addDirect() throws Exception { + return add(Optional.empty()); + } + /** + * Add a domain + * Add a new domain for your instance. + * Useful in the case of multi-domain instances, allows adding satellite domains to an instance. + * The new domain must have a `name`. The domain name can contain the port for development instances, like `localhost:3000`. + * At the moment, instances can have only one primary domain, so the `is_satellite` parameter must be set to `true`. + * If you're planning to configure the new satellite domain to run behind a proxy, pass the `proxy_url` parameter accordingly. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.AddDomainResponse add( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/domains"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("AddDomain", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("AddDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("AddDomain", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("AddDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.AddDomainResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.AddDomainResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.AddDomainResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Domain _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDomain(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete a satellite domain + * Deletes a satellite domain for the instance. + * It is currently not possible to delete the instance's primary domain. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteDomainRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteDomainRequestBuilder(this); + } + + /** + * Delete a satellite domain + * Deletes a satellite domain for the instance. + * It is currently not possible to delete the instance's primary domain. + * @param domainId The ID of the domain that will be deleted. Must be a satellite domain. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteDomainResponse delete( + String domainId) throws Exception { + com.clerk.backend_api.models.operations.DeleteDomainRequest request = + com.clerk.backend_api.models.operations.DeleteDomainRequest + .builder() + .domainId(domainId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteDomainRequest.class, + _baseUrl, + "/domains/{domain_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteDomain", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteDomain", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteDomainResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteDomainResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteDomainResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update a domain + * The `proxy_url` can be updated only for production instances. + * Update one of the instance's domains. Both primary and satellite domains can be updated. + * If you choose to use Clerk via proxy, use this endpoint to specify the `proxy_url`. + * Whenever you decide you'd rather switch to DNS setup for Clerk, simply set `proxy_url` + * to `null` for the domain. When you update a production instance's primary domain name, + * you have to make sure that you've completed all the necessary setup steps for DNS and + * emails to work. Expect downtime otherwise. Updating a primary domain's name will also + * update the instance's home origin, affecting the default application paths. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateDomainRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateDomainRequestBuilder(this); + } + + /** + * Update a domain + * The `proxy_url` can be updated only for production instances. + * Update one of the instance's domains. Both primary and satellite domains can be updated. + * If you choose to use Clerk via proxy, use this endpoint to specify the `proxy_url`. + * Whenever you decide you'd rather switch to DNS setup for Clerk, simply set `proxy_url` + * to `null` for the domain. When you update a production instance's primary domain name, + * you have to make sure that you've completed all the necessary setup steps for DNS and + * emails to work. Expect downtime otherwise. Updating a primary domain's name will also + * update the instance's home origin, affecting the default application paths. + * @param domainId The ID of the domain that will be updated. + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateDomainResponse update( + String domainId, + com.clerk.backend_api.models.operations.UpdateDomainRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateDomainRequest request = + com.clerk.backend_api.models.operations.UpdateDomainRequest + .builder() + .domainId(domainId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateDomainRequest.class, + _baseUrl, + "/domains/{domain_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateDomain", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateDomain", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateDomainResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateDomainResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateDomainResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Domain _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDomain(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/EmailAddresses.java b/src/main/java/com/clerk/backend_api/EmailAddresses.java new file mode 100644 index 0000000..4c8d5ca --- /dev/null +++ b/src/main/java/com/clerk/backend_api/EmailAddresses.java @@ -0,0 +1,565 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class EmailAddresses implements + MethodCallCreateEmailAddress, + MethodCallGetEmailAddress, + MethodCallDeleteEmailAddress, + MethodCallUpdateEmailAddress { + + private final SDKConfiguration sdkConfiguration; + + EmailAddresses(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Create an email address + * Create a new email address + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateEmailAddressRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateEmailAddressRequestBuilder(this); + } + + /** + * Create an email address + * Create a new email address + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateEmailAddressResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create an email address + * Create a new email address + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateEmailAddressResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/email_addresses"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateEmailAddressResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateEmailAddressResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateEmailAddressResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.EmailAddress _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withEmailAddress(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve an email address + * Returns the details of an email address. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetEmailAddressRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetEmailAddressRequestBuilder(this); + } + + /** + * Retrieve an email address + * Returns the details of an email address. + * @param emailAddressId The ID of the email address to retrieve + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetEmailAddressResponse get( + String emailAddressId) throws Exception { + com.clerk.backend_api.models.operations.GetEmailAddressRequest request = + com.clerk.backend_api.models.operations.GetEmailAddressRequest + .builder() + .emailAddressId(emailAddressId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetEmailAddressRequest.class, + _baseUrl, + "/email_addresses/{email_address_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetEmailAddressResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetEmailAddressResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetEmailAddressResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.EmailAddress _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withEmailAddress(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete an email address + * Delete the email address with the given ID + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteEmailAddressRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteEmailAddressRequestBuilder(this); + } + + /** + * Delete an email address + * Delete the email address with the given ID + * @param emailAddressId The ID of the email address to delete + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteEmailAddressResponse delete( + String emailAddressId) throws Exception { + com.clerk.backend_api.models.operations.DeleteEmailAddressRequest request = + com.clerk.backend_api.models.operations.DeleteEmailAddressRequest + .builder() + .emailAddressId(emailAddressId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteEmailAddressRequest.class, + _baseUrl, + "/email_addresses/{email_address_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteEmailAddressResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteEmailAddressResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteEmailAddressResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update an email address + * Updates an email address. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateEmailAddressRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateEmailAddressRequestBuilder(this); + } + + /** + * Update an email address + * Updates an email address. + * @param emailAddressId The ID of the email address to update + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateEmailAddressResponse update( + String emailAddressId) throws Exception { + return update(emailAddressId, Optional.empty()); + } + /** + * Update an email address + * Updates an email address. + * @param emailAddressId The ID of the email address to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateEmailAddressResponse update( + String emailAddressId, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateEmailAddressRequest request = + com.clerk.backend_api.models.operations.UpdateEmailAddressRequest + .builder() + .emailAddressId(emailAddressId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateEmailAddressRequest.class, + _baseUrl, + "/email_addresses/{email_address_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateEmailAddress", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateEmailAddressResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateEmailAddressResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateEmailAddressResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.EmailAddress _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withEmailAddress(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Instance.java b/src/main/java/com/clerk/backend_api/Instance.java new file mode 100644 index 0000000..0fd79a3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Instance.java @@ -0,0 +1,825 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Instance implements + MethodCallUpdateInstanceAuthConfig, + MethodCallUpdateProductionInstanceDomain, + MethodCallUpdateInstance, + MethodCallUpdateInstanceRestrictions, + MethodCallChangeProductionInstanceDomain, + MethodCallUpdateInstanceOrganizationSettings { + + private final SDKConfiguration sdkConfiguration; + + Instance(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Update instance settings + * Updates the settings of an instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigRequestBuilder updateAuthConfig() { + return new com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigRequestBuilder(this); + } + + /** + * Update instance settings + * Updates the settings of an instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigResponse updateAuthConfigDirect() throws Exception { + return updateAuthConfig(Optional.empty()); + } + /** + * Update instance settings + * Updates the settings of an instance + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigResponse updateAuthConfig( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/beta_features/instance_settings"); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateInstanceAuthConfig", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateInstanceAuthConfig", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateInstanceAuthConfig", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateInstanceAuthConfig", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.InstanceSettings _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withInstanceSettings(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update production instance domain + * Change the domain of a production instance. + * + * Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + * + * WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + * @return The call builder + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainRequestBuilder updateProductionDomain() { + return new com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainRequestBuilder(this); + } + + /** + * Update production instance domain + * Change the domain of a production instance. + * + * Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + * + * WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + * @return The response from the API call + * @throws Exception if the API call fails + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainResponse updateProductionDomainDirect() throws Exception { + return updateProductionDomain(Optional.empty()); + } + /** + * Update production instance domain + * Change the domain of a production instance. + * + * Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + * + * WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainResponse updateProductionDomain( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/beta_features/domain"); + + HTTPRequest _req = new HTTPRequest(_url, "PUT"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateProductionInstanceDomain", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateProductionInstanceDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateProductionInstanceDomain", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateProductionInstanceDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "202")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update instance settings + * Updates the settings of an instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateInstanceRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateInstanceRequestBuilder(this); + } + + /** + * Update instance settings + * Updates the settings of an instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateInstanceResponse updateDirect() throws Exception { + return update(Optional.empty()); + } + /** + * Update instance settings + * Updates the settings of an instance + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateInstanceResponse update( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/instance"); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateInstance", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateInstance", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateInstance", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateInstance", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateInstanceResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateInstanceResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateInstanceResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "204")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update instance restrictions + * Updates the restriction settings of an instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsRequestBuilder updateRestrictions() { + return new com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsRequestBuilder(this); + } + + /** + * Update instance restrictions + * Updates the restriction settings of an instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsResponse updateRestrictionsDirect() throws Exception { + return updateRestrictions(Optional.empty()); + } + /** + * Update instance restrictions + * Updates the restriction settings of an instance + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsResponse updateRestrictions( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/instance/restrictions"); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateInstanceRestrictions", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateInstanceRestrictions", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateInstanceRestrictions", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateInstanceRestrictions", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.InstanceRestrictions _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withInstanceRestrictions(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update production instance domain + * Change the domain of a production instance. + * + * Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + * + * WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainRequestBuilder changeProductionDomain() { + return new com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainRequestBuilder(this); + } + + /** + * Update production instance domain + * Change the domain of a production instance. + * + * Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + * + * WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainResponse changeProductionDomainDirect() throws Exception { + return changeProductionDomain(Optional.empty()); + } + /** + * Update production instance domain + * Change the domain of a production instance. + * + * Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + * + * WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainResponse changeProductionDomain( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/instance/change_domain"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ChangeProductionInstanceDomain", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ChangeProductionInstanceDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ChangeProductionInstanceDomain", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ChangeProductionInstanceDomain", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "202")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update instance organization settings + * Updates the organization settings of the instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsRequestBuilder updateOrganizationSettings() { + return new com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsRequestBuilder(this); + } + + /** + * Update instance organization settings + * Updates the organization settings of the instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsResponse updateOrganizationSettingsDirect() throws Exception { + return updateOrganizationSettings(Optional.empty()); + } + /** + * Update instance organization settings + * Updates the organization settings of the instance + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsResponse updateOrganizationSettings( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/instance/organization_settings"); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateInstanceOrganizationSettings", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateInstanceOrganizationSettings", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateInstanceOrganizationSettings", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateInstanceOrganizationSettings", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationSettings _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationSettings(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Invitations.java b/src/main/java/com/clerk/backend_api/Invitations.java new file mode 100644 index 0000000..f9e9676 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Invitations.java @@ -0,0 +1,472 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Invitations implements + MethodCallCreateInvitation, + MethodCallListInvitations, + MethodCallRevokeInvitation { + + private final SDKConfiguration sdkConfiguration; + + Invitations(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Create an invitation + * Creates a new invitation for the given email address and sends the invitation email. + * Keep in mind that you cannot create an invitation if there is already one for the given email address. + * Also, trying to create an invitation for an email address that already exists in your application will result to an error. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateInvitationRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateInvitationRequestBuilder(this); + } + + /** + * Create an invitation + * Creates a new invitation for the given email address and sends the invitation email. + * Keep in mind that you cannot create an invitation if there is already one for the given email address. + * Also, trying to create an invitation for an email address that already exists in your application will result to an error. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateInvitationResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create an invitation + * Creates a new invitation for the given email address and sends the invitation email. + * Keep in mind that you cannot create an invitation if there is already one for the given email address. + * Also, trying to create an invitation for an email address that already exists in your application will result to an error. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateInvitationResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/invitations"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateInvitationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateInvitationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateInvitationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Invitation _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withInvitation(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * List all invitations + * Returns all non-revoked invitations for your application, sorted by creation date + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListInvitationsRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListInvitationsRequestBuilder(this); + } + + /** + * List all invitations + * Returns all non-revoked invitations for your application, sorted by creation date + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListInvitationsResponse listDirect() throws Exception { + return list(Optional.empty(), Optional.empty(), Optional.empty()); + } + /** + * List all invitations + * Returns all non-revoked invitations for your application, sorted by creation date + * @param limit Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + * @param offset Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + * @param status Filter invitations based on their status + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListInvitationsResponse list( + Optional limit, + Optional offset, + Optional status) throws Exception { + com.clerk.backend_api.models.operations.ListInvitationsRequest request = + com.clerk.backend_api.models.operations.ListInvitationsRequest + .builder() + .limit(limit) + .offset(offset) + .status(status) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/invitations"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.ListInvitationsRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListInvitations", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListInvitations", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListInvitations", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListInvitations", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.ListInvitationsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListInvitationsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.ListInvitationsRequestBuilder _ret = list(); + _ret.limit(_resolvedLimit); + _ret.offset(_newOffset); + _ret.status(status); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.ListInvitationsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference>() {}); + _res.withInvitationList(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Revokes an invitation + * Revokes the given invitation. + * Revoking an invitation will prevent the user from using the invitation link that was sent to them. + * However, it doesn't prevent the user from signing up if they follow the sign up flow. + * Only active (i.e. non-revoked) invitations can be revoked. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.RevokeInvitationRequestBuilder revoke() { + return new com.clerk.backend_api.models.operations.RevokeInvitationRequestBuilder(this); + } + + /** + * Revokes an invitation + * Revokes the given invitation. + * Revoking an invitation will prevent the user from using the invitation link that was sent to them. + * However, it doesn't prevent the user from signing up if they follow the sign up flow. + * Only active (i.e. non-revoked) invitations can be revoked. + * @param invitationId The ID of the invitation to be revoked + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.RevokeInvitationResponse revoke( + String invitationId) throws Exception { + com.clerk.backend_api.models.operations.RevokeInvitationRequest request = + com.clerk.backend_api.models.operations.RevokeInvitationRequest + .builder() + .invitationId(invitationId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.RevokeInvitationRequest.class, + _baseUrl, + "/invitations/{invitation_id}/revoke", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("RevokeInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("RevokeInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("RevokeInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("RevokeInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.RevokeInvitationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.RevokeInvitationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.RevokeInvitationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.InvitationRevoked _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withInvitationRevoked(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Jwks.java b/src/main/java/com/clerk/backend_api/Jwks.java new file mode 100644 index 0000000..7b3b159 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Jwks.java @@ -0,0 +1,123 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Jwks implements + MethodCallGetJWKS { + + private final SDKConfiguration sdkConfiguration; + + Jwks(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Retrieve the JSON Web Key Set of the instance + * Retrieve the JSON Web Key Set of the instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetJWKSRequestBuilder getJWKS() { + return new com.clerk.backend_api.models.operations.GetJWKSRequestBuilder(this); + } + + /** + * Retrieve the JSON Web Key Set of the instance + * Retrieve the JSON Web Key Set of the instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetJWKSResponse getJWKSDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/jwks"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "*/*") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetJWKS", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetJWKS", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetJWKS", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetJWKS", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetJWKSResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetJWKSResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetJWKSResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/JwtTemplates.java b/src/main/java/com/clerk/backend_api/JwtTemplates.java new file mode 100644 index 0000000..7b670d7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/JwtTemplates.java @@ -0,0 +1,663 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class JwtTemplates implements + MethodCallListJWTTemplates, + MethodCallCreateJWTTemplate, + MethodCallGetJWTTemplate, + MethodCallUpdateJWTTemplate, + MethodCallDeleteJWTTemplate { + + private final SDKConfiguration sdkConfiguration; + + JwtTemplates(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all templates + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListJWTTemplatesRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListJWTTemplatesRequestBuilder(this); + } + + /** + * List all templates + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListJWTTemplatesResponse listDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/jwt_templates"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListJWTTemplates", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListJWTTemplates", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListJWTTemplates", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListJWTTemplates", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.ListJWTTemplatesResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListJWTTemplatesResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.ListJWTTemplatesResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference>() {}); + _res.withJWTTemplateList(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Create a JWT template + * Create a new JWT template + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateJWTTemplateRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateJWTTemplateRequestBuilder(this); + } + + /** + * Create a JWT template + * Create a new JWT template + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateJWTTemplateResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create a JWT template + * Create a new JWT template + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateJWTTemplateResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/jwt_templates"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateJWTTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateJWTTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateJWTTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.JWTTemplate _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withJWTTemplate(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve a template + * Retrieve the details of a given JWT template + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetJWTTemplateRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetJWTTemplateRequestBuilder(this); + } + + /** + * Retrieve a template + * Retrieve the details of a given JWT template + * @param templateId JWT Template ID + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetJWTTemplateResponse get( + String templateId) throws Exception { + com.clerk.backend_api.models.operations.GetJWTTemplateRequest request = + com.clerk.backend_api.models.operations.GetJWTTemplateRequest + .builder() + .templateId(templateId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetJWTTemplateRequest.class, + _baseUrl, + "/jwt_templates/{template_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetJWTTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetJWTTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetJWTTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.JWTTemplate _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withJWTTemplate(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update a JWT template + * Updates an existing JWT template + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateJWTTemplateRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateJWTTemplateRequestBuilder(this); + } + + /** + * Update a JWT template + * Updates an existing JWT template + * @param templateId The ID of the JWT template to update + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateJWTTemplateResponse update( + String templateId) throws Exception { + return update(templateId, Optional.empty()); + } + /** + * Update a JWT template + * Updates an existing JWT template + * @param templateId The ID of the JWT template to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateJWTTemplateResponse update( + String templateId, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateJWTTemplateRequest request = + com.clerk.backend_api.models.operations.UpdateJWTTemplateRequest + .builder() + .templateId(templateId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateJWTTemplateRequest.class, + _baseUrl, + "/jwt_templates/{template_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateJWTTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateJWTTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateJWTTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.JWTTemplate _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withJWTTemplate(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "402", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete a Template + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteJWTTemplateRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteJWTTemplateRequestBuilder(this); + } + + /** + * Delete a Template + * @param templateId JWT Template ID + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteJWTTemplateResponse delete( + String templateId) throws Exception { + com.clerk.backend_api.models.operations.DeleteJWTTemplateRequest request = + com.clerk.backend_api.models.operations.DeleteJWTTemplateRequest + .builder() + .templateId(templateId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteJWTTemplateRequest.class, + _baseUrl, + "/jwt_templates/{template_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteJWTTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteJWTTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteJWTTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteJWTTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Miscellaneous.java b/src/main/java/com/clerk/backend_api/Miscellaneous.java new file mode 100644 index 0000000..3d61f27 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Miscellaneous.java @@ -0,0 +1,149 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Miscellaneous implements + MethodCallGetPublicInterstitial { + + private final SDKConfiguration sdkConfiguration; + + Miscellaneous(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Returns the markup for the interstitial page + * The Clerk interstitial endpoint serves an html page that loads clerk.js in order to check the user's authentication state. + * It is used by Clerk SDKs when the user's authentication state cannot be immediately determined. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetPublicInterstitialRequestBuilder getPublicInterstitial() { + return new com.clerk.backend_api.models.operations.GetPublicInterstitialRequestBuilder(this); + } + + /** + * Returns the markup for the interstitial page + * The Clerk interstitial endpoint serves an html page that loads clerk.js in order to check the user's authentication state. + * It is used by Clerk SDKs when the user's authentication state cannot be immediately determined. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetPublicInterstitialResponse getPublicInterstitialDirect() throws Exception { + return getPublicInterstitial(Optional.empty(), Optional.empty()); + } + /** + * Returns the markup for the interstitial page + * The Clerk interstitial endpoint serves an html page that loads clerk.js in order to check the user's authentication state. + * It is used by Clerk SDKs when the user's authentication state cannot be immediately determined. + * @param frontendApi The Frontend API key of your instance + * @param publishableKey The publishable key of your instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetPublicInterstitialResponse getPublicInterstitial( + Optional frontendApi, + Optional publishableKey) throws Exception { + com.clerk.backend_api.models.operations.GetPublicInterstitialRequest request = + com.clerk.backend_api.models.operations.GetPublicInterstitialRequest + .builder() + .frontendApi(frontendApi) + .publishableKey(publishableKey) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/public/interstitial"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "*/*") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.GetPublicInterstitialRequest.class, + request, + null)); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetPublicInterstitial", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "500", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetPublicInterstitial", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetPublicInterstitial", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetPublicInterstitial", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetPublicInterstitialResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetPublicInterstitialResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetPublicInterstitialResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "500", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/OAuthApplications.java b/src/main/java/com/clerk/backend_api/OAuthApplications.java new file mode 100644 index 0000000..650f213 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/OAuthApplications.java @@ -0,0 +1,878 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class OAuthApplications implements + MethodCallListOAuthApplications, + MethodCallCreateOAuthApplication, + MethodCallGetOAuthApplication, + MethodCallUpdateOAuthApplication, + MethodCallDeleteOAuthApplication, + MethodCallRotateOAuthApplicationSecret { + + private final SDKConfiguration sdkConfiguration; + + OAuthApplications(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Get a list of OAuth applications for an instance + * This request returns the list of OAuth applications for an instance. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The OAuth applications are ordered by descending creation date. + * Most recent OAuth applications will be returned first. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListOAuthApplicationsRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListOAuthApplicationsRequestBuilder(this); + } + + /** + * Get a list of OAuth applications for an instance + * This request returns the list of OAuth applications for an instance. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The OAuth applications are ordered by descending creation date. + * Most recent OAuth applications will be returned first. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListOAuthApplicationsResponse listDirect() throws Exception { + return list(Optional.empty(), Optional.empty()); + } + /** + * Get a list of OAuth applications for an instance + * This request returns the list of OAuth applications for an instance. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The OAuth applications are ordered by descending creation date. + * Most recent OAuth applications will be returned first. + * @param limit Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + * @param offset Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListOAuthApplicationsResponse list( + Optional limit, + Optional offset) throws Exception { + com.clerk.backend_api.models.operations.ListOAuthApplicationsRequest request = + com.clerk.backend_api.models.operations.ListOAuthApplicationsRequest + .builder() + .limit(limit) + .offset(offset) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/oauth_applications"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.ListOAuthApplicationsRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListOAuthApplications", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListOAuthApplications", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListOAuthApplications", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListOAuthApplications", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.ListOAuthApplicationsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListOAuthApplicationsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.ListOAuthApplicationsRequestBuilder _ret = list(); + _ret.limit(_resolvedLimit); + _ret.offset(_newOffset); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.ListOAuthApplicationsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OAuthApplications _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + _res.withOAuthApplications(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Create an OAuth application + * Creates a new OAuth application with the given name and callback URL for an instance. + * The callback URL must be a valid url. + * All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateOAuthApplicationRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateOAuthApplicationRequestBuilder(this); + } + + /** + * Create an OAuth application + * Creates a new OAuth application with the given name and callback URL for an instance. + * The callback URL must be a valid url. + * All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateOAuthApplicationResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create an OAuth application + * Creates a new OAuth application with the given name and callback URL for an instance. + * The callback URL must be a valid url. + * All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateOAuthApplicationResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/oauth_applications"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateOAuthApplicationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateOAuthApplicationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateOAuthApplicationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OAuthApplicationWithSecret _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOAuthApplicationWithSecret(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve an OAuth application by ID + * Fetches the OAuth application whose ID matches the provided `id` in the path. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetOAuthApplicationRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetOAuthApplicationRequestBuilder(this); + } + + /** + * Retrieve an OAuth application by ID + * Fetches the OAuth application whose ID matches the provided `id` in the path. + * @param oauthApplicationId The ID of the OAuth application + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetOAuthApplicationResponse get( + String oauthApplicationId) throws Exception { + com.clerk.backend_api.models.operations.GetOAuthApplicationRequest request = + com.clerk.backend_api.models.operations.GetOAuthApplicationRequest + .builder() + .oauthApplicationId(oauthApplicationId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetOAuthApplicationRequest.class, + _baseUrl, + "/oauth_applications/{oauth_application_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetOAuthApplicationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetOAuthApplicationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetOAuthApplicationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OAuthApplication _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOAuthApplication(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update an OAuth application + * Updates an existing OAuth application + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequestBuilder updateApplication() { + return new com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequestBuilder(this); + } + + /** + * Update an OAuth application + * Updates an existing OAuth application + * @param oauthApplicationId The ID of the OAuth application to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateOAuthApplicationResponse updateApplication( + String oauthApplicationId, + com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequest request = + com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequest + .builder() + .oauthApplicationId(oauthApplicationId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequest.class, + _baseUrl, + "/oauth_applications/{oauth_application_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateOAuthApplicationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateOAuthApplicationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateOAuthApplicationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OAuthApplication _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOAuthApplication(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete an OAuth application + * Deletes the given OAuth application. + * This is not reversible. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteOAuthApplicationRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteOAuthApplicationRequestBuilder(this); + } + + /** + * Delete an OAuth application + * Deletes the given OAuth application. + * This is not reversible. + * @param oauthApplicationId The ID of the OAuth application to delete + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteOAuthApplicationResponse delete( + String oauthApplicationId) throws Exception { + com.clerk.backend_api.models.operations.DeleteOAuthApplicationRequest request = + com.clerk.backend_api.models.operations.DeleteOAuthApplicationRequest + .builder() + .oauthApplicationId(oauthApplicationId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteOAuthApplicationRequest.class, + _baseUrl, + "/oauth_applications/{oauth_application_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteOAuthApplication", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteOAuthApplicationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteOAuthApplicationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteOAuthApplicationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Rotate the client secret of the given OAuth application + * Rotates the OAuth application's client secret. + * When the client secret is rotated, make sure to update it in authorized OAuth clients. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretRequestBuilder rotateSecret() { + return new com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretRequestBuilder(this); + } + + /** + * Rotate the client secret of the given OAuth application + * Rotates the OAuth application's client secret. + * When the client secret is rotated, make sure to update it in authorized OAuth clients. + * @param oauthApplicationId The ID of the OAuth application for which to rotate the client secret + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretResponse rotateSecret( + String oauthApplicationId) throws Exception { + com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretRequest request = + com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretRequest + .builder() + .oauthApplicationId(oauthApplicationId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretRequest.class, + _baseUrl, + "/oauth_applications/{oauth_application_id}/rotate_secret", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("RotateOAuthApplicationSecret", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("RotateOAuthApplicationSecret", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("RotateOAuthApplicationSecret", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("RotateOAuthApplicationSecret", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OAuthApplicationWithSecret _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOAuthApplicationWithSecret(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/OrganizationInvitations.java b/src/main/java/com/clerk/backend_api/OrganizationInvitations.java new file mode 100644 index 0000000..1b51a7e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/OrganizationInvitations.java @@ -0,0 +1,1044 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class OrganizationInvitations implements + MethodCallCreateOrganizationInvitation, + MethodCallListOrganizationInvitations, + MethodCallCreateOrganizationInvitationBulk, + MethodCallListPendingOrganizationInvitations, + MethodCallGetOrganizationInvitation, + MethodCallRevokeOrganizationInvitation { + + private final SDKConfiguration sdkConfiguration; + + OrganizationInvitations(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Create and send an organization invitation + * Creates a new organization invitation and sends an email to the provided `email_address` with a link to accept the invitation and join the organization. + * You can specify the `role` for the invited organization member. + * + * New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. + * + * The request body supports passing an optional `redirect_url` parameter. + * When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. + * Use this parameter to implement a custom invitation acceptance flow. + * + * You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. + * That user must be a member with administrator privileges in the organization. + * Only "admin" members can create organization invitations. + * + * You can optionally provide public and private metadata for the organization invitation. + * The public metadata are visible by both the Frontend and the Backend whereas the private ones only by the Backend. + * When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequestBuilder(this); + } + + /** + * Create and send an organization invitation + * Creates a new organization invitation and sends an email to the provided `email_address` with a link to accept the invitation and join the organization. + * You can specify the `role` for the invited organization member. + * + * New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. + * + * The request body supports passing an optional `redirect_url` parameter. + * When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. + * Use this parameter to implement a custom invitation acceptance flow. + * + * You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. + * That user must be a member with administrator privileges in the organization. + * Only "admin" members can create organization invitations. + * + * You can optionally provide public and private metadata for the organization invitation. + * The public metadata are visible by both the Frontend and the Backend whereas the private ones only by the Backend. + * When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + * @param organizationId The ID of the organization for which to send the invitation + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateOrganizationInvitationResponse create( + String organizationId, + com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequest request = + com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequest + .builder() + .organizationId(organizationId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequest.class, + _baseUrl, + "/organizations/{organization_id}/invitations", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateOrganizationInvitationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateOrganizationInvitationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateOrganizationInvitationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationInvitation _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationInvitation(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Get a list of organization invitations + * This request returns the list of organization invitations. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * You can filter them by providing the 'status' query parameter, that accepts multiple values. + * The organization invitations are ordered by descending creation date. + * Most recent invitations will be returned first. + * Any invitations created as a result of an Organization Domain are not included in the results. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListOrganizationInvitationsRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListOrganizationInvitationsRequestBuilder(this); + } + + /** + * Get a list of organization invitations + * This request returns the list of organization invitations. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * You can filter them by providing the 'status' query parameter, that accepts multiple values. + * The organization invitations are ordered by descending creation date. + * Most recent invitations will be returned first. + * Any invitations created as a result of an Organization Domain are not included in the results. + * @param organizationId The organization ID. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListOrganizationInvitationsResponse list( + String organizationId) throws Exception { + return list(organizationId, Optional.empty(), Optional.empty(), Optional.empty()); + } + /** + * Get a list of organization invitations + * This request returns the list of organization invitations. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * You can filter them by providing the 'status' query parameter, that accepts multiple values. + * The organization invitations are ordered by descending creation date. + * Most recent invitations will be returned first. + * Any invitations created as a result of an Organization Domain are not included in the results. + * @param organizationId The organization ID. + * @param limit Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + * @param offset Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + * @param status Filter organization invitations based on their status + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListOrganizationInvitationsResponse list( + String organizationId, + Optional limit, + Optional offset, + Optional status) throws Exception { + com.clerk.backend_api.models.operations.ListOrganizationInvitationsRequest request = + com.clerk.backend_api.models.operations.ListOrganizationInvitationsRequest + .builder() + .organizationId(organizationId) + .limit(limit) + .offset(offset) + .status(status) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.ListOrganizationInvitationsRequest.class, + _baseUrl, + "/organizations/{organization_id}/invitations", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.ListOrganizationInvitationsRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListOrganizationInvitations", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListOrganizationInvitations", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListOrganizationInvitations", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListOrganizationInvitations", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.ListOrganizationInvitationsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListOrganizationInvitationsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.ListOrganizationInvitationsRequestBuilder _ret = list(); + _ret.organizationId(organizationId); + _ret.limit(_resolvedLimit); + _ret.offset(_newOffset); + _ret.status(status); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.ListOrganizationInvitationsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationInvitations _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + _res.withOrganizationInvitations(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Bulk create and send organization invitations + * Creates new organization invitations in bulk and sends out emails to the provided email addresses with a link to accept the invitation and join the organization. + * You can specify a different `role` for each invited organization member. + * New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. + * The request body supports passing an optional `redirect_url` parameter for each invitation. + * When the invited user clicks the link to accept the invitation, they will be redirected to the provided URL. + * Use this parameter to implement a custom invitation acceptance flow. + * You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation + * can have a different inviter user. + * Inviter users must be members with administrator privileges in the organization. + * Only "admin" members can create organization invitations. + * You can optionally provide public and private metadata for each organization invitation. The public metadata are visible + * by both the Frontend and the Backend, whereas the private metadata are only visible by the Backend. + * When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkRequestBuilder createBulk() { + return new com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkRequestBuilder(this); + } + + /** + * Bulk create and send organization invitations + * Creates new organization invitations in bulk and sends out emails to the provided email addresses with a link to accept the invitation and join the organization. + * You can specify a different `role` for each invited organization member. + * New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. + * The request body supports passing an optional `redirect_url` parameter for each invitation. + * When the invited user clicks the link to accept the invitation, they will be redirected to the provided URL. + * Use this parameter to implement a custom invitation acceptance flow. + * You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation + * can have a different inviter user. + * Inviter users must be members with administrator privileges in the organization. + * Only "admin" members can create organization invitations. + * You can optionally provide public and private metadata for each organization invitation. The public metadata are visible + * by both the Frontend and the Backend, whereas the private metadata are only visible by the Backend. + * When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + * @param organizationId The organization ID. + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkResponse createBulk( + String organizationId, + java.util.List requestBody) throws Exception { + com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkRequest request = + com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkRequest + .builder() + .organizationId(organizationId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkRequest.class, + _baseUrl, + "/organizations/{organization_id}/invitations/bulk", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateOrganizationInvitationBulk", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateOrganizationInvitationBulk", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateOrganizationInvitationBulk", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateOrganizationInvitationBulk", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationInvitations _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationInvitations(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Get a list of pending organization invitations + * This request returns the list of organization invitations with "pending" status. + * These are the organization invitations that can still be used to join the organization, but have not been accepted by the invited user yet. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The organization invitations are ordered by descending creation date. + * Most recent invitations will be returned first. + * Any invitations created as a result of an Organization Domain are not included in the results. + * @return The call builder + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsRequestBuilder listPending() { + return new com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsRequestBuilder(this); + } + + /** + * Get a list of pending organization invitations + * This request returns the list of organization invitations with "pending" status. + * These are the organization invitations that can still be used to join the organization, but have not been accepted by the invited user yet. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The organization invitations are ordered by descending creation date. + * Most recent invitations will be returned first. + * Any invitations created as a result of an Organization Domain are not included in the results. + * @param organizationId The organization ID. + * @return The response from the API call + * @throws Exception if the API call fails + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsResponse listPending( + String organizationId) throws Exception { + return listPending(organizationId, Optional.empty(), Optional.empty()); + } + /** + * Get a list of pending organization invitations + * This request returns the list of organization invitations with "pending" status. + * These are the organization invitations that can still be used to join the organization, but have not been accepted by the invited user yet. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The organization invitations are ordered by descending creation date. + * Most recent invitations will be returned first. + * Any invitations created as a result of an Organization Domain are not included in the results. + * @param organizationId The organization ID. + * @param limit Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + * @param offset Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + * @return The response from the API call + * @throws Exception if the API call fails + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsResponse listPending( + String organizationId, + Optional limit, + Optional offset) throws Exception { + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsRequest request = + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsRequest + .builder() + .organizationId(organizationId) + .limit(limit) + .offset(offset) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsRequest.class, + _baseUrl, + "/organizations/{organization_id}/invitations/pending", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListPendingOrganizationInvitations", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListPendingOrganizationInvitations", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListPendingOrganizationInvitations", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListPendingOrganizationInvitations", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsRequestBuilder _ret = listPending(); + _ret.organizationId(organizationId); + _ret.limit(_resolvedLimit); + _ret.offset(_newOffset); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationInvitations _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + _res.withOrganizationInvitations(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Retrieve an organization invitation by ID + * Use this request to get an existing organization invitation by ID. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetOrganizationInvitationRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetOrganizationInvitationRequestBuilder(this); + } + + /** + * Retrieve an organization invitation by ID + * Use this request to get an existing organization invitation by ID. + * @param organizationId The organization ID. + * @param invitationId The organization invitation ID. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetOrganizationInvitationResponse get( + String organizationId, + String invitationId) throws Exception { + com.clerk.backend_api.models.operations.GetOrganizationInvitationRequest request = + com.clerk.backend_api.models.operations.GetOrganizationInvitationRequest + .builder() + .organizationId(organizationId) + .invitationId(invitationId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetOrganizationInvitationRequest.class, + _baseUrl, + "/organizations/{organization_id}/invitations/{invitation_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetOrganizationInvitationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetOrganizationInvitationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetOrganizationInvitationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationInvitation _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationInvitation(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Revoke a pending organization invitation + * Use this request to revoke a previously issued organization invitation. + * Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. + * Only organization invitations with "pending" status can be revoked. + * The request needs the `requesting_user_id` parameter to specify the user which revokes the invitation. + * Only users with "admin" role can revoke invitations. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequestBuilder revoke() { + return new com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequestBuilder(this); + } + + /** + * Revoke a pending organization invitation + * Use this request to revoke a previously issued organization invitation. + * Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. + * Only organization invitations with "pending" status can be revoked. + * The request needs the `requesting_user_id` parameter to specify the user which revokes the invitation. + * Only users with "admin" role can revoke invitations. + * @param organizationId The organization ID. + * @param invitationId The organization invitation ID. + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.RevokeOrganizationInvitationResponse revoke( + String organizationId, + String invitationId, + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequest request = + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequest + .builder() + .organizationId(organizationId) + .invitationId(invitationId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequest.class, + _baseUrl, + "/organizations/{organization_id}/invitations/{invitation_id}/revoke", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("RevokeOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("RevokeOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("RevokeOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("RevokeOrganizationInvitation", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationInvitation _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationInvitation(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/OrganizationMemberships.java b/src/main/java/com/clerk/backend_api/OrganizationMemberships.java new file mode 100644 index 0000000..5d61192 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/OrganizationMemberships.java @@ -0,0 +1,778 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class OrganizationMemberships implements + MethodCallCreateOrganizationMembership, + MethodCallListOrganizationMemberships, + MethodCallUpdateOrganizationMembership, + MethodCallDeleteOrganizationMembership, + MethodCallUpdateOrganizationMembershipMetadata { + + private final SDKConfiguration sdkConfiguration; + + OrganizationMemberships(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Create a new organization membership + * Adds a user as a member to the given organization. + * Only users in the same instance as the organization can be added as members. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequestBuilder(this); + } + + /** + * Create a new organization membership + * Adds a user as a member to the given organization. + * Only users in the same instance as the organization can be added as members. + * @param organizationId The ID of the organization where the new membership will be created + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateOrganizationMembershipResponse create( + String organizationId, + com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequest request = + com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequest + .builder() + .organizationId(organizationId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequest.class, + _baseUrl, + "/organizations/{organization_id}/memberships", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateOrganizationMembershipResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateOrganizationMembershipResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateOrganizationMembershipResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationMembership _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationMembership(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Get a list of all members of an organization + * Retrieves all user memberships for the given organization + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListOrganizationMembershipsRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListOrganizationMembershipsRequestBuilder(this); + } + + /** + * Get a list of all members of an organization + * Retrieves all user memberships for the given organization + * @param organizationId The organization ID. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListOrganizationMembershipsResponse list( + String organizationId) throws Exception { + return list(organizationId, Optional.empty(), Optional.empty(), Optional.empty()); + } + /** + * Get a list of all members of an organization + * Retrieves all user memberships for the given organization + * @param organizationId The organization ID. + * @param limit Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + * @param offset Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + * @param orderBy Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + By prepending one of those values with + or -, + we can choose to sort in ascending (ASC) or descending (DESC) order." + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListOrganizationMembershipsResponse list( + String organizationId, + Optional limit, + Optional offset, + Optional orderBy) throws Exception { + com.clerk.backend_api.models.operations.ListOrganizationMembershipsRequest request = + com.clerk.backend_api.models.operations.ListOrganizationMembershipsRequest + .builder() + .organizationId(organizationId) + .limit(limit) + .offset(offset) + .orderBy(orderBy) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.ListOrganizationMembershipsRequest.class, + _baseUrl, + "/organizations/{organization_id}/memberships", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.ListOrganizationMembershipsRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListOrganizationMemberships", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListOrganizationMemberships", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListOrganizationMemberships", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListOrganizationMemberships", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.ListOrganizationMembershipsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListOrganizationMembershipsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.ListOrganizationMembershipsRequestBuilder _ret = list(); + _ret.organizationId(organizationId); + _ret.limit(_resolvedLimit); + _ret.offset(_newOffset); + _ret.orderBy(orderBy); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.ListOrganizationMembershipsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationMemberships _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + _res.withOrganizationMemberships(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Update an organization membership + * Updates the properties of an existing organization membership + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequestBuilder(this); + } + + /** + * Update an organization membership + * Updates the properties of an existing organization membership + * @param organizationId The ID of the organization the membership belongs to + * @param userId The ID of the user that this membership belongs to + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateOrganizationMembershipResponse update( + String organizationId, + String userId, + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequest request = + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequest + .builder() + .organizationId(organizationId) + .userId(userId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequest.class, + _baseUrl, + "/organizations/{organization_id}/memberships/{user_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationMembership _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationMembership(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Remove a member from an organization + * Removes the given membership from the organization + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteOrganizationMembershipRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteOrganizationMembershipRequestBuilder(this); + } + + /** + * Remove a member from an organization + * Removes the given membership from the organization + * @param organizationId The ID of the organization the membership belongs to + * @param userId The ID of the user that this membership belongs to + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteOrganizationMembershipResponse delete( + String organizationId, + String userId) throws Exception { + com.clerk.backend_api.models.operations.DeleteOrganizationMembershipRequest request = + com.clerk.backend_api.models.operations.DeleteOrganizationMembershipRequest + .builder() + .organizationId(organizationId) + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteOrganizationMembershipRequest.class, + _baseUrl, + "/organizations/{organization_id}/memberships/{user_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteOrganizationMembership", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteOrganizationMembershipResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteOrganizationMembershipResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteOrganizationMembershipResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationMembership _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationMembership(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Merge and update organization membership metadata + * Update an organization membership's metadata attributes by merging existing values with the provided parameters. + * Metadata values will be updated via a deep merge. Deep means that any nested JSON objects will be merged as well. + * You can remove metadata keys at any level by setting their value to `null`. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequestBuilder updateMetadata() { + return new com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequestBuilder(this); + } + + /** + * Merge and update organization membership metadata + * Update an organization membership's metadata attributes by merging existing values with the provided parameters. + * Metadata values will be updated via a deep merge. Deep means that any nested JSON objects will be merged as well. + * You can remove metadata keys at any level by setting their value to `null`. + * @param organizationId The ID of the organization the membership belongs to + * @param userId The ID of the user that this membership belongs to + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataResponse updateMetadata( + String organizationId, + String userId, + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequest request = + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequest + .builder() + .organizationId(organizationId) + .userId(userId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequest.class, + _baseUrl, + "/organizations/{organization_id}/memberships/{user_id}/metadata", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateOrganizationMembershipMetadata", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateOrganizationMembershipMetadata", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateOrganizationMembershipMetadata", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateOrganizationMembershipMetadata", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationMembership _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationMembership(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Organizations.java b/src/main/java/com/clerk/backend_api/Organizations.java new file mode 100644 index 0000000..0c39e33 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Organizations.java @@ -0,0 +1,1172 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Organizations implements + MethodCallListOrganizations, + MethodCallCreateOrganization, + MethodCallGetOrganization, + MethodCallUpdateOrganization, + MethodCallDeleteOrganization, + MethodCallMergeOrganizationMetadata, + MethodCallUploadOrganizationLogo, + MethodCallDeleteOrganizationLogo { + + private final SDKConfiguration sdkConfiguration; + + Organizations(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Get a list of organizations for an instance + * This request returns the list of organizations for an instance. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The organizations are ordered by descending creation date. + * Most recent organizations will be returned first. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListOrganizationsRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListOrganizationsRequestBuilder(this); + } + + /** + * Get a list of organizations for an instance + * This request returns the list of organizations for an instance. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The organizations are ordered by descending creation date. + * Most recent organizations will be returned first. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListOrganizationsResponse list( + com.clerk.backend_api.models.operations.ListOrganizationsRequest request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/organizations"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.ListOrganizationsRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListOrganizations", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListOrganizations", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListOrganizations", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListOrganizations", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.ListOrganizationsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListOrganizationsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.ListOrganizationsRequestBuilder _ret = list(); + _ret.request(new com.clerk.backend_api.models.operations.ListOrganizationsRequest( + request.limit(), + request.offset(), + request.includeMembersCount(), + request.query(), + request.orderBy() + )); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.ListOrganizationsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Organizations _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + _res.withOrganizations(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Create an organization + * Creates a new organization with the given name for an instance. + * In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator. + * You can specify an optional slug for the new organization. + * If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash "-". + * Organization slugs must be unique for the instance. + * You can provide additional metadata for the organization and set any custom attribute you want. + * Organizations support private and public metadata. + * Private metadata can only be accessed from the Backend API. + * Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateOrganizationRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateOrganizationRequestBuilder(this); + } + + /** + * Create an organization + * Creates a new organization with the given name for an instance. + * In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator. + * You can specify an optional slug for the new organization. + * If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash "-". + * Organization slugs must be unique for the instance. + * You can provide additional metadata for the organization and set any custom attribute you want. + * Organizations support private and public metadata. + * Private metadata can only be accessed from the Backend API. + * Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateOrganizationResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create an organization + * Creates a new organization with the given name for an instance. + * In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator. + * You can specify an optional slug for the new organization. + * If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash "-". + * Organization slugs must be unique for the instance. + * You can provide additional metadata for the organization and set any custom attribute you want. + * Organizations support private and public metadata. + * Private metadata can only be accessed from the Backend API. + * Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateOrganizationResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/organizations"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateOrganization", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateOrganization", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateOrganization", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateOrganization", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateOrganizationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateOrganizationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateOrganizationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Organization _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganization(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve an organization by ID or slug + * Fetches the organization whose ID or slug matches the provided `id_or_slug` URL query parameter. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetOrganizationRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetOrganizationRequestBuilder(this); + } + + /** + * Retrieve an organization by ID or slug + * Fetches the organization whose ID or slug matches the provided `id_or_slug` URL query parameter. + * @param organizationId The ID or slug of the organization + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetOrganizationResponse get( + String organizationId) throws Exception { + com.clerk.backend_api.models.operations.GetOrganizationRequest request = + com.clerk.backend_api.models.operations.GetOrganizationRequest + .builder() + .organizationId(organizationId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetOrganizationRequest.class, + _baseUrl, + "/organizations/{organization_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetOrganization", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetOrganization", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetOrganization", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetOrganization", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetOrganizationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetOrganizationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetOrganizationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Organization _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganization(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update an organization + * Updates an existing organization + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateOrganizationRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateOrganizationRequestBuilder(this); + } + + /** + * Update an organization + * Updates an existing organization + * @param organizationId The ID of the organization to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateOrganizationResponse update( + String organizationId, + com.clerk.backend_api.models.operations.UpdateOrganizationRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateOrganizationRequest request = + com.clerk.backend_api.models.operations.UpdateOrganizationRequest + .builder() + .organizationId(organizationId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateOrganizationRequest.class, + _baseUrl, + "/organizations/{organization_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateOrganization", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateOrganization", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateOrganization", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateOrganization", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateOrganizationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateOrganizationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateOrganizationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Organization _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganization(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete an organization + * Deletes the given organization. + * Please note that deleting an organization will also delete all memberships and invitations. + * This is not reversible. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteOrganizationRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteOrganizationRequestBuilder(this); + } + + /** + * Delete an organization + * Deletes the given organization. + * Please note that deleting an organization will also delete all memberships and invitations. + * This is not reversible. + * @param organizationId The ID of the organization to delete + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteOrganizationResponse delete( + String organizationId) throws Exception { + com.clerk.backend_api.models.operations.DeleteOrganizationRequest request = + com.clerk.backend_api.models.operations.DeleteOrganizationRequest + .builder() + .organizationId(organizationId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteOrganizationRequest.class, + _baseUrl, + "/organizations/{organization_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteOrganization", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteOrganization", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteOrganization", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteOrganization", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteOrganizationResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteOrganizationResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteOrganizationResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Merge and update metadata for an organization + * Update organization metadata attributes by merging existing values with the provided parameters. + * Metadata values will be updated via a deep merge. + * Deep meaning that any nested JSON objects will be merged as well. + * You can remove metadata keys at any level by setting their value to `null`. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequestBuilder mergeMetadata() { + return new com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequestBuilder(this); + } + + /** + * Merge and update metadata for an organization + * Update organization metadata attributes by merging existing values with the provided parameters. + * Metadata values will be updated via a deep merge. + * Deep meaning that any nested JSON objects will be merged as well. + * You can remove metadata keys at any level by setting their value to `null`. + * @param organizationId The ID of the organization for which metadata will be merged or updated + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.MergeOrganizationMetadataResponse mergeMetadata( + String organizationId, + com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequest request = + com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequest + .builder() + .organizationId(organizationId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequest.class, + _baseUrl, + "/organizations/{organization_id}/metadata", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("MergeOrganizationMetadata", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("MergeOrganizationMetadata", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("MergeOrganizationMetadata", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("MergeOrganizationMetadata", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.MergeOrganizationMetadataResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.MergeOrganizationMetadataResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.MergeOrganizationMetadataResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Organization _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganization(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Upload a logo for the organization + * Set or replace an organization's logo, by uploading an image file. + * This endpoint uses the `multipart/form-data` request content type and accepts a file of image type. + * The file size cannot exceed 10MB. + * Only the following file content types are supported: `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `image/x-icon`, `image/vnd.microsoft.icon`. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UploadOrganizationLogoRequestBuilder uploadLogo() { + return new com.clerk.backend_api.models.operations.UploadOrganizationLogoRequestBuilder(this); + } + + /** + * Upload a logo for the organization + * Set or replace an organization's logo, by uploading an image file. + * This endpoint uses the `multipart/form-data` request content type and accepts a file of image type. + * The file size cannot exceed 10MB. + * Only the following file content types are supported: `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `image/x-icon`, `image/vnd.microsoft.icon`. + * @param organizationId The ID of the organization for which to upload a logo + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UploadOrganizationLogoResponse uploadLogo( + String organizationId) throws Exception { + return uploadLogo(organizationId, Optional.empty()); + } + /** + * Upload a logo for the organization + * Set or replace an organization's logo, by uploading an image file. + * This endpoint uses the `multipart/form-data` request content type and accepts a file of image type. + * The file size cannot exceed 10MB. + * Only the following file content types are supported: `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `image/x-icon`, `image/vnd.microsoft.icon`. + * @param organizationId The ID of the organization for which to upload a logo + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UploadOrganizationLogoResponse uploadLogo( + String organizationId, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.UploadOrganizationLogoRequest request = + com.clerk.backend_api.models.operations.UploadOrganizationLogoRequest + .builder() + .organizationId(organizationId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UploadOrganizationLogoRequest.class, + _baseUrl, + "/organizations/{organization_id}/logo", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PUT"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "multipart", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UploadOrganizationLogo", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "413", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UploadOrganizationLogo", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UploadOrganizationLogo", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UploadOrganizationLogo", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UploadOrganizationLogoResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UploadOrganizationLogoResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UploadOrganizationLogoResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationWithLogo _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganizationWithLogo(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "413")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete the organization's logo. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteOrganizationLogoRequestBuilder deleteLogo() { + return new com.clerk.backend_api.models.operations.DeleteOrganizationLogoRequestBuilder(this); + } + + /** + * Delete the organization's logo. + * @param organizationId The ID of the organization for which the logo will be deleted. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteOrganizationLogoResponse deleteLogo( + String organizationId) throws Exception { + com.clerk.backend_api.models.operations.DeleteOrganizationLogoRequest request = + com.clerk.backend_api.models.operations.DeleteOrganizationLogoRequest + .builder() + .organizationId(organizationId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteOrganizationLogoRequest.class, + _baseUrl, + "/organizations/{organization_id}/logo", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteOrganizationLogo", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteOrganizationLogo", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteOrganizationLogo", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteOrganizationLogo", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteOrganizationLogoResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteOrganizationLogoResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteOrganizationLogoResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Organization _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withOrganization(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/PhoneNumbers.java b/src/main/java/com/clerk/backend_api/PhoneNumbers.java new file mode 100644 index 0000000..b1cf9fd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/PhoneNumbers.java @@ -0,0 +1,565 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class PhoneNumbers implements + MethodCallCreatePhoneNumber, + MethodCallGetPhoneNumber, + MethodCallDeletePhoneNumber, + MethodCallUpdatePhoneNumber { + + private final SDKConfiguration sdkConfiguration; + + PhoneNumbers(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Create a phone number + * Create a new phone number + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreatePhoneNumberRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreatePhoneNumberRequestBuilder(this); + } + + /** + * Create a phone number + * Create a new phone number + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreatePhoneNumberResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create a phone number + * Create a new phone number + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreatePhoneNumberResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/phone_numbers"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreatePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreatePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreatePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreatePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreatePhoneNumberResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreatePhoneNumberResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreatePhoneNumberResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.PhoneNumber _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withPhoneNumber(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve a phone number + * Returns the details of a phone number + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetPhoneNumberRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetPhoneNumberRequestBuilder(this); + } + + /** + * Retrieve a phone number + * Returns the details of a phone number + * @param phoneNumberId The ID of the phone number to retrieve + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetPhoneNumberResponse get( + String phoneNumberId) throws Exception { + com.clerk.backend_api.models.operations.GetPhoneNumberRequest request = + com.clerk.backend_api.models.operations.GetPhoneNumberRequest + .builder() + .phoneNumberId(phoneNumberId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetPhoneNumberRequest.class, + _baseUrl, + "/phone_numbers/{phone_number_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetPhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetPhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetPhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetPhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetPhoneNumberResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetPhoneNumberResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetPhoneNumberResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.PhoneNumber _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withPhoneNumber(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete a phone number + * Delete the phone number with the given ID + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeletePhoneNumberRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeletePhoneNumberRequestBuilder(this); + } + + /** + * Delete a phone number + * Delete the phone number with the given ID + * @param phoneNumberId The ID of the phone number to delete + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeletePhoneNumberResponse delete( + String phoneNumberId) throws Exception { + com.clerk.backend_api.models.operations.DeletePhoneNumberRequest request = + com.clerk.backend_api.models.operations.DeletePhoneNumberRequest + .builder() + .phoneNumberId(phoneNumberId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeletePhoneNumberRequest.class, + _baseUrl, + "/phone_numbers/{phone_number_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeletePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeletePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeletePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeletePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeletePhoneNumberResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeletePhoneNumberResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeletePhoneNumberResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update a phone number + * Updates a phone number + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdatePhoneNumberRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdatePhoneNumberRequestBuilder(this); + } + + /** + * Update a phone number + * Updates a phone number + * @param phoneNumberId The ID of the phone number to update + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdatePhoneNumberResponse update( + String phoneNumberId) throws Exception { + return update(phoneNumberId, Optional.empty()); + } + /** + * Update a phone number + * Updates a phone number + * @param phoneNumberId The ID of the phone number to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdatePhoneNumberResponse update( + String phoneNumberId, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdatePhoneNumberRequest request = + com.clerk.backend_api.models.operations.UpdatePhoneNumberRequest + .builder() + .phoneNumberId(phoneNumberId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdatePhoneNumberRequest.class, + _baseUrl, + "/phone_numbers/{phone_number_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdatePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdatePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdatePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdatePhoneNumber", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdatePhoneNumberResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdatePhoneNumberResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdatePhoneNumberResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.PhoneNumber _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withPhoneNumber(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Proxy.java b/src/main/java/com/clerk/backend_api/Proxy.java new file mode 100644 index 0000000..e3aecaf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Proxy.java @@ -0,0 +1,189 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Proxy implements + MethodCallVerifyDomainProxy { + + private final SDKConfiguration sdkConfiguration; + + Proxy(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Verify the proxy configuration for your domain + * This endpoint can be used to validate that a proxy-enabled domain is operational. + * It tries to verify that the proxy URL provided in the parameters maps to a functional proxy that can reach the Clerk Frontend API. + * + * You can use this endpoint before you set a proxy URL for a domain. This way you can ensure that switching to proxy-based + * configuration will not lead to downtime for your instance. + * + * The `proxy_url` parameter allows for testing proxy configurations for domains that don't have a proxy URL yet, or operate on + * a different proxy URL than the one provided. It can also be used to re-validate a domain that is already configured to work with a proxy. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.VerifyDomainProxyRequestBuilder verifyDomain() { + return new com.clerk.backend_api.models.operations.VerifyDomainProxyRequestBuilder(this); + } + + /** + * Verify the proxy configuration for your domain + * This endpoint can be used to validate that a proxy-enabled domain is operational. + * It tries to verify that the proxy URL provided in the parameters maps to a functional proxy that can reach the Clerk Frontend API. + * + * You can use this endpoint before you set a proxy URL for a domain. This way you can ensure that switching to proxy-based + * configuration will not lead to downtime for your instance. + * + * The `proxy_url` parameter allows for testing proxy configurations for domains that don't have a proxy URL yet, or operate on + * a different proxy URL than the one provided. It can also be used to re-validate a domain that is already configured to work with a proxy. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.VerifyDomainProxyResponse verifyDomainDirect() throws Exception { + return verifyDomain(Optional.empty()); + } + /** + * Verify the proxy configuration for your domain + * This endpoint can be used to validate that a proxy-enabled domain is operational. + * It tries to verify that the proxy URL provided in the parameters maps to a functional proxy that can reach the Clerk Frontend API. + * + * You can use this endpoint before you set a proxy URL for a domain. This way you can ensure that switching to proxy-based + * configuration will not lead to downtime for your instance. + * + * The `proxy_url` parameter allows for testing proxy configurations for domains that don't have a proxy URL yet, or operate on + * a different proxy URL than the one provided. It can also be used to re-validate a domain that is already configured to work with a proxy. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.VerifyDomainProxyResponse verifyDomain( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/proxy_checks"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("VerifyDomainProxy", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("VerifyDomainProxy", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("VerifyDomainProxy", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("VerifyDomainProxy", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.VerifyDomainProxyResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.VerifyDomainProxyResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.VerifyDomainProxyResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.ProxyCheck _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withProxyCheck(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/RedirectURLs.java b/src/main/java/com/clerk/backend_api/RedirectURLs.java new file mode 100644 index 0000000..2b83c3d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/RedirectURLs.java @@ -0,0 +1,522 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class RedirectURLs implements + MethodCallListRedirectURLs, + MethodCallCreateRedirectURL, + MethodCallGetRedirectURL, + MethodCallDeleteRedirectURL { + + private final SDKConfiguration sdkConfiguration; + + RedirectURLs(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all redirect URLs + * Lists all whitelisted redirect_urls for the instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListRedirectURLsRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListRedirectURLsRequestBuilder(this); + } + + /** + * List all redirect URLs + * Lists all whitelisted redirect_urls for the instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListRedirectURLsResponse listDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/redirect_urls"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListRedirectURLs", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListRedirectURLs", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListRedirectURLs", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListRedirectURLs", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.ListRedirectURLsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListRedirectURLsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.ListRedirectURLsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference>() {}); + _res.withRedirectURLList(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Create a redirect URL + * Create a redirect URL + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateRedirectURLRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateRedirectURLRequestBuilder(this); + } + + /** + * Create a redirect URL + * Create a redirect URL + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateRedirectURLResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create a redirect URL + * Create a redirect URL + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateRedirectURLResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/redirect_urls"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateRedirectURLResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateRedirectURLResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateRedirectURLResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.RedirectURL _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withRedirectURL(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve a redirect URL + * Retrieve the details of the redirect URL with the given ID + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetRedirectURLRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetRedirectURLRequestBuilder(this); + } + + /** + * Retrieve a redirect URL + * Retrieve the details of the redirect URL with the given ID + * @param id The ID of the redirect URL + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetRedirectURLResponse get( + String id) throws Exception { + com.clerk.backend_api.models.operations.GetRedirectURLRequest request = + com.clerk.backend_api.models.operations.GetRedirectURLRequest + .builder() + .id(id) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetRedirectURLRequest.class, + _baseUrl, + "/redirect_urls/{id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetRedirectURLResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetRedirectURLResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetRedirectURLResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.RedirectURL _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withRedirectURL(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete a redirect URL + * Remove the selected redirect URL from the whitelist of the instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteRedirectURLRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteRedirectURLRequestBuilder(this); + } + + /** + * Delete a redirect URL + * Remove the selected redirect URL from the whitelist of the instance + * @param id The ID of the redirect URL + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteRedirectURLResponse delete( + String id) throws Exception { + com.clerk.backend_api.models.operations.DeleteRedirectURLRequest request = + com.clerk.backend_api.models.operations.DeleteRedirectURLRequest + .builder() + .id(id) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteRedirectURLRequest.class, + _baseUrl, + "/redirect_urls/{id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteRedirectURL", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteRedirectURLResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteRedirectURLResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteRedirectURLResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/SDKConfiguration.java b/src/main/java/com/clerk/backend_api/SDKConfiguration.java new file mode 100644 index 0000000..b612fbe --- /dev/null +++ b/src/main/java/com/clerk/backend_api/SDKConfiguration.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.utils.Hook.SdkInitData; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.RetryConfig; +import com.clerk.backend_api.models.components.Security; +import java.util.Optional; + +class SDKConfiguration { + public SecuritySource securitySource; + + public Optional securitySource() { + return Optional.ofNullable(securitySource); + } + public HTTPClient defaultClient; + public String serverUrl; + public int serverIdx = 0; + public String language = "java"; + public String openapiDocVersion = "v1"; + public String sdkVersion = "0.0.1"; + public String genVersion = "2.342.2"; + public String userAgent = "speakeasy-sdk/java 0.0.1 2.342.2 v1 com.clerk.backend_api"; + + private com.clerk.backend_api.utils.Hooks _hooks = createHooks(); + + private static com.clerk.backend_api.utils.Hooks createHooks() { + com.clerk.backend_api.utils.Hooks hooks = new com.clerk.backend_api.utils.Hooks(); + return hooks; + } + + public com.clerk.backend_api.utils.Hooks hooks() { + return _hooks; + } + + public void setHooks(com.clerk.backend_api.utils.Hooks hooks) { + this._hooks = hooks; + } + + /** + * Initializes state (for example hooks). + **/ + public void initialize() { + com.clerk.backend_api.hooks.SDKHooks.initialize(_hooks); + // apply the sdk init hook immediately + SdkInitData data = _hooks.sdkInit(new SdkInitData(serverUrl, defaultClient)); + this.serverUrl = data.baseUrl(); + this.defaultClient = data.client(); + } + + + + public Optional retryConfig = Optional.empty(); +} diff --git a/src/main/java/com/clerk/backend_api/SamlConnections.java b/src/main/java/com/clerk/backend_api/SamlConnections.java new file mode 100644 index 0000000..9a7becf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/SamlConnections.java @@ -0,0 +1,739 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class SamlConnections implements + MethodCallListSAMLConnections, + MethodCallCreateSAMLConnection, + MethodCallGetSAMLConnection, + MethodCallUpdateSAMLConnection, + MethodCallDeleteSAMLConnection { + + private final SDKConfiguration sdkConfiguration; + + SamlConnections(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Get a list of SAML Connections for an instance + * Returns the list of SAML Connections for an instance. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The SAML Connections are ordered by descending creation date and the most recent will be returned first. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ListSAMLConnectionsRequestBuilder list() { + return new com.clerk.backend_api.models.operations.ListSAMLConnectionsRequestBuilder(this); + } + + /** + * Get a list of SAML Connections for an instance + * Returns the list of SAML Connections for an instance. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The SAML Connections are ordered by descending creation date and the most recent will be returned first. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse listDirect() throws Exception { + return list(Optional.empty(), Optional.empty()); + } + /** + * Get a list of SAML Connections for an instance + * Returns the list of SAML Connections for an instance. + * Results can be paginated using the optional `limit` and `offset` query parameters. + * The SAML Connections are ordered by descending creation date and the most recent will be returned first. + * @param limit Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + * @param offset Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse list( + Optional limit, + Optional offset) throws Exception { + com.clerk.backend_api.models.operations.ListSAMLConnectionsRequest request = + com.clerk.backend_api.models.operations.ListSAMLConnectionsRequest + .builder() + .limit(limit) + .offset(offset) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/saml_connections"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.ListSAMLConnectionsRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ListSAMLConnections", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ListSAMLConnections", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ListSAMLConnections", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ListSAMLConnections", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.ListSAMLConnectionsRequestBuilder _ret = list(); + _ret.limit(_resolvedLimit); + _ret.offset(_newOffset); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SAMLConnections _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + _res.withSAMLConnections(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Create a SAML Connection + * Create a new SAML Connection. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateSAMLConnectionRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateSAMLConnectionRequestBuilder(this); + } + + /** + * Create a SAML Connection + * Create a new SAML Connection. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create a SAML Connection + * Create a new SAML Connection. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/saml_connections"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SAMLConnection _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSAMLConnection(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve a SAML Connection by ID + * Fetches the SAML Connection whose ID matches the provided `saml_connection_id` in the path. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetSAMLConnectionRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetSAMLConnectionRequestBuilder(this); + } + + /** + * Retrieve a SAML Connection by ID + * Fetches the SAML Connection whose ID matches the provided `saml_connection_id` in the path. + * @param samlConnectionId The ID of the SAML Connection + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetSAMLConnectionResponse get( + String samlConnectionId) throws Exception { + com.clerk.backend_api.models.operations.GetSAMLConnectionRequest request = + com.clerk.backend_api.models.operations.GetSAMLConnectionRequest + .builder() + .samlConnectionId(samlConnectionId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetSAMLConnectionRequest.class, + _baseUrl, + "/saml_connections/{saml_connection_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetSAMLConnectionResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetSAMLConnectionResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetSAMLConnectionResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SAMLConnection _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSAMLConnection(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update a SAML Connection + * Updates the SAML Connection whose ID matches the provided `id` in the path. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBuilder(this); + } + + /** + * Update a SAML Connection + * Updates the SAML Connection whose ID matches the provided `id` in the path. + * @param samlConnectionId The ID of the SAML Connection to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateSAMLConnectionResponse update( + String samlConnectionId, + com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequest request = + com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequest + .builder() + .samlConnectionId(samlConnectionId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequest.class, + _baseUrl, + "/saml_connections/{saml_connection_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateSAMLConnectionResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateSAMLConnectionResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateSAMLConnectionResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SAMLConnection _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSAMLConnection(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete a SAML Connection + * Deletes the SAML Connection whose ID matches the provided `id` in the path. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteSAMLConnectionRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteSAMLConnectionRequestBuilder(this); + } + + /** + * Delete a SAML Connection + * Deletes the SAML Connection whose ID matches the provided `id` in the path. + * @param samlConnectionId The ID of the SAML Connection to delete + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteSAMLConnectionResponse delete( + String samlConnectionId) throws Exception { + com.clerk.backend_api.models.operations.DeleteSAMLConnectionRequest request = + com.clerk.backend_api.models.operations.DeleteSAMLConnectionRequest + .builder() + .samlConnectionId(samlConnectionId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteSAMLConnectionRequest.class, + _baseUrl, + "/saml_connections/{saml_connection_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteSAMLConnection", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteSAMLConnectionResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteSAMLConnectionResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteSAMLConnectionResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "403", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/SecuritySource.java b/src/main/java/com/clerk/backend_api/SecuritySource.java new file mode 100644 index 0000000..b04bec4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/SecuritySource.java @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.components.Security; + +public interface SecuritySource { + + Security getSecurity(); + + public static SecuritySource of(Security security) { + return new DefaultSecuritySource(security); + } + + public static class DefaultSecuritySource implements SecuritySource { + private Security security; + + public DefaultSecuritySource(Security security) { + this.security = security; + } + + public Security getSecurity() { + return security; + } + } +} diff --git a/src/main/java/com/clerk/backend_api/Sessions.java b/src/main/java/com/clerk/backend_api/Sessions.java new file mode 100644 index 0000000..0285be4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Sessions.java @@ -0,0 +1,745 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Sessions implements + MethodCallGetSessionList, + MethodCallGetSession, + MethodCallRevokeSession, + MethodCallVerifySession, + MethodCallCreateSessionTokenFromTemplate { + + private final SDKConfiguration sdkConfiguration; + + Sessions(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all sessions + * Returns a list of all sessions. + * The sessions are returned sorted by creation date, with the newest sessions appearing first. + * **Deprecation Notice (2024-01-01):** All parameters were initially considered optional, however + * moving forward at least one of `client_id` or `user_id` parameters should be provided. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetSessionListRequestBuilder list() { + return new com.clerk.backend_api.models.operations.GetSessionListRequestBuilder(this); + } + + /** + * List all sessions + * Returns a list of all sessions. + * The sessions are returned sorted by creation date, with the newest sessions appearing first. + * **Deprecation Notice (2024-01-01):** All parameters were initially considered optional, however + * moving forward at least one of `client_id` or `user_id` parameters should be provided. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetSessionListResponse list( + com.clerk.backend_api.models.operations.GetSessionListRequest request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/sessions"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.GetSessionListRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetSessionList", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetSessionList", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetSessionList", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetSessionList", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.GetSessionListResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetSessionListResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.GetSessionListRequestBuilder _ret = list(); + _ret.request(new com.clerk.backend_api.models.operations.GetSessionListRequest( + request.clientId(), + request.userId(), + request.status(), + request.limit(), + request.offset() + )); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.GetSessionListResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference>() {}); + _res.withSessionList(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Retrieve a session + * Retrieve the details of a session + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetSessionRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetSessionRequestBuilder(this); + } + + /** + * Retrieve a session + * Retrieve the details of a session + * @param sessionId The ID of the session + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetSessionResponse get( + String sessionId) throws Exception { + com.clerk.backend_api.models.operations.GetSessionRequest request = + com.clerk.backend_api.models.operations.GetSessionRequest + .builder() + .sessionId(sessionId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetSessionRequest.class, + _baseUrl, + "/sessions/{session_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetSession", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetSession", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetSession", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetSession", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetSessionResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetSessionResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetSessionResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Session _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSession(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Revoke a session + * Sets the status of a session as "revoked", which is an unauthenticated state. + * In multi-session mode, a revoked session will still be returned along with its client object, however the user will need to sign in again. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.RevokeSessionRequestBuilder revoke() { + return new com.clerk.backend_api.models.operations.RevokeSessionRequestBuilder(this); + } + + /** + * Revoke a session + * Sets the status of a session as "revoked", which is an unauthenticated state. + * In multi-session mode, a revoked session will still be returned along with its client object, however the user will need to sign in again. + * @param sessionId The ID of the session + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.RevokeSessionResponse revoke( + String sessionId) throws Exception { + com.clerk.backend_api.models.operations.RevokeSessionRequest request = + com.clerk.backend_api.models.operations.RevokeSessionRequest + .builder() + .sessionId(sessionId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.RevokeSessionRequest.class, + _baseUrl, + "/sessions/{session_id}/revoke", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("RevokeSession", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("RevokeSession", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("RevokeSession", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("RevokeSession", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.RevokeSessionResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.RevokeSessionResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.RevokeSessionResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Session _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSession(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Verify a session + * Returns the session if it is authenticated, otherwise returns an error. + * WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, + * which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#clerk-express-require-auth)). + * For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). + * @return The call builder + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.VerifySessionRequestBuilder verify() { + return new com.clerk.backend_api.models.operations.VerifySessionRequestBuilder(this); + } + + /** + * Verify a session + * Returns the session if it is authenticated, otherwise returns an error. + * WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, + * which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#clerk-express-require-auth)). + * For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). + * @param sessionId The ID of the session + * @return The response from the API call + * @throws Exception if the API call fails + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.VerifySessionResponse verify( + String sessionId) throws Exception { + return verify(sessionId, Optional.empty()); + } + /** + * Verify a session + * Returns the session if it is authenticated, otherwise returns an error. + * WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, + * which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#clerk-express-require-auth)). + * For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). + * @param sessionId The ID of the session + * @param requestBody Parameters. + * @return The response from the API call + * @throws Exception if the API call fails + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public com.clerk.backend_api.models.operations.VerifySessionResponse verify( + String sessionId, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.VerifySessionRequest request = + com.clerk.backend_api.models.operations.VerifySessionRequest + .builder() + .sessionId(sessionId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.VerifySessionRequest.class, + _baseUrl, + "/sessions/{session_id}/verify", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("VerifySession", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "410", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("VerifySession", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("VerifySession", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("VerifySession", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.VerifySessionResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.VerifySessionResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.VerifySessionResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Session _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSession(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "410")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Create a session token from a jwt template + * Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined for your instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateRequestBuilder createTokenFromTemplate() { + return new com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateRequestBuilder(this); + } + + /** + * Create a session token from a jwt template + * Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined for your instance + * @param sessionId The ID of the session + * @param templateName The name of the JWT Template defined in your instance (e.g. `custom_hasura`). + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateResponse createTokenFromTemplate( + String sessionId, + String templateName) throws Exception { + com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateRequest request = + com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateRequest + .builder() + .sessionId(sessionId) + .templateName(templateName) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateRequest.class, + _baseUrl, + "/sessions/{session_id}/tokens/{template_name}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateSessionTokenFromTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateSessionTokenFromTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateSessionTokenFromTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateSessionTokenFromTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/SignInTokens.java b/src/main/java/com/clerk/backend_api/SignInTokens.java new file mode 100644 index 0000000..df8ba5a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/SignInTokens.java @@ -0,0 +1,300 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class SignInTokens implements + MethodCallCreateSignInToken, + MethodCallRevokeSignInToken { + + private final SDKConfiguration sdkConfiguration; + + SignInTokens(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Create sign-in token + * Creates a new sign-in token and associates it with the given user. + * By default, sign-in tokens expire in 30 days. + * You can optionally supply a different duration in seconds using the `expires_in_seconds` property. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateSignInTokenRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateSignInTokenRequestBuilder(this); + } + + /** + * Create sign-in token + * Creates a new sign-in token and associates it with the given user. + * By default, sign-in tokens expire in 30 days. + * You can optionally supply a different duration in seconds using the `expires_in_seconds` property. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateSignInTokenResponse createDirect() throws Exception { + return create(Optional.empty()); + } + /** + * Create sign-in token + * Creates a new sign-in token and associates it with the given user. + * By default, sign-in tokens expire in 30 days. + * You can optionally supply a different duration in seconds using the `expires_in_seconds` property. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateSignInTokenResponse create( + Optional request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/sign_in_tokens"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateSignInToken", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateSignInToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateSignInToken", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateSignInToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateSignInTokenResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateSignInTokenResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateSignInTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SignInToken _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSignInToken(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Revoke the given sign-in token + * Revokes a pending sign-in token + * @return The call builder + */ + public com.clerk.backend_api.models.operations.RevokeSignInTokenRequestBuilder revoke() { + return new com.clerk.backend_api.models.operations.RevokeSignInTokenRequestBuilder(this); + } + + /** + * Revoke the given sign-in token + * Revokes a pending sign-in token + * @param signInTokenId The ID of the sign-in token to be revoked + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.RevokeSignInTokenResponse revoke( + String signInTokenId) throws Exception { + com.clerk.backend_api.models.operations.RevokeSignInTokenRequest request = + com.clerk.backend_api.models.operations.RevokeSignInTokenRequest + .builder() + .signInTokenId(signInTokenId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.RevokeSignInTokenRequest.class, + _baseUrl, + "/sign_in_tokens/{sign_in_token_id}/revoke", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("RevokeSignInToken", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("RevokeSignInToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("RevokeSignInToken", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("RevokeSignInToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.RevokeSignInTokenResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.RevokeSignInTokenResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.RevokeSignInTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SignInToken _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSignInToken(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/SignUps.java b/src/main/java/com/clerk/backend_api/SignUps.java new file mode 100644 index 0000000..120e8c3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/SignUps.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class SignUps implements + MethodCallUpdateSignUp { + + private final SDKConfiguration sdkConfiguration; + + SignUps(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Update a sign-up + * Update the sign-up with the given ID + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateSignUpRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateSignUpRequestBuilder(this); + } + + /** + * Update a sign-up + * Update the sign-up with the given ID + * @param id The ID of the sign-up to update + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateSignUpResponse update( + String id) throws Exception { + return update(id, Optional.empty()); + } + /** + * Update a sign-up + * Update the sign-up with the given ID + * @param id The ID of the sign-up to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateSignUpResponse update( + String id, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateSignUpRequest request = + com.clerk.backend_api.models.operations.UpdateSignUpRequest + .builder() + .id(id) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateSignUpRequest.class, + _baseUrl, + "/sign_ups/{id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateSignUp", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateSignUp", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateSignUp", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateSignUp", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateSignUpResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateSignUpResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateSignUpResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SignUp _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSignUp(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Templates.java b/src/main/java/com/clerk/backend_api/Templates.java new file mode 100644 index 0000000..ea4fc8c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Templates.java @@ -0,0 +1,878 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Templates implements + MethodCallGetTemplateList, + MethodCallGetTemplate, + MethodCallUpsertTemplate, + MethodCallRevertTemplate, + MethodCallPreviewTemplate, + MethodCallToggleTemplateDelivery { + + private final SDKConfiguration sdkConfiguration; + + Templates(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all templates + * Returns a list of all templates. + * The templates are returned sorted by position. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetTemplateListRequestBuilder list() { + return new com.clerk.backend_api.models.operations.GetTemplateListRequestBuilder(this); + } + + /** + * List all templates + * Returns a list of all templates. + * The templates are returned sorted by position. + * @param templateType The type of templates to list (email or SMS) + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetTemplateListResponse list( + com.clerk.backend_api.models.operations.TemplateType templateType) throws Exception { + com.clerk.backend_api.models.operations.GetTemplateListRequest request = + com.clerk.backend_api.models.operations.GetTemplateListRequest + .builder() + .templateType(templateType) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetTemplateListRequest.class, + _baseUrl, + "/templates/{template_type}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetTemplateList", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetTemplateList", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetTemplateList", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetTemplateList", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetTemplateListResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetTemplateListResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetTemplateListResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference>() {}); + _res.withTemplateList(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve a template + * Returns the details of a template + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetTemplateRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetTemplateRequestBuilder(this); + } + + /** + * Retrieve a template + * Returns the details of a template + * @param templateType The type of templates to retrieve (email or SMS) + * @param slug The slug (i.e. machine-friendly name) of the template to retrieve + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetTemplateResponse get( + com.clerk.backend_api.models.operations.PathParamTemplateType templateType, + String slug) throws Exception { + com.clerk.backend_api.models.operations.GetTemplateRequest request = + com.clerk.backend_api.models.operations.GetTemplateRequest + .builder() + .templateType(templateType) + .slug(slug) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetTemplateRequest.class, + _baseUrl, + "/templates/{template_type}/{slug}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Template _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withTemplate(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update a template for a given type and slug + * Updates the existing template of the given type and slug + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpsertTemplateRequestBuilder upsert() { + return new com.clerk.backend_api.models.operations.UpsertTemplateRequestBuilder(this); + } + + /** + * Update a template for a given type and slug + * Updates the existing template of the given type and slug + * @param templateType The type of template to update + * @param slug The slug of the template to update + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpsertTemplateResponse upsert( + com.clerk.backend_api.models.operations.UpsertTemplatePathParamTemplateType templateType, + String slug) throws Exception { + return upsert(templateType, slug, Optional.empty()); + } + /** + * Update a template for a given type and slug + * Updates the existing template of the given type and slug + * @param templateType The type of template to update + * @param slug The slug of the template to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpsertTemplateResponse upsert( + com.clerk.backend_api.models.operations.UpsertTemplatePathParamTemplateType templateType, + String slug, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpsertTemplateRequest request = + com.clerk.backend_api.models.operations.UpsertTemplateRequest + .builder() + .templateType(templateType) + .slug(slug) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpsertTemplateRequest.class, + _baseUrl, + "/templates/{template_type}/{slug}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PUT"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpsertTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "402", "403", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpsertTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpsertTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpsertTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpsertTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpsertTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpsertTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Template _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withTemplate(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "402", "403", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Revert a template + * Reverts an updated template to its default state + * @return The call builder + */ + public com.clerk.backend_api.models.operations.RevertTemplateRequestBuilder revert() { + return new com.clerk.backend_api.models.operations.RevertTemplateRequestBuilder(this); + } + + /** + * Revert a template + * Reverts an updated template to its default state + * @param templateType The type of template to revert + * @param slug The slug of the template to revert + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.RevertTemplateResponse revert( + com.clerk.backend_api.models.operations.RevertTemplatePathParamTemplateType templateType, + String slug) throws Exception { + com.clerk.backend_api.models.operations.RevertTemplateRequest request = + com.clerk.backend_api.models.operations.RevertTemplateRequest + .builder() + .templateType(templateType) + .slug(slug) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.RevertTemplateRequest.class, + _baseUrl, + "/templates/{template_type}/{slug}/revert", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("RevertTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "402", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("RevertTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("RevertTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("RevertTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.RevertTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.RevertTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.RevertTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Template _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withTemplate(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "402", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Preview changes to a template + * Returns a preview of a template for a given template_type, slug and body + * @return The call builder + */ + public com.clerk.backend_api.models.operations.PreviewTemplateRequestBuilder preview() { + return new com.clerk.backend_api.models.operations.PreviewTemplateRequestBuilder(this); + } + + /** + * Preview changes to a template + * Returns a preview of a template for a given template_type, slug and body + * @param templateType The type of template to preview + * @param slug The slug of the template to preview + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.PreviewTemplateResponse preview( + String templateType, + String slug) throws Exception { + return preview(templateType, slug, Optional.empty()); + } + /** + * Preview changes to a template + * Returns a preview of a template for a given template_type, slug and body + * @param templateType The type of template to preview + * @param slug The slug of the template to preview + * @param requestBody Required parameters + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.PreviewTemplateResponse preview( + String templateType, + String slug, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.PreviewTemplateRequest request = + com.clerk.backend_api.models.operations.PreviewTemplateRequest + .builder() + .templateType(templateType) + .slug(slug) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.PreviewTemplateRequest.class, + _baseUrl, + "/templates/{template_type}/{slug}/preview", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("PreviewTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("PreviewTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("PreviewTemplate", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("PreviewTemplate", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.PreviewTemplateResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.PreviewTemplateResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.PreviewTemplateResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.operations.PreviewTemplateResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Toggle the delivery by Clerk for a template of a given type and slug + * Toggles the delivery by Clerk for a template of a given type and slug. + * If disabled, Clerk will not deliver the resulting email or SMS. + * The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.ToggleTemplateDeliveryRequestBuilder toggleDelivery() { + return new com.clerk.backend_api.models.operations.ToggleTemplateDeliveryRequestBuilder(this); + } + + /** + * Toggle the delivery by Clerk for a template of a given type and slug + * Toggles the delivery by Clerk for a template of a given type and slug. + * If disabled, Clerk will not deliver the resulting email or SMS. + * The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. + * @param templateType The type of template to toggle delivery for + * @param slug The slug of the template for which to toggle delivery + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ToggleTemplateDeliveryResponse toggleDelivery( + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryPathParamTemplateType templateType, + String slug) throws Exception { + return toggleDelivery(templateType, slug, Optional.empty()); + } + /** + * Toggle the delivery by Clerk for a template of a given type and slug + * Toggles the delivery by Clerk for a template of a given type and slug. + * If disabled, Clerk will not deliver the resulting email or SMS. + * The app developer will need to listen to the `email.created` or `sms.created` webhooks in order to handle delivery themselves. + * @param templateType The type of template to toggle delivery for + * @param slug The slug of the template for which to toggle delivery + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.ToggleTemplateDeliveryResponse toggleDelivery( + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryPathParamTemplateType templateType, + String slug, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryRequest request = + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryRequest + .builder() + .templateType(templateType) + .slug(slug) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryRequest.class, + _baseUrl, + "/templates/{template_type}/{slug}/toggle_delivery", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("ToggleTemplateDelivery", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("ToggleTemplateDelivery", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("ToggleTemplateDelivery", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("ToggleTemplateDelivery", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.Template _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withTemplate(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/TestingTokens.java b/src/main/java/com/clerk/backend_api/TestingTokens.java new file mode 100644 index 0000000..920d34e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/TestingTokens.java @@ -0,0 +1,137 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class TestingTokens implements + MethodCallCreateTestingToken { + + private final SDKConfiguration sdkConfiguration; + + TestingTokens(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Retrieve a new testing token + * Retrieve a new testing token. Only available for development instances. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateTestingTokenRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateTestingTokenRequestBuilder(this); + } + + /** + * Retrieve a new testing token + * Retrieve a new testing token. Only available for development instances. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateTestingTokenResponse createDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/testing_tokens"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateTestingToken", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateTestingToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateTestingToken", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateTestingToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateTestingTokenResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateTestingTokenResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateTestingTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.TestingToken _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withTestingToken(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Users.java b/src/main/java/com/clerk/backend_api/Users.java new file mode 100644 index 0000000..e65d8bd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Users.java @@ -0,0 +1,2550 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.SerializedBody; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.ReadContext; +import java.io.InputStream; +import java.lang.Long; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Users implements + MethodCallGetUserList, + MethodCallCreateUser, + MethodCallGetUsersCount, + MethodCallGetUser, + MethodCallUpdateUser, + MethodCallDeleteUser, + MethodCallBanUser, + MethodCallUnbanUser, + MethodCallLockUser, + MethodCallUnlockUser, + MethodCallSetUserProfileImage, + MethodCallDeleteUserProfileImage, + MethodCallUpdateUserMetadata, + MethodCallGetOAuthAccessToken, + MethodCallUsersGetOrganizationMemberships, + MethodCallVerifyPassword, + MethodCallVerifyTOTP, + MethodCallDisableMFA { + + private final SDKConfiguration sdkConfiguration; + + Users(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * List all users + * Returns a list of all users. + * The users are returned sorted by creation date, with the newest users appearing first. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetUserListRequestBuilder list() { + return new com.clerk.backend_api.models.operations.GetUserListRequestBuilder(this); + } + + /** + * List all users + * Returns a list of all users. + * The users are returned sorted by creation date, with the newest users appearing first. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetUserListResponse list( + com.clerk.backend_api.models.operations.GetUserListRequest request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/users"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.GetUserListRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetUserList", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetUserList", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetUserList", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetUserList", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.GetUserListResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetUserListResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.GetUserListRequestBuilder _ret = list(); + _ret.request(new com.clerk.backend_api.models.operations.GetUserListRequest( + request.emailAddress(), + request.phoneNumber(), + request.externalId(), + request.username(), + request.web3Wallet(), + request.userId(), + request.organizationId(), + request.query(), + request.lastActiveAtSince(), + request.limit(), + request.offset(), + request.orderBy() + )); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.GetUserListResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference>() {}); + _res.withUserList(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Create a new user + * Creates a new user. Your user management settings determine how you should setup your user model. + * + * Any email address and phone number created using this method will be marked as verified. + * + * Note: If you are performing a migration, check out our guide on [zero downtime migrations](https://clerk.com/docs/deployments/migrate-overview). + * + * A rate limit rule of 20 requests per 10 seconds is applied to this endpoint. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateUserRequestBuilder create() { + return new com.clerk.backend_api.models.operations.CreateUserRequestBuilder(this); + } + + /** + * Create a new user + * Creates a new user. Your user management settings determine how you should setup your user model. + * + * Any email address and phone number created using this method will be marked as verified. + * + * Note: If you are performing a migration, check out our guide on [zero downtime migrations](https://clerk.com/docs/deployments/migrate-overview). + * + * A rate limit rule of 20 requests per 10 seconds is applied to this endpoint. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateUserResponse create( + com.clerk.backend_api.models.operations.CreateUserRequestBody request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/users"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "request", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateUser", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateUser", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateUserResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateUserResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateUserResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Count users + * Returns a total count of all users that match the given filtering criteria. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetUsersCountRequestBuilder count() { + return new com.clerk.backend_api.models.operations.GetUsersCountRequestBuilder(this); + } + + /** + * Count users + * Returns a total count of all users that match the given filtering criteria. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetUsersCountResponse count( + com.clerk.backend_api.models.operations.GetUsersCountRequest request) throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/users/count"); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.GetUsersCountRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetUsersCount", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetUsersCount", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetUsersCount", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetUsersCount", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetUsersCountResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetUsersCountResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetUsersCountResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.TotalCount _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withTotalCount(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve a user + * Retrieve the details of a user + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetUserRequestBuilder get() { + return new com.clerk.backend_api.models.operations.GetUserRequestBuilder(this); + } + + /** + * Retrieve a user + * Retrieve the details of a user + * @param userId The ID of the user to retrieve + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetUserResponse get( + String userId) throws Exception { + com.clerk.backend_api.models.operations.GetUserRequest request = + com.clerk.backend_api.models.operations.GetUserRequest + .builder() + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetUserRequest.class, + _baseUrl, + "/users/{user_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetUser", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetUser", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetUserResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetUserResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetUserResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Update a user + * Update a user's attributes. + * + * You can set the user's primary contact identifiers (email address and phone numbers) by updating the `primary_email_address_id` and `primary_phone_number_id` attributes respectively. + * Both IDs should correspond to verified identifications that belong to the user. + * + * You can remove a user's username by setting the username attribute to null or the blank string "". + * This is a destructive action; the identification will be deleted forever. + * Usernames can be removed only if they are optional in your instance settings and there's at least one other identifier which can be used for authentication. + * + * This endpoint allows changing a user's password. When passing the `password` parameter directly you have two further options. + * You can ignore the password policy checks for your instance by setting the `skip_password_checks` parameter to `true`. + * You can also choose to sign the user out of all their active sessions on any device once the password is updated. Just set `sign_out_of_other_sessions` to `true`. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateUserRequestBuilder update() { + return new com.clerk.backend_api.models.operations.UpdateUserRequestBuilder(this); + } + + /** + * Update a user + * Update a user's attributes. + * + * You can set the user's primary contact identifiers (email address and phone numbers) by updating the `primary_email_address_id` and `primary_phone_number_id` attributes respectively. + * Both IDs should correspond to verified identifications that belong to the user. + * + * You can remove a user's username by setting the username attribute to null or the blank string "". + * This is a destructive action; the identification will be deleted forever. + * Usernames can be removed only if they are optional in your instance settings and there's at least one other identifier which can be used for authentication. + * + * This endpoint allows changing a user's password. When passing the `password` parameter directly you have two further options. + * You can ignore the password policy checks for your instance by setting the `skip_password_checks` parameter to `true`. + * You can also choose to sign the user out of all their active sessions on any device once the password is updated. Just set `sign_out_of_other_sessions` to `true`. + * @param userId The ID of the user to update + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateUserResponse update( + String userId, + com.clerk.backend_api.models.operations.UpdateUserRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateUserRequest request = + com.clerk.backend_api.models.operations.UpdateUserRequest + .builder() + .userId(userId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateUserRequest.class, + _baseUrl, + "/users/{user_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateUser", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateUser", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateUserResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateUserResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateUserResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete a user + * Delete the specified user + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteUserRequestBuilder delete() { + return new com.clerk.backend_api.models.operations.DeleteUserRequestBuilder(this); + } + + /** + * Delete a user + * Delete the specified user + * @param userId The ID of the user to delete + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteUserResponse delete( + String userId) throws Exception { + com.clerk.backend_api.models.operations.DeleteUserRequest request = + com.clerk.backend_api.models.operations.DeleteUserRequest + .builder() + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteUserRequest.class, + _baseUrl, + "/users/{user_id}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteUser", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteUser", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteUserResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteUserResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteUserResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.DeletedObject _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withDeletedObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Ban a user + * Marks the given user as banned, which means that all their sessions are revoked and they are not allowed to sign in again. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.BanUserRequestBuilder ban() { + return new com.clerk.backend_api.models.operations.BanUserRequestBuilder(this); + } + + /** + * Ban a user + * Marks the given user as banned, which means that all their sessions are revoked and they are not allowed to sign in again. + * @param userId The ID of the user to ban + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.BanUserResponse ban( + String userId) throws Exception { + com.clerk.backend_api.models.operations.BanUserRequest request = + com.clerk.backend_api.models.operations.BanUserRequest + .builder() + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.BanUserRequest.class, + _baseUrl, + "/users/{user_id}/ban", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("BanUser", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("BanUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("BanUser", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("BanUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.BanUserResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.BanUserResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.BanUserResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Unban a user + * Removes the ban mark from the given user. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UnbanUserRequestBuilder unban() { + return new com.clerk.backend_api.models.operations.UnbanUserRequestBuilder(this); + } + + /** + * Unban a user + * Removes the ban mark from the given user. + * @param userId The ID of the user to unban + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UnbanUserResponse unban( + String userId) throws Exception { + com.clerk.backend_api.models.operations.UnbanUserRequest request = + com.clerk.backend_api.models.operations.UnbanUserRequest + .builder() + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UnbanUserRequest.class, + _baseUrl, + "/users/{user_id}/unban", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UnbanUser", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UnbanUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UnbanUser", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UnbanUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UnbanUserResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UnbanUserResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UnbanUserResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "402")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Lock a user + * Marks the given user as locked, which means they are not allowed to sign in again until the lock expires. + * Lock duration can be configured in the instance's restrictions settings. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.LockUserRequestBuilder lock() { + return new com.clerk.backend_api.models.operations.LockUserRequestBuilder(this); + } + + /** + * Lock a user + * Marks the given user as locked, which means they are not allowed to sign in again until the lock expires. + * Lock duration can be configured in the instance's restrictions settings. + * @param userId The ID of the user to lock + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.LockUserResponse lock( + String userId) throws Exception { + com.clerk.backend_api.models.operations.LockUserRequest request = + com.clerk.backend_api.models.operations.LockUserRequest + .builder() + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.LockUserRequest.class, + _baseUrl, + "/users/{user_id}/lock", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("LockUser", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("LockUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("LockUser", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("LockUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.LockUserResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.LockUserResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.LockUserResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Unlock a user + * Removes the lock from the given user. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UnlockUserRequestBuilder unlock() { + return new com.clerk.backend_api.models.operations.UnlockUserRequestBuilder(this); + } + + /** + * Unlock a user + * Removes the lock from the given user. + * @param userId The ID of the user to unlock + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UnlockUserResponse unlock( + String userId) throws Exception { + com.clerk.backend_api.models.operations.UnlockUserRequest request = + com.clerk.backend_api.models.operations.UnlockUserRequest + .builder() + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UnlockUserRequest.class, + _baseUrl, + "/users/{user_id}/unlock", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UnlockUser", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UnlockUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UnlockUser", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UnlockUser", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UnlockUserResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UnlockUserResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UnlockUserResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Set user profile image + * Update a user's profile image + * @return The call builder + */ + public com.clerk.backend_api.models.operations.SetUserProfileImageRequestBuilder setProfileImage() { + return new com.clerk.backend_api.models.operations.SetUserProfileImageRequestBuilder(this); + } + + /** + * Set user profile image + * Update a user's profile image + * @param userId The ID of the user to update the profile image for + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.SetUserProfileImageResponse setProfileImage( + String userId, + com.clerk.backend_api.models.operations.SetUserProfileImageRequestBody requestBody) throws Exception { + com.clerk.backend_api.models.operations.SetUserProfileImageRequest request = + com.clerk.backend_api.models.operations.SetUserProfileImageRequest + .builder() + .userId(userId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.SetUserProfileImageRequest.class, + _baseUrl, + "/users/{user_id}/profile_image", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "multipart", false); + if (_serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("SetUserProfileImage", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("SetUserProfileImage", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("SetUserProfileImage", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("SetUserProfileImage", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.SetUserProfileImageResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.SetUserProfileImageResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.SetUserProfileImageResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete user profile image + * Delete a user's profile image + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteUserProfileImageRequestBuilder deleteProfileImage() { + return new com.clerk.backend_api.models.operations.DeleteUserProfileImageRequestBuilder(this); + } + + /** + * Delete user profile image + * Delete a user's profile image + * @param userId The ID of the user to delete the profile image for + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteUserProfileImageResponse deleteProfileImage( + String userId) throws Exception { + com.clerk.backend_api.models.operations.DeleteUserProfileImageRequest request = + com.clerk.backend_api.models.operations.DeleteUserProfileImageRequest + .builder() + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DeleteUserProfileImageRequest.class, + _baseUrl, + "/users/{user_id}/profile_image", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteUserProfileImage", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteUserProfileImage", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteUserProfileImage", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteUserProfileImage", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteUserProfileImageResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteUserProfileImageResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteUserProfileImageResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Merge and update a user's metadata + * Update a user's metadata attributes by merging existing values with the provided parameters. + * + * This endpoint behaves differently than the *Update a user* endpoint. + * Metadata values will not be replaced entirely. + * Instead, a deep merge will be performed. + * Deep means that any nested JSON objects will be merged as well. + * + * You can remove metadata keys at any level by setting their value to `null`. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UpdateUserMetadataRequestBuilder updateMetadata() { + return new com.clerk.backend_api.models.operations.UpdateUserMetadataRequestBuilder(this); + } + + /** + * Merge and update a user's metadata + * Update a user's metadata attributes by merging existing values with the provided parameters. + * + * This endpoint behaves differently than the *Update a user* endpoint. + * Metadata values will not be replaced entirely. + * Instead, a deep merge will be performed. + * Deep means that any nested JSON objects will be merged as well. + * + * You can remove metadata keys at any level by setting their value to `null`. + * @param userId The ID of the user whose metadata will be updated and merged + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateUserMetadataResponse updateMetadata( + String userId) throws Exception { + return updateMetadata(userId, Optional.empty()); + } + /** + * Merge and update a user's metadata + * Update a user's metadata attributes by merging existing values with the provided parameters. + * + * This endpoint behaves differently than the *Update a user* endpoint. + * Metadata values will not be replaced entirely. + * Instead, a deep merge will be performed. + * Deep means that any nested JSON objects will be merged as well. + * + * You can remove metadata keys at any level by setting their value to `null`. + * @param userId The ID of the user whose metadata will be updated and merged + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UpdateUserMetadataResponse updateMetadata( + String userId, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.UpdateUserMetadataRequest request = + com.clerk.backend_api.models.operations.UpdateUserMetadataRequest + .builder() + .userId(userId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UpdateUserMetadataRequest.class, + _baseUrl, + "/users/{user_id}/metadata", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "PATCH"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UpdateUserMetadata", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UpdateUserMetadata", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UpdateUserMetadata", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UpdateUserMetadata", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.UpdateUserMetadataResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UpdateUserMetadataResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.UpdateUserMetadataResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.User _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withUser(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve the OAuth access token of a user + * Fetch the corresponding OAuth access token for a user that has previously authenticated with a particular OAuth provider. + * For OAuth 2.0, if the access token has expired and we have a corresponding refresh token, the access token will be refreshed transparently the new one will be returned. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GetOAuthAccessTokenRequestBuilder getOAuthAccessToken() { + return new com.clerk.backend_api.models.operations.GetOAuthAccessTokenRequestBuilder(this); + } + + /** + * Retrieve the OAuth access token of a user + * Fetch the corresponding OAuth access token for a user that has previously authenticated with a particular OAuth provider. + * For OAuth 2.0, if the access token has expired and we have a corresponding refresh token, the access token will be refreshed transparently the new one will be returned. + * @param userId The ID of the user for which to retrieve the OAuth access token + * @param provider The ID of the OAuth provider (e.g. `oauth_google`) + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GetOAuthAccessTokenResponse getOAuthAccessToken( + String userId, + String provider) throws Exception { + com.clerk.backend_api.models.operations.GetOAuthAccessTokenRequest request = + com.clerk.backend_api.models.operations.GetOAuthAccessTokenRequest + .builder() + .userId(userId) + .provider(provider) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.GetOAuthAccessTokenRequest.class, + _baseUrl, + "/users/{user_id}/oauth_access_tokens/{provider}", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GetOAuthAccessToken", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "422", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GetOAuthAccessToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GetOAuthAccessToken", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GetOAuthAccessToken", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GetOAuthAccessTokenResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GetOAuthAccessTokenResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GetOAuthAccessTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + java.util.List _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference>() {}); + _res.withResponseBodies(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "422")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Retrieve all memberships for a user + * Retrieve a paginated list of the user's organization memberships + * @return The call builder + */ + public com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsRequestBuilder getOrganizationMemberships() { + return new com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsRequestBuilder(this); + } + + /** + * Retrieve all memberships for a user + * Retrieve a paginated list of the user's organization memberships + * @param userId The ID of the user whose organization memberships we want to retrieve + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsResponse getOrganizationMemberships( + String userId) throws Exception { + return getOrganizationMemberships(userId, Optional.empty(), Optional.empty()); + } + /** + * Retrieve all memberships for a user + * Retrieve a paginated list of the user's organization memberships + * @param userId The ID of the user whose organization memberships we want to retrieve + * @param limit Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + * @param offset Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsResponse getOrganizationMemberships( + String userId, + Optional limit, + Optional offset) throws Exception { + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsRequest request = + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsRequest + .builder() + .userId(userId) + .limit(limit) + .offset(offset) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsRequest.class, + _baseUrl, + "/users/{user_id}/organization_memberships", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + _req.addQueryParams(Utils.getQueryParams( + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsRequest.class, + request, + null)); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("UsersGetOrganizationMemberships", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("UsersGetOrganizationMemberships", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("UsersGetOrganizationMemberships", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("UsersGetOrganizationMemberships", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + byte[] _fullResponse = Utils.toByteArrayAndClose(_httpRes.body()); + + @SuppressWarnings("deprecation") + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes) + .next(() -> { + String _stringBody = new String(_fullResponse, StandardCharsets.UTF_8); + ReadContext _body = JsonPath.parse(_stringBody); + + if (request == null) { + return Optional.empty(); + } + long _requestOffset = request.offset().get(); + @SuppressWarnings("unchecked") + List _firstResult = _body.read("$", List.class); + if (_firstResult == null || _firstResult.isEmpty()){ + return Optional.empty(); + }; + long _resolvedLimit = limit.get(); + + if (_firstResult.size() < _resolvedLimit) { + return Optional.empty(); + }; + long _newOffset = _requestOffset + _firstResult.size(); + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsRequestBuilder _ret = getOrganizationMemberships(); + _ret.userId(userId); + _ret.limit(_resolvedLimit); + _ret.offset(_newOffset); + return Optional.of(_ret.call()); + }); + + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.OrganizationMemberships _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + _res.withOrganizationMemberships(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "403")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + new String(_fullResponse, StandardCharsets.UTF_8), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + _fullResponse); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + _fullResponse); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + _fullResponse); + } + + + + /** + * Verify the password of a user + * Check that the user's password matches the supplied input. + * Useful for custom auth flows and re-verification. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.VerifyPasswordRequestBuilder verifyPassword() { + return new com.clerk.backend_api.models.operations.VerifyPasswordRequestBuilder(this); + } + + /** + * Verify the password of a user + * Check that the user's password matches the supplied input. + * Useful for custom auth flows and re-verification. + * @param userId The ID of the user for whom to verify the password + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.VerifyPasswordResponse verifyPassword( + String userId) throws Exception { + return verifyPassword(userId, Optional.empty()); + } + /** + * Verify the password of a user + * Check that the user's password matches the supplied input. + * Useful for custom auth flows and re-verification. + * @param userId The ID of the user for whom to verify the password + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.VerifyPasswordResponse verifyPassword( + String userId, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.VerifyPasswordRequest request = + com.clerk.backend_api.models.operations.VerifyPasswordRequest + .builder() + .userId(userId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.VerifyPasswordRequest.class, + _baseUrl, + "/users/{user_id}/verify_password", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("VerifyPassword", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422", "4XX", "500", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("VerifyPassword", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("VerifyPassword", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("VerifyPassword", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.VerifyPasswordResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.VerifyPasswordResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.VerifyPasswordResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.operations.VerifyPasswordResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "500")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Verify a TOTP or backup code for a user + * Verify that the provided TOTP or backup code is valid for the user. + * Verifying a backup code will result it in being consumed (i.e. it will + * become invalid). + * Useful for custom auth flows and re-verification. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.VerifyTOTPRequestBuilder verifyTOTP() { + return new com.clerk.backend_api.models.operations.VerifyTOTPRequestBuilder(this); + } + + /** + * Verify a TOTP or backup code for a user + * Verify that the provided TOTP or backup code is valid for the user. + * Verifying a backup code will result it in being consumed (i.e. it will + * become invalid). + * Useful for custom auth flows and re-verification. + * @param userId The ID of the user for whom to verify the TOTP + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.VerifyTOTPResponse verifyTOTP( + String userId) throws Exception { + return verifyTOTP(userId, Optional.empty()); + } + /** + * Verify a TOTP or backup code for a user + * Verify that the provided TOTP or backup code is valid for the user. + * Verifying a backup code will result it in being consumed (i.e. it will + * become invalid). + * Useful for custom auth flows and re-verification. + * @param userId The ID of the user for whom to verify the TOTP + * @param requestBody + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.VerifyTOTPResponse verifyTOTP( + String userId, + Optional requestBody) throws Exception { + com.clerk.backend_api.models.operations.VerifyTOTPRequest request = + com.clerk.backend_api.models.operations.VerifyTOTPRequest + .builder() + .userId(userId) + .requestBody(requestBody) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.VerifyTOTPRequest.class, + _baseUrl, + "/users/{user_id}/verify_totp", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape(request, Utils.JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, "requestBody", "json", false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("VerifyTOTP", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422", "4XX", "500", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("VerifyTOTP", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("VerifyTOTP", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("VerifyTOTP", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.VerifyTOTPResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.VerifyTOTPResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.VerifyTOTPResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.operations.VerifyTOTPResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "422", "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "500")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Disable a user's MFA methods + * Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once. + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DisableMFARequestBuilder disableMFA() { + return new com.clerk.backend_api.models.operations.DisableMFARequestBuilder(this); + } + + /** + * Disable a user's MFA methods + * Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once. + * @param userId The ID of the user whose MFA methods are to be disabled + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DisableMFAResponse disableMFA( + String userId) throws Exception { + com.clerk.backend_api.models.operations.DisableMFARequest request = + com.clerk.backend_api.models.operations.DisableMFARequest + .builder() + .userId(userId) + .build(); + + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + com.clerk.backend_api.models.operations.DisableMFARequest.class, + _baseUrl, + "/users/{user_id}/mfa", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DisableMFA", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "500", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DisableMFA", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DisableMFA", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DisableMFA", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DisableMFAResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DisableMFAResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DisableMFAResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.operations.DisableMFAResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withObject(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "500")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/Webhooks.java b/src/main/java/com/clerk/backend_api/Webhooks.java new file mode 100644 index 0000000..0f0a6b0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/Webhooks.java @@ -0,0 +1,372 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.models.operations.SDKMethodInterfaces.*; +import com.clerk.backend_api.utils.HTTPClient; +import com.clerk.backend_api.utils.HTTPRequest; +import com.clerk.backend_api.utils.Hook.AfterErrorContextImpl; +import com.clerk.backend_api.utils.Hook.AfterSuccessContextImpl; +import com.clerk.backend_api.utils.Hook.BeforeRequestContextImpl; +import com.clerk.backend_api.utils.JSON; +import com.clerk.backend_api.utils.Retries.NonRetryableException; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Webhooks implements + MethodCallCreateSvixApp, + MethodCallDeleteSvixApp, + MethodCallGenerateSvixAuthURL { + + private final SDKConfiguration sdkConfiguration; + + Webhooks(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + + /** + * Create a Svix app + * Create a Svix app and associate it with the current instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.CreateSvixAppRequestBuilder createSvixApp() { + return new com.clerk.backend_api.models.operations.CreateSvixAppRequestBuilder(this); + } + + /** + * Create a Svix app + * Create a Svix app and associate it with the current instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.CreateSvixAppResponse createSvixAppDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/webhooks/svix"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("CreateSvixApp", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("CreateSvixApp", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("CreateSvixApp", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("CreateSvixApp", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.CreateSvixAppResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.CreateSvixAppResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.CreateSvixAppResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SvixURL _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSvixURL(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Delete a Svix app + * Delete a Svix app and disassociate it from the current instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.DeleteSvixAppRequestBuilder deleteSvixApp() { + return new com.clerk.backend_api.models.operations.DeleteSvixAppRequestBuilder(this); + } + + /** + * Delete a Svix app + * Delete a Svix app and disassociate it from the current instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.DeleteSvixAppResponse deleteSvixAppDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/webhooks/svix"); + + HTTPRequest _req = new HTTPRequest(_url, "DELETE"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("DeleteSvixApp", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("DeleteSvixApp", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("DeleteSvixApp", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("DeleteSvixApp", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.DeleteSvixAppResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.DeleteSvixAppResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.DeleteSvixAppResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "204")) { + // no content + return _res; + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + + + + /** + * Create a Svix Dashboard URL + * Generate a new url for accessing the Svix's management dashboard for that particular instance + * @return The call builder + */ + public com.clerk.backend_api.models.operations.GenerateSvixAuthURLRequestBuilder generateSvixAuthURL() { + return new com.clerk.backend_api.models.operations.GenerateSvixAuthURLRequestBuilder(this); + } + + /** + * Create a Svix Dashboard URL + * Generate a new url for accessing the Svix's management dashboard for that particular instance + * @return The response from the API call + * @throws Exception if the API call fails + */ + public com.clerk.backend_api.models.operations.GenerateSvixAuthURLResponse generateSvixAuthURLDirect() throws Exception { + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + _baseUrl, + "/webhooks/svix_url"); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + this.sdkConfiguration.userAgent); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HttpRequest _r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl("GenerateSvixAuthURL", Optional.empty(), sdkConfiguration.securitySource()), + _req.build()); + HttpResponse _httpRes; + try { + _httpRes = _client.send(_r); + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { + _httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl("GenerateSvixAuthURL", Optional.empty(), sdkConfiguration.securitySource()), + Optional.of(_httpRes), + Optional.empty()); + } else { + _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl("GenerateSvixAuthURL", Optional.empty(), sdkConfiguration.securitySource()), + _httpRes); + } + } catch (Exception _e) { + _httpRes = sdkConfiguration.hooks() + .afterError(new AfterErrorContextImpl("GenerateSvixAuthURL", Optional.empty(), sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.clerk.backend_api.models.operations.GenerateSvixAuthURLResponse.Builder _resBuilder = + com.clerk.backend_api.models.operations.GenerateSvixAuthURLResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + com.clerk.backend_api.models.operations.GenerateSvixAuthURLResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.components.SvixURL _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withSvixURL(java.util.Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + com.clerk.backend_api.models.errors.ClerkErrors _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.toByteArrayAndClose(_httpRes.body())); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.toByteArrayAndClose(_httpRes.body())); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.toByteArrayAndClose(_httpRes.body())); + } + +} diff --git a/src/main/java/com/clerk/backend_api/hooks/SDKHooks.java b/src/main/java/com/clerk/backend_api/hooks/SDKHooks.java new file mode 100644 index 0000000..0250869 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/hooks/SDKHooks.java @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.hooks; + +// +// This file is written once by speakeasy code generation and +// thereafter will not be overwritten by speakeasy updates. As a +// consequence any customization of this class will be preserved. +// + +public final class SDKHooks { + + private SDKHooks() { + // prevent instantiation + } + + public static final void initialize(com.clerk.backend_api.utils.Hooks hooks) { + // register hooks here + + // for more information see + // https://www.speakeasyapi.dev/docs/additional-features/sdk-hooks + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Actor.java b/src/main/java/com/clerk/backend_api/models/components/Actor.java new file mode 100644 index 0000000..13fd79b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Actor.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Actor { + + @JsonCreator + public Actor() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(Actor.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public Actor build() { + return new Actor( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ActorToken.java b/src/main/java/com/clerk/backend_api/models/components/ActorToken.java new file mode 100644 index 0000000..db3439a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ActorToken.java @@ -0,0 +1,396 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ActorToken { + + @JsonProperty("object") + private ActorTokenObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("status") + private ActorTokenStatus status; + + @JsonProperty("user_id") + private String userId; + + @JsonProperty("actor") + private ActorTokenActor actor; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("token") + private JsonNullable token; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("url") + private JsonNullable url; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public ActorToken( + @JsonProperty("object") ActorTokenObject object, + @JsonProperty("id") String id, + @JsonProperty("status") ActorTokenStatus status, + @JsonProperty("user_id") String userId, + @JsonProperty("actor") ActorTokenActor actor, + @JsonProperty("token") JsonNullable token, + @JsonProperty("url") JsonNullable url, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(actor, "actor"); + Utils.checkNotNull(token, "token"); + Utils.checkNotNull(url, "url"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.status = status; + this.userId = userId; + this.actor = actor; + this.token = token; + this.url = url; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public ActorToken( + ActorTokenObject object, + String id, + ActorTokenStatus status, + String userId, + ActorTokenActor actor, + long createdAt, + long updatedAt) { + this(object, id, status, userId, actor, JsonNullable.undefined(), JsonNullable.undefined(), createdAt, updatedAt); + } + + @JsonIgnore + public ActorTokenObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public ActorTokenStatus status() { + return status; + } + + @JsonIgnore + public String userId() { + return userId; + } + + @JsonIgnore + public ActorTokenActor actor() { + return actor; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable token() { + return (JsonNullable) token; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable url() { + return (JsonNullable) url; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public ActorToken withObject(ActorTokenObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public ActorToken withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public ActorToken withStatus(ActorTokenStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public ActorToken withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public ActorToken withActor(ActorTokenActor actor) { + Utils.checkNotNull(actor, "actor"); + this.actor = actor; + return this; + } + + public ActorToken withToken(String token) { + Utils.checkNotNull(token, "token"); + this.token = JsonNullable.of(token); + return this; + } + + public ActorToken withToken(JsonNullable token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + public ActorToken withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = JsonNullable.of(url); + return this; + } + + public ActorToken withUrl(JsonNullable url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public ActorToken withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public ActorToken withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActorToken other = (ActorToken) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.actor, other.actor) && + java.util.Objects.deepEquals(this.token, other.token) && + java.util.Objects.deepEquals(this.url, other.url) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + status, + userId, + actor, + token, + url, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(ActorToken.class, + "object", object, + "id", id, + "status", status, + "userId", userId, + "actor", actor, + "token", token, + "url", url, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private ActorTokenObject object; + + private String id; + + private ActorTokenStatus status; + + private String userId; + + private ActorTokenActor actor; + + private JsonNullable token = JsonNullable.undefined(); + + private JsonNullable url = JsonNullable.undefined(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(ActorTokenObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder status(ActorTokenStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder actor(ActorTokenActor actor) { + Utils.checkNotNull(actor, "actor"); + this.actor = actor; + return this; + } + + public Builder token(String token) { + Utils.checkNotNull(token, "token"); + this.token = JsonNullable.of(token); + return this; + } + + public Builder token(JsonNullable token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = JsonNullable.of(url); + return this; + } + + public Builder url(JsonNullable url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public ActorToken build() { + return new ActorToken( + object, + id, + status, + userId, + actor, + token, + url, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ActorTokenActor.java b/src/main/java/com/clerk/backend_api/models/components/ActorTokenActor.java new file mode 100644 index 0000000..90162ca --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ActorTokenActor.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class ActorTokenActor { + + @JsonCreator + public ActorTokenActor() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(ActorTokenActor.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public ActorTokenActor build() { + return new ActorTokenActor( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ActorTokenObject.java b/src/main/java/com/clerk/backend_api/models/components/ActorTokenObject.java new file mode 100644 index 0000000..858840d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ActorTokenObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum ActorTokenObject { + ACTOR_TOKEN("actor_token"); + + @JsonValue + private final String value; + + private ActorTokenObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/ActorTokenStatus.java b/src/main/java/com/clerk/backend_api/models/components/ActorTokenStatus.java new file mode 100644 index 0000000..fbf38cd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ActorTokenStatus.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum ActorTokenStatus { + PENDING("pending"), + ACCEPTED("accepted"), + REVOKED("revoked"); + + @JsonValue + private final String value; + + private ActorTokenStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Admin.java b/src/main/java/com/clerk/backend_api/models/components/Admin.java new file mode 100644 index 0000000..7041aeb --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Admin.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Admin { + + @JsonProperty("status") + private AdminVerificationStatus status; + + @JsonProperty("strategy") + private VerificationStrategy strategy; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attempts") + private JsonNullable attempts; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expire_at") + private JsonNullable expireAt; + + @JsonCreator + public Admin( + @JsonProperty("status") AdminVerificationStatus status, + @JsonProperty("strategy") VerificationStrategy strategy, + @JsonProperty("attempts") JsonNullable attempts, + @JsonProperty("expire_at") JsonNullable expireAt) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(attempts, "attempts"); + Utils.checkNotNull(expireAt, "expireAt"); + this.status = status; + this.strategy = strategy; + this.attempts = attempts; + this.expireAt = expireAt; + } + + public Admin( + AdminVerificationStatus status, + VerificationStrategy strategy) { + this(status, strategy, JsonNullable.undefined(), JsonNullable.undefined()); + } + + @JsonIgnore + public AdminVerificationStatus status() { + return status; + } + + @JsonIgnore + public VerificationStrategy strategy() { + return strategy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attempts() { + return (JsonNullable) attempts; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable expireAt() { + return (JsonNullable) expireAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Admin withStatus(AdminVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Admin withStrategy(VerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Admin withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Admin withAttempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Admin withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Admin withExpireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Admin other = (Admin) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.attempts, other.attempts) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + attempts, + expireAt); + } + + @Override + public String toString() { + return Utils.toString(Admin.class, + "status", status, + "strategy", strategy, + "attempts", attempts, + "expireAt", expireAt); + } + + public final static class Builder { + + private AdminVerificationStatus status; + + private VerificationStrategy strategy; + + private JsonNullable attempts = JsonNullable.undefined(); + + private JsonNullable expireAt = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder status(AdminVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(VerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Builder attempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Builder expireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Admin build() { + return new Admin( + status, + strategy, + attempts, + expireAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/AdminVerificationPhoneNumberStatus.java b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationPhoneNumberStatus.java new file mode 100644 index 0000000..714c33b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationPhoneNumberStatus.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum AdminVerificationPhoneNumberStatus { + VERIFIED("verified"); + + @JsonValue + private final String value; + + private AdminVerificationPhoneNumberStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/AdminVerificationStatus.java b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationStatus.java new file mode 100644 index 0000000..b3f474d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationStatus.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum AdminVerificationStatus { + VERIFIED("verified"); + + @JsonValue + private final String value; + + private AdminVerificationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/AdminVerificationStrategy.java b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationStrategy.java new file mode 100644 index 0000000..81fcd72 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationStrategy.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum AdminVerificationStrategy { + ADMIN("admin"); + + @JsonValue + private final String value; + + private AdminVerificationStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/AdminVerificationWeb3WalletStatus.java b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationWeb3WalletStatus.java new file mode 100644 index 0000000..a2f4233 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationWeb3WalletStatus.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum AdminVerificationWeb3WalletStatus { + VERIFIED("verified"); + + @JsonValue + private final String value; + + private AdminVerificationWeb3WalletStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/AdminVerificationWeb3WalletStrategy.java b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationWeb3WalletStrategy.java new file mode 100644 index 0000000..14b28bd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/AdminVerificationWeb3WalletStrategy.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum AdminVerificationWeb3WalletStrategy { + ADMIN("admin"); + + @JsonValue + private final String value; + + private AdminVerificationWeb3WalletStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/AllowlistIdentifier.java b/src/main/java/com/clerk/backend_api/models/components/AllowlistIdentifier.java new file mode 100644 index 0000000..a420083 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/AllowlistIdentifier.java @@ -0,0 +1,508 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class AllowlistIdentifier { + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("invitation_id") + private Optional invitationId; + + /** + * An email address or a phone number. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("identifier") + private Optional identifier; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("identifier_type") + private Optional identifierType; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("instance_id") + private Optional instanceId; + + /** + * Unix timestamp of creation + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private Optional createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private Optional updatedAt; + + @JsonCreator + public AllowlistIdentifier( + @JsonProperty("object") Optional object, + @JsonProperty("id") Optional id, + @JsonProperty("invitation_id") Optional invitationId, + @JsonProperty("identifier") Optional identifier, + @JsonProperty("identifier_type") Optional identifierType, + @JsonProperty("instance_id") Optional instanceId, + @JsonProperty("created_at") Optional createdAt, + @JsonProperty("updated_at") Optional updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(invitationId, "invitationId"); + Utils.checkNotNull(identifier, "identifier"); + Utils.checkNotNull(identifierType, "identifierType"); + Utils.checkNotNull(instanceId, "instanceId"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.invitationId = invitationId; + this.identifier = identifier; + this.identifierType = identifierType; + this.instanceId = instanceId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public AllowlistIdentifier() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional invitationId() { + return (Optional) invitationId; + } + + /** + * An email address or a phone number. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifierType() { + return (Optional) identifierType; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional instanceId() { + return (Optional) instanceId; + } + + /** + * Unix timestamp of creation + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public AllowlistIdentifier withObject(AllowlistIdentifierObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public AllowlistIdentifier withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public AllowlistIdentifier withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public AllowlistIdentifier withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AllowlistIdentifier withInvitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = Optional.ofNullable(invitationId); + return this; + } + + public AllowlistIdentifier withInvitationId(Optional invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + /** + * An email address or a phone number. + * + */ + public AllowlistIdentifier withIdentifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + * An email address or a phone number. + * + */ + public AllowlistIdentifier withIdentifier(Optional identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public AllowlistIdentifier withIdentifierType(IdentifierType identifierType) { + Utils.checkNotNull(identifierType, "identifierType"); + this.identifierType = Optional.ofNullable(identifierType); + return this; + } + + public AllowlistIdentifier withIdentifierType(Optional identifierType) { + Utils.checkNotNull(identifierType, "identifierType"); + this.identifierType = identifierType; + return this; + } + + public AllowlistIdentifier withInstanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + public AllowlistIdentifier withInstanceId(Optional instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public AllowlistIdentifier withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation + * + */ + public AllowlistIdentifier withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public AllowlistIdentifier withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public AllowlistIdentifier withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllowlistIdentifier other = (AllowlistIdentifier) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.invitationId, other.invitationId) && + java.util.Objects.deepEquals(this.identifier, other.identifier) && + java.util.Objects.deepEquals(this.identifierType, other.identifierType) && + java.util.Objects.deepEquals(this.instanceId, other.instanceId) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + invitationId, + identifier, + identifierType, + instanceId, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(AllowlistIdentifier.class, + "object", object, + "id", id, + "invitationId", invitationId, + "identifier", identifier, + "identifierType", identifierType, + "instanceId", instanceId, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private Optional object = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional invitationId = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional identifierType = Optional.empty(); + + private Optional instanceId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(AllowlistIdentifierObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder invitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = Optional.ofNullable(invitationId); + return this; + } + + public Builder invitationId(Optional invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + /** + * An email address or a phone number. + * + */ + public Builder identifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + * An email address or a phone number. + * + */ + public Builder identifier(Optional identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public Builder identifierType(IdentifierType identifierType) { + Utils.checkNotNull(identifierType, "identifierType"); + this.identifierType = Optional.ofNullable(identifierType); + return this; + } + + public Builder identifierType(Optional identifierType) { + Utils.checkNotNull(identifierType, "identifierType"); + this.identifierType = identifierType; + return this; + } + + public Builder instanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + public Builder instanceId(Optional instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public AllowlistIdentifier build() { + return new AllowlistIdentifier( + object, + id, + invitationId, + identifier, + identifierType, + instanceId, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/AllowlistIdentifierObject.java b/src/main/java/com/clerk/backend_api/models/components/AllowlistIdentifierObject.java new file mode 100644 index 0000000..ded9c5b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/AllowlistIdentifierObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * AllowlistIdentifierObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum AllowlistIdentifierObject { + ALLOWLIST_IDENTIFIER("allowlist_identifier"); + + @JsonValue + private final String value; + + private AllowlistIdentifierObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/AttributeMapping.java b/src/main/java/com/clerk/backend_api/models/components/AttributeMapping.java new file mode 100644 index 0000000..1aefa8e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/AttributeMapping.java @@ -0,0 +1,240 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class AttributeMapping { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("user_id") + private Optional userId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_address") + private Optional emailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private Optional firstName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private Optional lastName; + + @JsonCreator + public AttributeMapping( + @JsonProperty("user_id") Optional userId, + @JsonProperty("email_address") Optional emailAddress, + @JsonProperty("first_name") Optional firstName, + @JsonProperty("last_name") Optional lastName) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + this.userId = userId; + this.emailAddress = emailAddress; + this.firstName = firstName; + this.lastName = lastName; + } + + public AttributeMapping() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional emailAddress() { + return (Optional) emailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional firstName() { + return (Optional) firstName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastName() { + return (Optional) lastName; + } + + public final static Builder builder() { + return new Builder(); + } + + public AttributeMapping withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public AttributeMapping withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public AttributeMapping withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + public AttributeMapping withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public AttributeMapping withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = Optional.ofNullable(firstName); + return this; + } + + public AttributeMapping withFirstName(Optional firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public AttributeMapping withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = Optional.ofNullable(lastName); + return this; + } + + public AttributeMapping withLastName(Optional lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttributeMapping other = (AttributeMapping) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + emailAddress, + firstName, + lastName); + } + + @Override + public String toString() { + return Utils.toString(AttributeMapping.class, + "userId", userId, + "emailAddress", emailAddress, + "firstName", firstName, + "lastName", lastName); + } + + public final static class Builder { + + private Optional userId = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = Optional.ofNullable(firstName); + return this; + } + + public Builder firstName(Optional firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = Optional.ofNullable(lastName); + return this; + } + + public Builder lastName(Optional lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + public AttributeMapping build() { + return new AttributeMapping( + userId, + emailAddress, + firstName, + lastName); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifier.java b/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifier.java new file mode 100644 index 0000000..d74418b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifier.java @@ -0,0 +1,465 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class BlocklistIdentifier { + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * An email address, email domain, phone number or web3 wallet. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("identifier") + private Optional identifier; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("identifier_type") + private Optional identifierType; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("instance_id") + private Optional instanceId; + + /** + * Unix timestamp of creation + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private Optional createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private Optional updatedAt; + + @JsonCreator + public BlocklistIdentifier( + @JsonProperty("object") Optional object, + @JsonProperty("id") Optional id, + @JsonProperty("identifier") Optional identifier, + @JsonProperty("identifier_type") Optional identifierType, + @JsonProperty("instance_id") Optional instanceId, + @JsonProperty("created_at") Optional createdAt, + @JsonProperty("updated_at") Optional updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(identifier, "identifier"); + Utils.checkNotNull(identifierType, "identifierType"); + Utils.checkNotNull(instanceId, "instanceId"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.identifier = identifier; + this.identifierType = identifierType; + this.instanceId = instanceId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public BlocklistIdentifier() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * An email address, email domain, phone number or web3 wallet. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifier() { + return (Optional) identifier; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional identifierType() { + return (Optional) identifierType; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional instanceId() { + return (Optional) instanceId; + } + + /** + * Unix timestamp of creation + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public BlocklistIdentifier withObject(BlocklistIdentifierObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public BlocklistIdentifier withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public BlocklistIdentifier withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public BlocklistIdentifier withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An email address, email domain, phone number or web3 wallet. + * + */ + public BlocklistIdentifier withIdentifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + * An email address, email domain, phone number or web3 wallet. + * + */ + public BlocklistIdentifier withIdentifier(Optional identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public BlocklistIdentifier withIdentifierType(BlocklistIdentifierIdentifierType identifierType) { + Utils.checkNotNull(identifierType, "identifierType"); + this.identifierType = Optional.ofNullable(identifierType); + return this; + } + + public BlocklistIdentifier withIdentifierType(Optional identifierType) { + Utils.checkNotNull(identifierType, "identifierType"); + this.identifierType = identifierType; + return this; + } + + public BlocklistIdentifier withInstanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + public BlocklistIdentifier withInstanceId(Optional instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public BlocklistIdentifier withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation + * + */ + public BlocklistIdentifier withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public BlocklistIdentifier withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public BlocklistIdentifier withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BlocklistIdentifier other = (BlocklistIdentifier) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.identifier, other.identifier) && + java.util.Objects.deepEquals(this.identifierType, other.identifierType) && + java.util.Objects.deepEquals(this.instanceId, other.instanceId) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + identifier, + identifierType, + instanceId, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(BlocklistIdentifier.class, + "object", object, + "id", id, + "identifier", identifier, + "identifierType", identifierType, + "instanceId", instanceId, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private Optional object = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional identifierType = Optional.empty(); + + private Optional instanceId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(BlocklistIdentifierObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An email address, email domain, phone number or web3 wallet. + * + */ + public Builder identifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = Optional.ofNullable(identifier); + return this; + } + + /** + * An email address, email domain, phone number or web3 wallet. + * + */ + public Builder identifier(Optional identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public Builder identifierType(BlocklistIdentifierIdentifierType identifierType) { + Utils.checkNotNull(identifierType, "identifierType"); + this.identifierType = Optional.ofNullable(identifierType); + return this; + } + + public Builder identifierType(Optional identifierType) { + Utils.checkNotNull(identifierType, "identifierType"); + this.identifierType = identifierType; + return this; + } + + public Builder instanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + public Builder instanceId(Optional instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public BlocklistIdentifier build() { + return new BlocklistIdentifier( + object, + id, + identifier, + identifierType, + instanceId, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifierIdentifierType.java b/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifierIdentifierType.java new file mode 100644 index 0000000..85d6ccf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifierIdentifierType.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum BlocklistIdentifierIdentifierType { + EMAIL_ADDRESS("email_address"), + PHONE_NUMBER("phone_number"), + WEB3_WALLET("web3_wallet"); + + @JsonValue + private final String value; + + private BlocklistIdentifierIdentifierType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifierObject.java b/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifierObject.java new file mode 100644 index 0000000..3f8b20e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifierObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * BlocklistIdentifierObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum BlocklistIdentifierObject { + BLOCKLIST_IDENTIFIER("blocklist_identifier"); + + @JsonValue + private final String value; + + private BlocklistIdentifierObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifiers.java b/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifiers.java new file mode 100644 index 0000000..2fc1202 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/BlocklistIdentifiers.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class BlocklistIdentifiers { + + @JsonProperty("data") + private java.util.List data; + + /** + * Total number of blocklist identifiers + * + */ + @JsonProperty("total_count") + private long totalCount; + + @JsonCreator + public BlocklistIdentifiers( + @JsonProperty("data") java.util.List data, + @JsonProperty("total_count") long totalCount) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(totalCount, "totalCount"); + this.data = data; + this.totalCount = totalCount; + } + + @JsonIgnore + public java.util.List data() { + return data; + } + + /** + * Total number of blocklist identifiers + * + */ + @JsonIgnore + public long totalCount() { + return totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + public BlocklistIdentifiers withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of blocklist identifiers + * + */ + public BlocklistIdentifiers withTotalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BlocklistIdentifiers other = (BlocklistIdentifiers) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(BlocklistIdentifiers.class, + "data", data, + "totalCount", totalCount); + } + + public final static class Builder { + + private java.util.List data; + + private Long totalCount; + + private Builder() { + // force use of static builder() method + } + + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of blocklist identifiers + * + */ + public Builder totalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public BlocklistIdentifiers build() { + return new BlocklistIdentifiers( + data, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/CNameTarget.java b/src/main/java/com/clerk/backend_api/models/components/CNameTarget.java new file mode 100644 index 0000000..e64c519 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/CNameTarget.java @@ -0,0 +1,164 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class CNameTarget { + + @JsonProperty("host") + private String host; + + @JsonProperty("value") + private String value; + + /** + * Denotes whether this CNAME target is required to be set in order for the domain to be considered deployed. + * + */ + @JsonProperty("required") + private boolean required; + + @JsonCreator + public CNameTarget( + @JsonProperty("host") String host, + @JsonProperty("value") String value, + @JsonProperty("required") boolean required) { + Utils.checkNotNull(host, "host"); + Utils.checkNotNull(value, "value"); + Utils.checkNotNull(required, "required"); + this.host = host; + this.value = value; + this.required = required; + } + + @JsonIgnore + public String host() { + return host; + } + + @JsonIgnore + public String value() { + return value; + } + + /** + * Denotes whether this CNAME target is required to be set in order for the domain to be considered deployed. + * + */ + @JsonIgnore + public boolean required() { + return required; + } + + public final static Builder builder() { + return new Builder(); + } + + public CNameTarget withHost(String host) { + Utils.checkNotNull(host, "host"); + this.host = host; + return this; + } + + public CNameTarget withValue(String value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + /** + * Denotes whether this CNAME target is required to be set in order for the domain to be considered deployed. + * + */ + public CNameTarget withRequired(boolean required) { + Utils.checkNotNull(required, "required"); + this.required = required; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CNameTarget other = (CNameTarget) o; + return + java.util.Objects.deepEquals(this.host, other.host) && + java.util.Objects.deepEquals(this.value, other.value) && + java.util.Objects.deepEquals(this.required, other.required); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + host, + value, + required); + } + + @Override + public String toString() { + return Utils.toString(CNameTarget.class, + "host", host, + "value", value, + "required", required); + } + + public final static class Builder { + + private String host; + + private String value; + + private Boolean required; + + private Builder() { + // force use of static builder() method + } + + public Builder host(String host) { + Utils.checkNotNull(host, "host"); + this.host = host; + return this; + } + + public Builder value(String value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + /** + * Denotes whether this CNAME target is required to be set in order for the domain to be considered deployed. + * + */ + public Builder required(boolean required) { + Utils.checkNotNull(required, "required"); + this.required = required; + return this; + } + + public CNameTarget build() { + return new CNameTarget( + host, + value, + required); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Claims.java b/src/main/java/com/clerk/backend_api/models/components/Claims.java new file mode 100644 index 0000000..deee745 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Claims.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Claims { + + @JsonCreator + public Claims() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(Claims.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public Claims build() { + return new Claims( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ClerkError.java b/src/main/java/com/clerk/backend_api/models/components/ClerkError.java new file mode 100644 index 0000000..9a6b26b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ClerkError.java @@ -0,0 +1,244 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ClerkError { + + @JsonProperty("message") + private String message; + + @JsonProperty("long_message") + private String longMessage; + + @JsonProperty("code") + private String code; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("meta") + private Optional meta; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("clerk_trace_id") + private Optional clerkTraceId; + + @JsonCreator + public ClerkError( + @JsonProperty("message") String message, + @JsonProperty("long_message") String longMessage, + @JsonProperty("code") String code, + @JsonProperty("meta") Optional meta, + @JsonProperty("clerk_trace_id") Optional clerkTraceId) { + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(longMessage, "longMessage"); + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(meta, "meta"); + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.message = message; + this.longMessage = longMessage; + this.code = code; + this.meta = meta; + this.clerkTraceId = clerkTraceId; + } + + public ClerkError( + String message, + String longMessage, + String code) { + this(message, longMessage, code, Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public String message() { + return message; + } + + @JsonIgnore + public String longMessage() { + return longMessage; + } + + @JsonIgnore + public String code() { + return code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional meta() { + return (Optional) meta; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clerkTraceId() { + return (Optional) clerkTraceId; + } + + public final static Builder builder() { + return new Builder(); + } + + public ClerkError withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public ClerkError withLongMessage(String longMessage) { + Utils.checkNotNull(longMessage, "longMessage"); + this.longMessage = longMessage; + return this; + } + + public ClerkError withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public ClerkError withMeta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + public ClerkError withMeta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + public ClerkError withClerkTraceId(String clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = Optional.ofNullable(clerkTraceId); + return this; + } + + public ClerkError withClerkTraceId(Optional clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = clerkTraceId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClerkError other = (ClerkError) o; + return + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.longMessage, other.longMessage) && + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.meta, other.meta) && + java.util.Objects.deepEquals(this.clerkTraceId, other.clerkTraceId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + message, + longMessage, + code, + meta, + clerkTraceId); + } + + @Override + public String toString() { + return Utils.toString(ClerkError.class, + "message", message, + "longMessage", longMessage, + "code", code, + "meta", meta, + "clerkTraceId", clerkTraceId); + } + + public final static class Builder { + + private String message; + + private String longMessage; + + private String code; + + private Optional meta = Optional.empty(); + + private Optional clerkTraceId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder longMessage(String longMessage) { + Utils.checkNotNull(longMessage, "longMessage"); + this.longMessage = longMessage; + return this; + } + + public Builder code(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder meta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + public Builder meta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + public Builder clerkTraceId(String clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = Optional.ofNullable(clerkTraceId); + return this; + } + + public Builder clerkTraceId(Optional clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = clerkTraceId; + return this; + } + + public ClerkError build() { + return new ClerkError( + message, + longMessage, + code, + meta, + clerkTraceId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ClerkErrorErrorMeta.java b/src/main/java/com/clerk/backend_api/models/components/ClerkErrorErrorMeta.java new file mode 100644 index 0000000..5853331 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ClerkErrorErrorMeta.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class ClerkErrorErrorMeta { + + @JsonCreator + public ClerkErrorErrorMeta() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(ClerkErrorErrorMeta.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public ClerkErrorErrorMeta build() { + return new ClerkErrorErrorMeta( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Client.java b/src/main/java/com/clerk/backend_api/models/components/Client.java new file mode 100644 index 0000000..cdf7759 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Client.java @@ -0,0 +1,465 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class Client { + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonProperty("object") + private Object object; + + /** + * String representing the identifier of the session. + * + */ + @JsonProperty("id") + private String id; + + @JsonProperty("session_ids") + private java.util.List sessionIds; + + @JsonProperty("sessions") + private java.util.List sessions; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("sign_in_id") + private Optional signInId; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("sign_up_id") + private Optional signUpId; + + /** + * Last active session_id. + * + */ + @JsonInclude(Include.ALWAYS) + @JsonProperty("last_active_session_id") + private Optional lastActiveSessionId; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + @JsonCreator + public Client( + @JsonProperty("object") Object object, + @JsonProperty("id") String id, + @JsonProperty("session_ids") java.util.List sessionIds, + @JsonProperty("sessions") java.util.List sessions, + @JsonProperty("sign_in_id") Optional signInId, + @JsonProperty("sign_up_id") Optional signUpId, + @JsonProperty("last_active_session_id") Optional lastActiveSessionId, + @JsonProperty("updated_at") long updatedAt, + @JsonProperty("created_at") long createdAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(sessionIds, "sessionIds"); + Utils.checkNotNull(sessions, "sessions"); + Utils.checkNotNull(signInId, "signInId"); + Utils.checkNotNull(signUpId, "signUpId"); + Utils.checkNotNull(lastActiveSessionId, "lastActiveSessionId"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(createdAt, "createdAt"); + this.object = object; + this.id = id; + this.sessionIds = sessionIds; + this.sessions = sessions; + this.signInId = signInId; + this.signUpId = signUpId; + this.lastActiveSessionId = lastActiveSessionId; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + } + + public Client( + Object object, + String id, + java.util.List sessionIds, + java.util.List sessions, + long updatedAt, + long createdAt) { + this(object, id, sessionIds, sessions, Optional.empty(), Optional.empty(), Optional.empty(), updatedAt, createdAt); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonIgnore + public Object object() { + return object; + } + + /** + * String representing the identifier of the session. + * + */ + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public java.util.List sessionIds() { + return sessionIds; + } + + @JsonIgnore + public java.util.List sessions() { + return sessions; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional signInId() { + return (Optional) signInId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional signUpId() { + return (Optional) signUpId; + } + + /** + * Last active session_id. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastActiveSessionId() { + return (Optional) lastActiveSessionId; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Client withObject(Object object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + /** + * String representing the identifier of the session. + * + */ + public Client withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Client withSessionIds(java.util.List sessionIds) { + Utils.checkNotNull(sessionIds, "sessionIds"); + this.sessionIds = sessionIds; + return this; + } + + public Client withSessions(java.util.List sessions) { + Utils.checkNotNull(sessions, "sessions"); + this.sessions = sessions; + return this; + } + + public Client withSignInId(String signInId) { + Utils.checkNotNull(signInId, "signInId"); + this.signInId = Optional.ofNullable(signInId); + return this; + } + + public Client withSignInId(Optional signInId) { + Utils.checkNotNull(signInId, "signInId"); + this.signInId = signInId; + return this; + } + + public Client withSignUpId(String signUpId) { + Utils.checkNotNull(signUpId, "signUpId"); + this.signUpId = Optional.ofNullable(signUpId); + return this; + } + + public Client withSignUpId(Optional signUpId) { + Utils.checkNotNull(signUpId, "signUpId"); + this.signUpId = signUpId; + return this; + } + + /** + * Last active session_id. + * + */ + public Client withLastActiveSessionId(String lastActiveSessionId) { + Utils.checkNotNull(lastActiveSessionId, "lastActiveSessionId"); + this.lastActiveSessionId = Optional.ofNullable(lastActiveSessionId); + return this; + } + + /** + * Last active session_id. + * + */ + public Client withLastActiveSessionId(Optional lastActiveSessionId) { + Utils.checkNotNull(lastActiveSessionId, "lastActiveSessionId"); + this.lastActiveSessionId = lastActiveSessionId; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Client withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Client withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client other = (Client) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.sessionIds, other.sessionIds) && + java.util.Objects.deepEquals(this.sessions, other.sessions) && + java.util.Objects.deepEquals(this.signInId, other.signInId) && + java.util.Objects.deepEquals(this.signUpId, other.signUpId) && + java.util.Objects.deepEquals(this.lastActiveSessionId, other.lastActiveSessionId) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + sessionIds, + sessions, + signInId, + signUpId, + lastActiveSessionId, + updatedAt, + createdAt); + } + + @Override + public String toString() { + return Utils.toString(Client.class, + "object", object, + "id", id, + "sessionIds", sessionIds, + "sessions", sessions, + "signInId", signInId, + "signUpId", signUpId, + "lastActiveSessionId", lastActiveSessionId, + "updatedAt", updatedAt, + "createdAt", createdAt); + } + + public final static class Builder { + + private Object object; + + private String id; + + private java.util.List sessionIds; + + private java.util.List sessions; + + private Optional signInId = Optional.empty(); + + private Optional signUpId = Optional.empty(); + + private Optional lastActiveSessionId = Optional.empty(); + + private Long updatedAt; + + private Long createdAt; + + private Builder() { + // force use of static builder() method + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(Object object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + /** + * String representing the identifier of the session. + * + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder sessionIds(java.util.List sessionIds) { + Utils.checkNotNull(sessionIds, "sessionIds"); + this.sessionIds = sessionIds; + return this; + } + + public Builder sessions(java.util.List sessions) { + Utils.checkNotNull(sessions, "sessions"); + this.sessions = sessions; + return this; + } + + public Builder signInId(String signInId) { + Utils.checkNotNull(signInId, "signInId"); + this.signInId = Optional.ofNullable(signInId); + return this; + } + + public Builder signInId(Optional signInId) { + Utils.checkNotNull(signInId, "signInId"); + this.signInId = signInId; + return this; + } + + public Builder signUpId(String signUpId) { + Utils.checkNotNull(signUpId, "signUpId"); + this.signUpId = Optional.ofNullable(signUpId); + return this; + } + + public Builder signUpId(Optional signUpId) { + Utils.checkNotNull(signUpId, "signUpId"); + this.signUpId = signUpId; + return this; + } + + /** + * Last active session_id. + * + */ + public Builder lastActiveSessionId(String lastActiveSessionId) { + Utils.checkNotNull(lastActiveSessionId, "lastActiveSessionId"); + this.lastActiveSessionId = Optional.ofNullable(lastActiveSessionId); + return this; + } + + /** + * Last active session_id. + * + */ + public Builder lastActiveSessionId(Optional lastActiveSessionId) { + Utils.checkNotNull(lastActiveSessionId, "lastActiveSessionId"); + this.lastActiveSessionId = lastActiveSessionId; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public Client build() { + return new Client( + object, + id, + sessionIds, + sessions, + signInId, + signUpId, + lastActiveSessionId, + updatedAt, + createdAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/DeletedObject.java b/src/main/java/com/clerk/backend_api/models/components/DeletedObject.java new file mode 100644 index 0000000..58fa8c6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/DeletedObject.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class DeletedObject { + + @JsonProperty("object") + private String object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("slug") + private Optional slug; + + @JsonProperty("deleted") + private boolean deleted; + + @JsonCreator + public DeletedObject( + @JsonProperty("object") String object, + @JsonProperty("id") Optional id, + @JsonProperty("slug") Optional slug, + @JsonProperty("deleted") boolean deleted) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(deleted, "deleted"); + this.object = object; + this.id = id; + this.slug = slug; + this.deleted = deleted; + } + + public DeletedObject( + String object, + boolean deleted) { + this(object, Optional.empty(), Optional.empty(), deleted); + } + + @JsonIgnore + public String object() { + return object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional slug() { + return (Optional) slug; + } + + @JsonIgnore + public boolean deleted() { + return deleted; + } + + public final static Builder builder() { + return new Builder(); + } + + public DeletedObject withObject(String object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public DeletedObject withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public DeletedObject withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public DeletedObject withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + public DeletedObject withSlug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public DeletedObject withDeleted(boolean deleted) { + Utils.checkNotNull(deleted, "deleted"); + this.deleted = deleted; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedObject other = (DeletedObject) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.deleted, other.deleted); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + slug, + deleted); + } + + @Override + public String toString() { + return Utils.toString(DeletedObject.class, + "object", object, + "id", id, + "slug", slug, + "deleted", deleted); + } + + public final static class Builder { + + private String object; + + private Optional id = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Boolean deleted; + + private Builder() { + // force use of static builder() method + } + + public Builder object(String object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + public Builder slug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder deleted(boolean deleted) { + Utils.checkNotNull(deleted, "deleted"); + this.deleted = deleted; + return this; + } + + public DeletedObject build() { + return new DeletedObject( + object, + id, + slug, + deleted); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Domain.java b/src/main/java/com/clerk/backend_api/models/components/Domain.java new file mode 100644 index 0000000..5ca87ce --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Domain.java @@ -0,0 +1,401 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Domain { + + @JsonProperty("object") + private DomainObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("is_satellite") + private boolean isSatellite; + + @JsonProperty("frontend_api_url") + private String frontendApiUrl; + + /** + * Null for satellite domains. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accounts_portal_url") + private JsonNullable accountsPortalUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("proxy_url") + private JsonNullable proxyUrl; + + @JsonProperty("development_origin") + private String developmentOrigin; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("cname_targets") + private JsonNullable> cnameTargets; + + @JsonCreator + public Domain( + @JsonProperty("object") DomainObject object, + @JsonProperty("id") String id, + @JsonProperty("name") String name, + @JsonProperty("is_satellite") boolean isSatellite, + @JsonProperty("frontend_api_url") String frontendApiUrl, + @JsonProperty("accounts_portal_url") JsonNullable accountsPortalUrl, + @JsonProperty("proxy_url") JsonNullable proxyUrl, + @JsonProperty("development_origin") String developmentOrigin, + @JsonProperty("cname_targets") JsonNullable> cnameTargets) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(isSatellite, "isSatellite"); + Utils.checkNotNull(frontendApiUrl, "frontendApiUrl"); + Utils.checkNotNull(accountsPortalUrl, "accountsPortalUrl"); + Utils.checkNotNull(proxyUrl, "proxyUrl"); + Utils.checkNotNull(developmentOrigin, "developmentOrigin"); + Utils.checkNotNull(cnameTargets, "cnameTargets"); + this.object = object; + this.id = id; + this.name = name; + this.isSatellite = isSatellite; + this.frontendApiUrl = frontendApiUrl; + this.accountsPortalUrl = accountsPortalUrl; + this.proxyUrl = proxyUrl; + this.developmentOrigin = developmentOrigin; + this.cnameTargets = cnameTargets; + } + + public Domain( + DomainObject object, + String id, + String name, + boolean isSatellite, + String frontendApiUrl, + String developmentOrigin) { + this(object, id, name, isSatellite, frontendApiUrl, JsonNullable.undefined(), JsonNullable.undefined(), developmentOrigin, JsonNullable.undefined()); + } + + @JsonIgnore + public DomainObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public boolean isSatellite() { + return isSatellite; + } + + @JsonIgnore + public String frontendApiUrl() { + return frontendApiUrl; + } + + /** + * Null for satellite domains. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable accountsPortalUrl() { + return (JsonNullable) accountsPortalUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable proxyUrl() { + return (JsonNullable) proxyUrl; + } + + @JsonIgnore + public String developmentOrigin() { + return developmentOrigin; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> cnameTargets() { + return (JsonNullable>) cnameTargets; + } + + public final static Builder builder() { + return new Builder(); + } + + public Domain withObject(DomainObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Domain withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Domain withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Domain withIsSatellite(boolean isSatellite) { + Utils.checkNotNull(isSatellite, "isSatellite"); + this.isSatellite = isSatellite; + return this; + } + + public Domain withFrontendApiUrl(String frontendApiUrl) { + Utils.checkNotNull(frontendApiUrl, "frontendApiUrl"); + this.frontendApiUrl = frontendApiUrl; + return this; + } + + /** + * Null for satellite domains. + * + */ + public Domain withAccountsPortalUrl(String accountsPortalUrl) { + Utils.checkNotNull(accountsPortalUrl, "accountsPortalUrl"); + this.accountsPortalUrl = JsonNullable.of(accountsPortalUrl); + return this; + } + + /** + * Null for satellite domains. + * + */ + public Domain withAccountsPortalUrl(JsonNullable accountsPortalUrl) { + Utils.checkNotNull(accountsPortalUrl, "accountsPortalUrl"); + this.accountsPortalUrl = accountsPortalUrl; + return this; + } + + public Domain withProxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = JsonNullable.of(proxyUrl); + return this; + } + + public Domain withProxyUrl(JsonNullable proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + public Domain withDevelopmentOrigin(String developmentOrigin) { + Utils.checkNotNull(developmentOrigin, "developmentOrigin"); + this.developmentOrigin = developmentOrigin; + return this; + } + + public Domain withCnameTargets(java.util.List cnameTargets) { + Utils.checkNotNull(cnameTargets, "cnameTargets"); + this.cnameTargets = JsonNullable.of(cnameTargets); + return this; + } + + public Domain withCnameTargets(JsonNullable> cnameTargets) { + Utils.checkNotNull(cnameTargets, "cnameTargets"); + this.cnameTargets = cnameTargets; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Domain other = (Domain) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.isSatellite, other.isSatellite) && + java.util.Objects.deepEquals(this.frontendApiUrl, other.frontendApiUrl) && + java.util.Objects.deepEquals(this.accountsPortalUrl, other.accountsPortalUrl) && + java.util.Objects.deepEquals(this.proxyUrl, other.proxyUrl) && + java.util.Objects.deepEquals(this.developmentOrigin, other.developmentOrigin) && + java.util.Objects.deepEquals(this.cnameTargets, other.cnameTargets); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + name, + isSatellite, + frontendApiUrl, + accountsPortalUrl, + proxyUrl, + developmentOrigin, + cnameTargets); + } + + @Override + public String toString() { + return Utils.toString(Domain.class, + "object", object, + "id", id, + "name", name, + "isSatellite", isSatellite, + "frontendApiUrl", frontendApiUrl, + "accountsPortalUrl", accountsPortalUrl, + "proxyUrl", proxyUrl, + "developmentOrigin", developmentOrigin, + "cnameTargets", cnameTargets); + } + + public final static class Builder { + + private DomainObject object; + + private String id; + + private String name; + + private Boolean isSatellite; + + private String frontendApiUrl; + + private JsonNullable accountsPortalUrl = JsonNullable.undefined(); + + private JsonNullable proxyUrl = JsonNullable.undefined(); + + private String developmentOrigin; + + private JsonNullable> cnameTargets = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder object(DomainObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder isSatellite(boolean isSatellite) { + Utils.checkNotNull(isSatellite, "isSatellite"); + this.isSatellite = isSatellite; + return this; + } + + public Builder frontendApiUrl(String frontendApiUrl) { + Utils.checkNotNull(frontendApiUrl, "frontendApiUrl"); + this.frontendApiUrl = frontendApiUrl; + return this; + } + + /** + * Null for satellite domains. + * + */ + public Builder accountsPortalUrl(String accountsPortalUrl) { + Utils.checkNotNull(accountsPortalUrl, "accountsPortalUrl"); + this.accountsPortalUrl = JsonNullable.of(accountsPortalUrl); + return this; + } + + /** + * Null for satellite domains. + * + */ + public Builder accountsPortalUrl(JsonNullable accountsPortalUrl) { + Utils.checkNotNull(accountsPortalUrl, "accountsPortalUrl"); + this.accountsPortalUrl = accountsPortalUrl; + return this; + } + + public Builder proxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = JsonNullable.of(proxyUrl); + return this; + } + + public Builder proxyUrl(JsonNullable proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + public Builder developmentOrigin(String developmentOrigin) { + Utils.checkNotNull(developmentOrigin, "developmentOrigin"); + this.developmentOrigin = developmentOrigin; + return this; + } + + public Builder cnameTargets(java.util.List cnameTargets) { + Utils.checkNotNull(cnameTargets, "cnameTargets"); + this.cnameTargets = JsonNullable.of(cnameTargets); + return this; + } + + public Builder cnameTargets(JsonNullable> cnameTargets) { + Utils.checkNotNull(cnameTargets, "cnameTargets"); + this.cnameTargets = cnameTargets; + return this; + } + + public Domain build() { + return new Domain( + object, + id, + name, + isSatellite, + frontendApiUrl, + accountsPortalUrl, + proxyUrl, + developmentOrigin, + cnameTargets); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/DomainObject.java b/src/main/java/com/clerk/backend_api/models/components/DomainObject.java new file mode 100644 index 0000000..13aed23 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/DomainObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum DomainObject { + DOMAIN("domain"); + + @JsonValue + private final String value; + + private DomainObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Domains.java b/src/main/java/com/clerk/backend_api/models/components/Domains.java new file mode 100644 index 0000000..4790cd7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Domains.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Domains { + + @JsonProperty("data") + private java.util.List data; + + /** + * Total number of domains + * + */ + @JsonProperty("total_count") + private long totalCount; + + @JsonCreator + public Domains( + @JsonProperty("data") java.util.List data, + @JsonProperty("total_count") long totalCount) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(totalCount, "totalCount"); + this.data = data; + this.totalCount = totalCount; + } + + @JsonIgnore + public java.util.List data() { + return data; + } + + /** + * Total number of domains + * + */ + @JsonIgnore + public long totalCount() { + return totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + public Domains withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of domains + * + */ + public Domains withTotalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Domains other = (Domains) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(Domains.class, + "data", data, + "totalCount", totalCount); + } + + public final static class Builder { + + private java.util.List data; + + private Long totalCount; + + private Builder() { + // force use of static builder() method + } + + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of domains + * + */ + public Builder totalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public Domains build() { + return new Domains( + data, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/DomainsEnrollmentModes.java b/src/main/java/com/clerk/backend_api/models/components/DomainsEnrollmentModes.java new file mode 100644 index 0000000..0c8791c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/DomainsEnrollmentModes.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum DomainsEnrollmentModes { + MANUAL_INVITATION("manual_invitation"), + AUTOMATIC_INVITATION("automatic_invitation"), + AUTOMATIC_SUGGESTION("automatic_suggestion"); + + @JsonValue + private final String value; + + private DomainsEnrollmentModes(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/EmailAddress.java b/src/main/java/com/clerk/backend_api/models/components/EmailAddress.java new file mode 100644 index 0000000..c240a8e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/EmailAddress.java @@ -0,0 +1,382 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class EmailAddress { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonProperty("object") + private EmailAddressObject object; + + @JsonProperty("email_address") + private String emailAddress; + + @JsonProperty("reserved") + private boolean reserved; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("verification") + private Optional verification; + + @JsonProperty("linked_to") + private java.util.List linkedTo; + + /** + * Unix timestamp of creation + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of creation + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public EmailAddress( + @JsonProperty("id") Optional id, + @JsonProperty("object") EmailAddressObject object, + @JsonProperty("email_address") String emailAddress, + @JsonProperty("reserved") boolean reserved, + @JsonProperty("verification") Optional verification, + @JsonProperty("linked_to") java.util.List linkedTo, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(reserved, "reserved"); + Utils.checkNotNull(verification, "verification"); + Utils.checkNotNull(linkedTo, "linkedTo"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.id = id; + this.object = object; + this.emailAddress = emailAddress; + this.reserved = reserved; + this.verification = verification; + this.linkedTo = linkedTo; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public EmailAddress( + EmailAddressObject object, + String emailAddress, + boolean reserved, + java.util.List linkedTo, + long createdAt, + long updatedAt) { + this(Optional.empty(), object, emailAddress, reserved, Optional.empty(), linkedTo, createdAt, updatedAt); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonIgnore + public EmailAddressObject object() { + return object; + } + + @JsonIgnore + public String emailAddress() { + return emailAddress; + } + + @JsonIgnore + public boolean reserved() { + return reserved; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional verification() { + return (Optional) verification; + } + + @JsonIgnore + public java.util.List linkedTo() { + return linkedTo; + } + + /** + * Unix timestamp of creation + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of creation + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public EmailAddress withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public EmailAddress withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public EmailAddress withObject(EmailAddressObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public EmailAddress withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public EmailAddress withReserved(boolean reserved) { + Utils.checkNotNull(reserved, "reserved"); + this.reserved = reserved; + return this; + } + + public EmailAddress withVerification(Verification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public EmailAddress withVerification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + public EmailAddress withLinkedTo(java.util.List linkedTo) { + Utils.checkNotNull(linkedTo, "linkedTo"); + this.linkedTo = linkedTo; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public EmailAddress withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public EmailAddress withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailAddress other = (EmailAddress) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.reserved, other.reserved) && + java.util.Objects.deepEquals(this.verification, other.verification) && + java.util.Objects.deepEquals(this.linkedTo, other.linkedTo) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + emailAddress, + reserved, + verification, + linkedTo, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(EmailAddress.class, + "id", id, + "object", object, + "emailAddress", emailAddress, + "reserved", reserved, + "verification", verification, + "linkedTo", linkedTo, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private EmailAddressObject object; + + private String emailAddress; + + private Boolean reserved; + + private Optional verification = Optional.empty(); + + private java.util.List linkedTo; + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(EmailAddressObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder reserved(boolean reserved) { + Utils.checkNotNull(reserved, "reserved"); + this.reserved = reserved; + return this; + } + + public Builder verification(Verification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public Builder verification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + public Builder linkedTo(java.util.List linkedTo) { + Utils.checkNotNull(linkedTo, "linkedTo"); + this.linkedTo = linkedTo; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public EmailAddress build() { + return new EmailAddress( + id, + object, + emailAddress, + reserved, + verification, + linkedTo, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/EmailAddressObject.java b/src/main/java/com/clerk/backend_api/models/components/EmailAddressObject.java new file mode 100644 index 0000000..60e0ef6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/EmailAddressObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * EmailAddressObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum EmailAddressObject { + EMAIL_ADDRESS("email_address"); + + @JsonValue + private final String value; + + private EmailAddressObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Error.java b/src/main/java/com/clerk/backend_api/models/components/Error.java new file mode 100644 index 0000000..0ead36d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Error.java @@ -0,0 +1,93 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.time.OffsetDateTime; +import java.time.LocalDate; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.clerk.backend_api.utils.TypedObject; +import com.clerk.backend_api.utils.Utils.JsonShape; + + +@JsonDeserialize(using = Error._Deserializer.class) +public class Error { + + @com.fasterxml.jackson.annotation.JsonValue + private TypedObject value; + + private Error(TypedObject value) { + this.value = value; + } + + public static Error of(ErrorClerkError value) { + Utils.checkNotNull(value, "value"); + return new Error(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code ErrorClerkError}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error other = (Error) o; + return java.util.Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends com.clerk.backend_api.utils.OneOfDeserializer { + + public _Deserializer() { + super(Error.class, + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(Error.class, + "value", value); + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/components/ErrorClerkError.java b/src/main/java/com/clerk/backend_api/models/components/ErrorClerkError.java new file mode 100644 index 0000000..43d5e28 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ErrorClerkError.java @@ -0,0 +1,244 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ErrorClerkError { + + @JsonProperty("message") + private String message; + + @JsonProperty("long_message") + private String longMessage; + + @JsonProperty("code") + private String code; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("meta") + private Optional meta; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("clerk_trace_id") + private Optional clerkTraceId; + + @JsonCreator + public ErrorClerkError( + @JsonProperty("message") String message, + @JsonProperty("long_message") String longMessage, + @JsonProperty("code") String code, + @JsonProperty("meta") Optional meta, + @JsonProperty("clerk_trace_id") Optional clerkTraceId) { + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(longMessage, "longMessage"); + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(meta, "meta"); + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.message = message; + this.longMessage = longMessage; + this.code = code; + this.meta = meta; + this.clerkTraceId = clerkTraceId; + } + + public ErrorClerkError( + String message, + String longMessage, + String code) { + this(message, longMessage, code, Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public String message() { + return message; + } + + @JsonIgnore + public String longMessage() { + return longMessage; + } + + @JsonIgnore + public String code() { + return code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional meta() { + return (Optional) meta; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clerkTraceId() { + return (Optional) clerkTraceId; + } + + public final static Builder builder() { + return new Builder(); + } + + public ErrorClerkError withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public ErrorClerkError withLongMessage(String longMessage) { + Utils.checkNotNull(longMessage, "longMessage"); + this.longMessage = longMessage; + return this; + } + + public ErrorClerkError withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public ErrorClerkError withMeta(ErrorMeta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + public ErrorClerkError withMeta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + public ErrorClerkError withClerkTraceId(String clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = Optional.ofNullable(clerkTraceId); + return this; + } + + public ErrorClerkError withClerkTraceId(Optional clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = clerkTraceId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorClerkError other = (ErrorClerkError) o; + return + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.longMessage, other.longMessage) && + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.meta, other.meta) && + java.util.Objects.deepEquals(this.clerkTraceId, other.clerkTraceId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + message, + longMessage, + code, + meta, + clerkTraceId); + } + + @Override + public String toString() { + return Utils.toString(ErrorClerkError.class, + "message", message, + "longMessage", longMessage, + "code", code, + "meta", meta, + "clerkTraceId", clerkTraceId); + } + + public final static class Builder { + + private String message; + + private String longMessage; + + private String code; + + private Optional meta = Optional.empty(); + + private Optional clerkTraceId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder longMessage(String longMessage) { + Utils.checkNotNull(longMessage, "longMessage"); + this.longMessage = longMessage; + return this; + } + + public Builder code(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder meta(ErrorMeta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + public Builder meta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + public Builder clerkTraceId(String clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = Optional.ofNullable(clerkTraceId); + return this; + } + + public Builder clerkTraceId(Optional clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = clerkTraceId; + return this; + } + + public ErrorClerkError build() { + return new ErrorClerkError( + message, + longMessage, + code, + meta, + clerkTraceId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ErrorMeta.java b/src/main/java/com/clerk/backend_api/models/components/ErrorMeta.java new file mode 100644 index 0000000..94adba3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ErrorMeta.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class ErrorMeta { + + @JsonCreator + public ErrorMeta() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(ErrorMeta.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public ErrorMeta build() { + return new ErrorMeta( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ExternalAccount.java b/src/main/java/com/clerk/backend_api/models/components/ExternalAccount.java new file mode 100644 index 0000000..707a128 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ExternalAccount.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class ExternalAccount { + + @JsonCreator + public ExternalAccount() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(ExternalAccount.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public ExternalAccount build() { + return new ExternalAccount( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ExternalAccounts.java b/src/main/java/com/clerk/backend_api/models/components/ExternalAccounts.java new file mode 100644 index 0000000..bd460e1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ExternalAccounts.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class ExternalAccounts { + + @JsonCreator + public ExternalAccounts() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(ExternalAccounts.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public ExternalAccounts build() { + return new ExternalAccounts( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/IdentificationLink.java b/src/main/java/com/clerk/backend_api/models/components/IdentificationLink.java new file mode 100644 index 0000000..e006488 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/IdentificationLink.java @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class IdentificationLink { + + @JsonProperty("type") + private Type type; + + @JsonProperty("id") + private String id; + + @JsonCreator + public IdentificationLink( + @JsonProperty("type") Type type, + @JsonProperty("id") String id) { + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(id, "id"); + this.type = type; + this.id = id; + } + + @JsonIgnore + public Type type() { + return type; + } + + @JsonIgnore + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + public IdentificationLink withType(Type type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public IdentificationLink withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentificationLink other = (IdentificationLink) o; + return + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + type, + id); + } + + @Override + public String toString() { + return Utils.toString(IdentificationLink.class, + "type", type, + "id", id); + } + + public final static class Builder { + + private Type type; + + private String id; + + private Builder() { + // force use of static builder() method + } + + public Builder type(Type type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public IdentificationLink build() { + return new IdentificationLink( + type, + id); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/IdentifierType.java b/src/main/java/com/clerk/backend_api/models/components/IdentifierType.java new file mode 100644 index 0000000..ed4977c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/IdentifierType.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum IdentifierType { + EMAIL_ADDRESS("email_address"), + PHONE_NUMBER("phone_number"), + WEB3_WALLET("web3_wallet"); + + @JsonValue + private final String value; + + private IdentifierType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/InstanceRestrictions.java b/src/main/java/com/clerk/backend_api/models/components/InstanceRestrictions.java new file mode 100644 index 0000000..8a71422 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InstanceRestrictions.java @@ -0,0 +1,301 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class InstanceRestrictions { + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allowlist") + private Optional allowlist; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("blocklist") + private Optional blocklist; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("block_email_subaddresses") + private Optional blockEmailSubaddresses; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ignore_dots_for_gmail_addresses") + private Optional ignoreDotsForGmailAddresses; + + @JsonCreator + public InstanceRestrictions( + @JsonProperty("object") Optional object, + @JsonProperty("allowlist") Optional allowlist, + @JsonProperty("blocklist") Optional blocklist, + @JsonProperty("block_email_subaddresses") Optional blockEmailSubaddresses, + @JsonProperty("ignore_dots_for_gmail_addresses") Optional ignoreDotsForGmailAddresses) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(allowlist, "allowlist"); + Utils.checkNotNull(blocklist, "blocklist"); + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.object = object; + this.allowlist = allowlist; + this.blocklist = blocklist; + this.blockEmailSubaddresses = blockEmailSubaddresses; + this.ignoreDotsForGmailAddresses = ignoreDotsForGmailAddresses; + } + + public InstanceRestrictions() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowlist() { + return (Optional) allowlist; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional blocklist() { + return (Optional) blocklist; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional blockEmailSubaddresses() { + return (Optional) blockEmailSubaddresses; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional ignoreDotsForGmailAddresses() { + return (Optional) ignoreDotsForGmailAddresses; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public InstanceRestrictions withObject(InstanceRestrictionsObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public InstanceRestrictions withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public InstanceRestrictions withAllowlist(boolean allowlist) { + Utils.checkNotNull(allowlist, "allowlist"); + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + public InstanceRestrictions withAllowlist(Optional allowlist) { + Utils.checkNotNull(allowlist, "allowlist"); + this.allowlist = allowlist; + return this; + } + + public InstanceRestrictions withBlocklist(boolean blocklist) { + Utils.checkNotNull(blocklist, "blocklist"); + this.blocklist = Optional.ofNullable(blocklist); + return this; + } + + public InstanceRestrictions withBlocklist(Optional blocklist) { + Utils.checkNotNull(blocklist, "blocklist"); + this.blocklist = blocklist; + return this; + } + + public InstanceRestrictions withBlockEmailSubaddresses(boolean blockEmailSubaddresses) { + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + this.blockEmailSubaddresses = Optional.ofNullable(blockEmailSubaddresses); + return this; + } + + public InstanceRestrictions withBlockEmailSubaddresses(Optional blockEmailSubaddresses) { + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + this.blockEmailSubaddresses = blockEmailSubaddresses; + return this; + } + + public InstanceRestrictions withIgnoreDotsForGmailAddresses(boolean ignoreDotsForGmailAddresses) { + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.ignoreDotsForGmailAddresses = Optional.ofNullable(ignoreDotsForGmailAddresses); + return this; + } + + public InstanceRestrictions withIgnoreDotsForGmailAddresses(Optional ignoreDotsForGmailAddresses) { + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.ignoreDotsForGmailAddresses = ignoreDotsForGmailAddresses; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InstanceRestrictions other = (InstanceRestrictions) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.allowlist, other.allowlist) && + java.util.Objects.deepEquals(this.blocklist, other.blocklist) && + java.util.Objects.deepEquals(this.blockEmailSubaddresses, other.blockEmailSubaddresses) && + java.util.Objects.deepEquals(this.ignoreDotsForGmailAddresses, other.ignoreDotsForGmailAddresses); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + allowlist, + blocklist, + blockEmailSubaddresses, + ignoreDotsForGmailAddresses); + } + + @Override + public String toString() { + return Utils.toString(InstanceRestrictions.class, + "object", object, + "allowlist", allowlist, + "blocklist", blocklist, + "blockEmailSubaddresses", blockEmailSubaddresses, + "ignoreDotsForGmailAddresses", ignoreDotsForGmailAddresses); + } + + public final static class Builder { + + private Optional object = Optional.empty(); + + private Optional allowlist = Optional.empty(); + + private Optional blocklist = Optional.empty(); + + private Optional blockEmailSubaddresses = Optional.empty(); + + private Optional ignoreDotsForGmailAddresses = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public Builder object(InstanceRestrictionsObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder allowlist(boolean allowlist) { + Utils.checkNotNull(allowlist, "allowlist"); + this.allowlist = Optional.ofNullable(allowlist); + return this; + } + + public Builder allowlist(Optional allowlist) { + Utils.checkNotNull(allowlist, "allowlist"); + this.allowlist = allowlist; + return this; + } + + public Builder blocklist(boolean blocklist) { + Utils.checkNotNull(blocklist, "blocklist"); + this.blocklist = Optional.ofNullable(blocklist); + return this; + } + + public Builder blocklist(Optional blocklist) { + Utils.checkNotNull(blocklist, "blocklist"); + this.blocklist = blocklist; + return this; + } + + public Builder blockEmailSubaddresses(boolean blockEmailSubaddresses) { + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + this.blockEmailSubaddresses = Optional.ofNullable(blockEmailSubaddresses); + return this; + } + + public Builder blockEmailSubaddresses(Optional blockEmailSubaddresses) { + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + this.blockEmailSubaddresses = blockEmailSubaddresses; + return this; + } + + public Builder ignoreDotsForGmailAddresses(boolean ignoreDotsForGmailAddresses) { + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.ignoreDotsForGmailAddresses = Optional.ofNullable(ignoreDotsForGmailAddresses); + return this; + } + + public Builder ignoreDotsForGmailAddresses(Optional ignoreDotsForGmailAddresses) { + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.ignoreDotsForGmailAddresses = ignoreDotsForGmailAddresses; + return this; + } + + public InstanceRestrictions build() { + return new InstanceRestrictions( + object, + allowlist, + blocklist, + blockEmailSubaddresses, + ignoreDotsForGmailAddresses); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/InstanceRestrictionsObject.java b/src/main/java/com/clerk/backend_api/models/components/InstanceRestrictionsObject.java new file mode 100644 index 0000000..79e17f7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InstanceRestrictionsObject.java @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * InstanceRestrictionsObject - String representing the object's type. Objects of the same type share the same value. + */ +public enum InstanceRestrictionsObject { + INSTANCE_RESTRICTIONS("instance_restrictions"); + + @JsonValue + private final String value; + + private InstanceRestrictionsObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/InstanceSettings.java b/src/main/java/com/clerk/backend_api/models/components/InstanceSettings.java new file mode 100644 index 0000000..d4fec72 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InstanceSettings.java @@ -0,0 +1,344 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class InstanceSettings { + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("restricted_to_allowlist") + private Optional restrictedToAllowlist; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("from_email_address") + private Optional fromEmailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("progressive_sign_up") + private Optional progressiveSignUp; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("enhanced_email_deliverability") + private Optional enhancedEmailDeliverability; + + @JsonCreator + public InstanceSettings( + @JsonProperty("object") Optional object, + @JsonProperty("id") Optional id, + @JsonProperty("restricted_to_allowlist") Optional restrictedToAllowlist, + @JsonProperty("from_email_address") Optional fromEmailAddress, + @JsonProperty("progressive_sign_up") Optional progressiveSignUp, + @JsonProperty("enhanced_email_deliverability") Optional enhancedEmailDeliverability) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.object = object; + this.id = id; + this.restrictedToAllowlist = restrictedToAllowlist; + this.fromEmailAddress = fromEmailAddress; + this.progressiveSignUp = progressiveSignUp; + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + } + + public InstanceSettings() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional restrictedToAllowlist() { + return (Optional) restrictedToAllowlist; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional fromEmailAddress() { + return (Optional) fromEmailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional progressiveSignUp() { + return (Optional) progressiveSignUp; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional enhancedEmailDeliverability() { + return (Optional) enhancedEmailDeliverability; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public InstanceSettings withObject(InstanceSettingsObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public InstanceSettings withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public InstanceSettings withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public InstanceSettings withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public InstanceSettings withRestrictedToAllowlist(boolean restrictedToAllowlist) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + this.restrictedToAllowlist = Optional.ofNullable(restrictedToAllowlist); + return this; + } + + public InstanceSettings withRestrictedToAllowlist(Optional restrictedToAllowlist) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + this.restrictedToAllowlist = restrictedToAllowlist; + return this; + } + + public InstanceSettings withFromEmailAddress(String fromEmailAddress) { + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + this.fromEmailAddress = Optional.ofNullable(fromEmailAddress); + return this; + } + + public InstanceSettings withFromEmailAddress(Optional fromEmailAddress) { + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + this.fromEmailAddress = fromEmailAddress; + return this; + } + + public InstanceSettings withProgressiveSignUp(boolean progressiveSignUp) { + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + this.progressiveSignUp = Optional.ofNullable(progressiveSignUp); + return this; + } + + public InstanceSettings withProgressiveSignUp(Optional progressiveSignUp) { + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + this.progressiveSignUp = progressiveSignUp; + return this; + } + + public InstanceSettings withEnhancedEmailDeliverability(boolean enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = Optional.ofNullable(enhancedEmailDeliverability); + return this; + } + + public InstanceSettings withEnhancedEmailDeliverability(Optional enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InstanceSettings other = (InstanceSettings) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.restrictedToAllowlist, other.restrictedToAllowlist) && + java.util.Objects.deepEquals(this.fromEmailAddress, other.fromEmailAddress) && + java.util.Objects.deepEquals(this.progressiveSignUp, other.progressiveSignUp) && + java.util.Objects.deepEquals(this.enhancedEmailDeliverability, other.enhancedEmailDeliverability); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + restrictedToAllowlist, + fromEmailAddress, + progressiveSignUp, + enhancedEmailDeliverability); + } + + @Override + public String toString() { + return Utils.toString(InstanceSettings.class, + "object", object, + "id", id, + "restrictedToAllowlist", restrictedToAllowlist, + "fromEmailAddress", fromEmailAddress, + "progressiveSignUp", progressiveSignUp, + "enhancedEmailDeliverability", enhancedEmailDeliverability); + } + + public final static class Builder { + + private Optional object = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional restrictedToAllowlist = Optional.empty(); + + private Optional fromEmailAddress = Optional.empty(); + + private Optional progressiveSignUp = Optional.empty(); + + private Optional enhancedEmailDeliverability = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public Builder object(InstanceSettingsObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder restrictedToAllowlist(boolean restrictedToAllowlist) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + this.restrictedToAllowlist = Optional.ofNullable(restrictedToAllowlist); + return this; + } + + public Builder restrictedToAllowlist(Optional restrictedToAllowlist) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + this.restrictedToAllowlist = restrictedToAllowlist; + return this; + } + + public Builder fromEmailAddress(String fromEmailAddress) { + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + this.fromEmailAddress = Optional.ofNullable(fromEmailAddress); + return this; + } + + public Builder fromEmailAddress(Optional fromEmailAddress) { + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + this.fromEmailAddress = fromEmailAddress; + return this; + } + + public Builder progressiveSignUp(boolean progressiveSignUp) { + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + this.progressiveSignUp = Optional.ofNullable(progressiveSignUp); + return this; + } + + public Builder progressiveSignUp(Optional progressiveSignUp) { + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + this.progressiveSignUp = progressiveSignUp; + return this; + } + + public Builder enhancedEmailDeliverability(boolean enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = Optional.ofNullable(enhancedEmailDeliverability); + return this; + } + + public Builder enhancedEmailDeliverability(Optional enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + return this; + } + + public InstanceSettings build() { + return new InstanceSettings( + object, + id, + restrictedToAllowlist, + fromEmailAddress, + progressiveSignUp, + enhancedEmailDeliverability); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/InstanceSettingsObject.java b/src/main/java/com/clerk/backend_api/models/components/InstanceSettingsObject.java new file mode 100644 index 0000000..085ccb5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InstanceSettingsObject.java @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * InstanceSettingsObject - String representing the object's type. Objects of the same type share the same value. + */ +public enum InstanceSettingsObject { + INSTANCE_SETTINGS("instance_settings"); + + @JsonValue + private final String value; + + private InstanceSettingsObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Invitation.java b/src/main/java/com/clerk/backend_api/models/components/Invitation.java new file mode 100644 index 0000000..91f46cc --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Invitation.java @@ -0,0 +1,410 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Invitation { + + @JsonProperty("object") + private InvitationObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("email_address") + private String emailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("revoked") + private Optional revoked; + + @JsonProperty("status") + private InvitationStatus status; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("url") + private JsonNullable url; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public Invitation( + @JsonProperty("object") InvitationObject object, + @JsonProperty("id") String id, + @JsonProperty("email_address") String emailAddress, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("revoked") Optional revoked, + @JsonProperty("status") InvitationStatus status, + @JsonProperty("url") JsonNullable url, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(revoked, "revoked"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(url, "url"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.emailAddress = emailAddress; + this.publicMetadata = publicMetadata; + this.revoked = revoked; + this.status = status; + this.url = url; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public Invitation( + InvitationObject object, + String id, + String emailAddress, + InvitationStatus status, + long createdAt, + long updatedAt) { + this(object, id, emailAddress, Optional.empty(), Optional.empty(), status, JsonNullable.undefined(), createdAt, updatedAt); + } + + @JsonIgnore + public InvitationObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String emailAddress() { + return emailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional revoked() { + return (Optional) revoked; + } + + @JsonIgnore + public InvitationStatus status() { + return status; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable url() { + return (JsonNullable) url; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Invitation withObject(InvitationObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Invitation withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Invitation withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Invitation withPublicMetadata(InvitationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public Invitation withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Invitation withRevoked(boolean revoked) { + Utils.checkNotNull(revoked, "revoked"); + this.revoked = Optional.ofNullable(revoked); + return this; + } + + public Invitation withRevoked(Optional revoked) { + Utils.checkNotNull(revoked, "revoked"); + this.revoked = revoked; + return this; + } + + public Invitation withStatus(InvitationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Invitation withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = JsonNullable.of(url); + return this; + } + + public Invitation withUrl(JsonNullable url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Invitation withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Invitation withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Invitation other = (Invitation) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.revoked, other.revoked) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.url, other.url) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + emailAddress, + publicMetadata, + revoked, + status, + url, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(Invitation.class, + "object", object, + "id", id, + "emailAddress", emailAddress, + "publicMetadata", publicMetadata, + "revoked", revoked, + "status", status, + "url", url, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private InvitationObject object; + + private String id; + + private String emailAddress; + + private Optional publicMetadata = Optional.empty(); + + private Optional revoked = Optional.empty(); + + private InvitationStatus status; + + private JsonNullable url = JsonNullable.undefined(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(InvitationObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder publicMetadata(InvitationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder revoked(boolean revoked) { + Utils.checkNotNull(revoked, "revoked"); + this.revoked = Optional.ofNullable(revoked); + return this; + } + + public Builder revoked(Optional revoked) { + Utils.checkNotNull(revoked, "revoked"); + this.revoked = revoked; + return this; + } + + public Builder status(InvitationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = JsonNullable.of(url); + return this; + } + + public Builder url(JsonNullable url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public Invitation build() { + return new Invitation( + object, + id, + emailAddress, + publicMetadata, + revoked, + status, + url, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/InvitationObject.java b/src/main/java/com/clerk/backend_api/models/components/InvitationObject.java new file mode 100644 index 0000000..88a60c2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InvitationObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum InvitationObject { + INVITATION("invitation"); + + @JsonValue + private final String value; + + private InvitationObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/InvitationPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/InvitationPublicMetadata.java new file mode 100644 index 0000000..cac0ce8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InvitationPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class InvitationPublicMetadata { + + @JsonCreator + public InvitationPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(InvitationPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public InvitationPublicMetadata build() { + return new InvitationPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/InvitationRevoked.java b/src/main/java/com/clerk/backend_api/models/components/InvitationRevoked.java new file mode 100644 index 0000000..1310004 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InvitationRevoked.java @@ -0,0 +1,410 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class InvitationRevoked { + + @JsonProperty("object") + private InvitationRevokedObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("email_address") + private String emailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("revoked") + private Optional revoked; + + @JsonProperty("status") + private InvitationRevokedStatus status; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("url") + private JsonNullable url; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public InvitationRevoked( + @JsonProperty("object") InvitationRevokedObject object, + @JsonProperty("id") String id, + @JsonProperty("email_address") String emailAddress, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("revoked") Optional revoked, + @JsonProperty("status") InvitationRevokedStatus status, + @JsonProperty("url") JsonNullable url, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(revoked, "revoked"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(url, "url"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.emailAddress = emailAddress; + this.publicMetadata = publicMetadata; + this.revoked = revoked; + this.status = status; + this.url = url; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public InvitationRevoked( + InvitationRevokedObject object, + String id, + String emailAddress, + InvitationRevokedStatus status, + long createdAt, + long updatedAt) { + this(object, id, emailAddress, Optional.empty(), Optional.empty(), status, JsonNullable.undefined(), createdAt, updatedAt); + } + + @JsonIgnore + public InvitationRevokedObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String emailAddress() { + return emailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional revoked() { + return (Optional) revoked; + } + + @JsonIgnore + public InvitationRevokedStatus status() { + return status; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable url() { + return (JsonNullable) url; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public InvitationRevoked withObject(InvitationRevokedObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public InvitationRevoked withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public InvitationRevoked withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public InvitationRevoked withPublicMetadata(InvitationRevokedPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public InvitationRevoked withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public InvitationRevoked withRevoked(boolean revoked) { + Utils.checkNotNull(revoked, "revoked"); + this.revoked = Optional.ofNullable(revoked); + return this; + } + + public InvitationRevoked withRevoked(Optional revoked) { + Utils.checkNotNull(revoked, "revoked"); + this.revoked = revoked; + return this; + } + + public InvitationRevoked withStatus(InvitationRevokedStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public InvitationRevoked withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = JsonNullable.of(url); + return this; + } + + public InvitationRevoked withUrl(JsonNullable url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public InvitationRevoked withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public InvitationRevoked withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationRevoked other = (InvitationRevoked) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.revoked, other.revoked) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.url, other.url) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + emailAddress, + publicMetadata, + revoked, + status, + url, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(InvitationRevoked.class, + "object", object, + "id", id, + "emailAddress", emailAddress, + "publicMetadata", publicMetadata, + "revoked", revoked, + "status", status, + "url", url, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private InvitationRevokedObject object; + + private String id; + + private String emailAddress; + + private Optional publicMetadata = Optional.empty(); + + private Optional revoked = Optional.empty(); + + private InvitationRevokedStatus status; + + private JsonNullable url = JsonNullable.undefined(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(InvitationRevokedObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder publicMetadata(InvitationRevokedPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder revoked(boolean revoked) { + Utils.checkNotNull(revoked, "revoked"); + this.revoked = Optional.ofNullable(revoked); + return this; + } + + public Builder revoked(Optional revoked) { + Utils.checkNotNull(revoked, "revoked"); + this.revoked = revoked; + return this; + } + + public Builder status(InvitationRevokedStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = JsonNullable.of(url); + return this; + } + + public Builder url(JsonNullable url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public InvitationRevoked build() { + return new InvitationRevoked( + object, + id, + emailAddress, + publicMetadata, + revoked, + status, + url, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedObject.java b/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedObject.java new file mode 100644 index 0000000..339620e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum InvitationRevokedObject { + INVITATION("invitation"); + + @JsonValue + private final String value; + + private InvitationRevokedObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedPublicMetadata.java new file mode 100644 index 0000000..6de2363 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class InvitationRevokedPublicMetadata { + + @JsonCreator + public InvitationRevokedPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(InvitationRevokedPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public InvitationRevokedPublicMetadata build() { + return new InvitationRevokedPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedStatus.java b/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedStatus.java new file mode 100644 index 0000000..10901bc --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InvitationRevokedStatus.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum InvitationRevokedStatus { + REVOKED("revoked"); + + @JsonValue + private final String value; + + private InvitationRevokedStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/InvitationStatus.java b/src/main/java/com/clerk/backend_api/models/components/InvitationStatus.java new file mode 100644 index 0000000..cd95d6d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/InvitationStatus.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum InvitationStatus { + PENDING("pending"), + ACCEPTED("accepted"), + REVOKED("revoked"); + + @JsonValue + private final String value; + + private InvitationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/JWTTemplate.java b/src/main/java/com/clerk/backend_api/models/components/JWTTemplate.java new file mode 100644 index 0000000..0667dbb --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/JWTTemplate.java @@ -0,0 +1,426 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class JWTTemplate { + + @JsonProperty("object") + private JWTTemplateObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("claims") + private Claims claims; + + @JsonProperty("lifetime") + private long lifetime; + + @JsonProperty("allowed_clock_skew") + private long allowedClockSkew; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_signing_key") + private Optional customSigningKey; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signing_algorithm") + private Optional signingAlgorithm; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public JWTTemplate( + @JsonProperty("object") JWTTemplateObject object, + @JsonProperty("id") String id, + @JsonProperty("name") String name, + @JsonProperty("claims") Claims claims, + @JsonProperty("lifetime") long lifetime, + @JsonProperty("allowed_clock_skew") long allowedClockSkew, + @JsonProperty("custom_signing_key") Optional customSigningKey, + @JsonProperty("signing_algorithm") Optional signingAlgorithm, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(claims, "claims"); + Utils.checkNotNull(lifetime, "lifetime"); + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + Utils.checkNotNull(customSigningKey, "customSigningKey"); + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.name = name; + this.claims = claims; + this.lifetime = lifetime; + this.allowedClockSkew = allowedClockSkew; + this.customSigningKey = customSigningKey; + this.signingAlgorithm = signingAlgorithm; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public JWTTemplate( + JWTTemplateObject object, + String id, + String name, + Claims claims, + long lifetime, + long allowedClockSkew, + long createdAt, + long updatedAt) { + this(object, id, name, claims, lifetime, allowedClockSkew, Optional.empty(), Optional.empty(), createdAt, updatedAt); + } + + @JsonIgnore + public JWTTemplateObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public Claims claims() { + return claims; + } + + @JsonIgnore + public long lifetime() { + return lifetime; + } + + @JsonIgnore + public long allowedClockSkew() { + return allowedClockSkew; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional customSigningKey() { + return (Optional) customSigningKey; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional signingAlgorithm() { + return (Optional) signingAlgorithm; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public JWTTemplate withObject(JWTTemplateObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public JWTTemplate withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public JWTTemplate withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public JWTTemplate withClaims(Claims claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = claims; + return this; + } + + public JWTTemplate withLifetime(long lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = lifetime; + return this; + } + + public JWTTemplate withAllowedClockSkew(long allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = allowedClockSkew; + return this; + } + + public JWTTemplate withCustomSigningKey(boolean customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = Optional.ofNullable(customSigningKey); + return this; + } + + public JWTTemplate withCustomSigningKey(Optional customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = customSigningKey; + return this; + } + + public JWTTemplate withSigningAlgorithm(String signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = Optional.ofNullable(signingAlgorithm); + return this; + } + + public JWTTemplate withSigningAlgorithm(Optional signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = signingAlgorithm; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public JWTTemplate withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public JWTTemplate withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWTTemplate other = (JWTTemplate) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.claims, other.claims) && + java.util.Objects.deepEquals(this.lifetime, other.lifetime) && + java.util.Objects.deepEquals(this.allowedClockSkew, other.allowedClockSkew) && + java.util.Objects.deepEquals(this.customSigningKey, other.customSigningKey) && + java.util.Objects.deepEquals(this.signingAlgorithm, other.signingAlgorithm) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + name, + claims, + lifetime, + allowedClockSkew, + customSigningKey, + signingAlgorithm, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(JWTTemplate.class, + "object", object, + "id", id, + "name", name, + "claims", claims, + "lifetime", lifetime, + "allowedClockSkew", allowedClockSkew, + "customSigningKey", customSigningKey, + "signingAlgorithm", signingAlgorithm, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private JWTTemplateObject object; + + private String id; + + private String name; + + private Claims claims; + + private Long lifetime; + + private Long allowedClockSkew; + + private Optional customSigningKey = Optional.empty(); + + private Optional signingAlgorithm = Optional.empty(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(JWTTemplateObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder claims(Claims claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = claims; + return this; + } + + public Builder lifetime(long lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = lifetime; + return this; + } + + public Builder allowedClockSkew(long allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = allowedClockSkew; + return this; + } + + public Builder customSigningKey(boolean customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = Optional.ofNullable(customSigningKey); + return this; + } + + public Builder customSigningKey(Optional customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = customSigningKey; + return this; + } + + public Builder signingAlgorithm(String signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = Optional.ofNullable(signingAlgorithm); + return this; + } + + public Builder signingAlgorithm(Optional signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = signingAlgorithm; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public JWTTemplate build() { + return new JWTTemplate( + object, + id, + name, + claims, + lifetime, + allowedClockSkew, + customSigningKey, + signingAlgorithm, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/JWTTemplateObject.java b/src/main/java/com/clerk/backend_api/models/components/JWTTemplateObject.java new file mode 100644 index 0000000..94980cf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/JWTTemplateObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum JWTTemplateObject { + JWT_TEMPLATE("jwt_template"); + + @JsonValue + private final String value; + + private JWTTemplateObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Meta.java b/src/main/java/com/clerk/backend_api/models/components/Meta.java new file mode 100644 index 0000000..4c48732 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Meta.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Meta { + + @JsonCreator + public Meta() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(Meta.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public Meta build() { + return new Meta( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Nonce.java b/src/main/java/com/clerk/backend_api/models/components/Nonce.java new file mode 100644 index 0000000..d5d423f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Nonce.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum Nonce { + NONCE("nonce"); + + @JsonValue + private final String value; + + private Nonce(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OAuthApplication.java b/src/main/java/com/clerk/backend_api/models/components/OAuthApplication.java new file mode 100644 index 0000000..bac0525 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OAuthApplication.java @@ -0,0 +1,470 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OAuthApplication { + + @JsonProperty("object") + private OAuthApplicationObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("instance_id") + private String instanceId; + + @JsonProperty("name") + private String name; + + @JsonProperty("client_id") + private String clientId; + + @JsonProperty("public") + private boolean public_; + + @JsonProperty("scopes") + private String scopes; + + @JsonProperty("callback_url") + private String callbackUrl; + + @JsonProperty("authorize_url") + private String authorizeUrl; + + @JsonProperty("token_fetch_url") + private String tokenFetchUrl; + + @JsonProperty("user_info_url") + private String userInfoUrl; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public OAuthApplication( + @JsonProperty("object") OAuthApplicationObject object, + @JsonProperty("id") String id, + @JsonProperty("instance_id") String instanceId, + @JsonProperty("name") String name, + @JsonProperty("client_id") String clientId, + @JsonProperty("public") boolean public_, + @JsonProperty("scopes") String scopes, + @JsonProperty("callback_url") String callbackUrl, + @JsonProperty("authorize_url") String authorizeUrl, + @JsonProperty("token_fetch_url") String tokenFetchUrl, + @JsonProperty("user_info_url") String userInfoUrl, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(instanceId, "instanceId"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(clientId, "clientId"); + Utils.checkNotNull(public_, "public_"); + Utils.checkNotNull(scopes, "scopes"); + Utils.checkNotNull(callbackUrl, "callbackUrl"); + Utils.checkNotNull(authorizeUrl, "authorizeUrl"); + Utils.checkNotNull(tokenFetchUrl, "tokenFetchUrl"); + Utils.checkNotNull(userInfoUrl, "userInfoUrl"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.instanceId = instanceId; + this.name = name; + this.clientId = clientId; + this.public_ = public_; + this.scopes = scopes; + this.callbackUrl = callbackUrl; + this.authorizeUrl = authorizeUrl; + this.tokenFetchUrl = tokenFetchUrl; + this.userInfoUrl = userInfoUrl; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + @JsonIgnore + public OAuthApplicationObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String instanceId() { + return instanceId; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public String clientId() { + return clientId; + } + + @JsonIgnore + public boolean public_() { + return public_; + } + + @JsonIgnore + public String scopes() { + return scopes; + } + + @JsonIgnore + public String callbackUrl() { + return callbackUrl; + } + + @JsonIgnore + public String authorizeUrl() { + return authorizeUrl; + } + + @JsonIgnore + public String tokenFetchUrl() { + return tokenFetchUrl; + } + + @JsonIgnore + public String userInfoUrl() { + return userInfoUrl; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public OAuthApplication withObject(OAuthApplicationObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public OAuthApplication withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public OAuthApplication withInstanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + public OAuthApplication withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public OAuthApplication withClientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + public OAuthApplication withPublic(boolean public_) { + Utils.checkNotNull(public_, "public_"); + this.public_ = public_; + return this; + } + + public OAuthApplication withScopes(String scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + public OAuthApplication withCallbackUrl(String callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = callbackUrl; + return this; + } + + public OAuthApplication withAuthorizeUrl(String authorizeUrl) { + Utils.checkNotNull(authorizeUrl, "authorizeUrl"); + this.authorizeUrl = authorizeUrl; + return this; + } + + public OAuthApplication withTokenFetchUrl(String tokenFetchUrl) { + Utils.checkNotNull(tokenFetchUrl, "tokenFetchUrl"); + this.tokenFetchUrl = tokenFetchUrl; + return this; + } + + public OAuthApplication withUserInfoUrl(String userInfoUrl) { + Utils.checkNotNull(userInfoUrl, "userInfoUrl"); + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public OAuthApplication withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public OAuthApplication withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthApplication other = (OAuthApplication) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.instanceId, other.instanceId) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.clientId, other.clientId) && + java.util.Objects.deepEquals(this.public_, other.public_) && + java.util.Objects.deepEquals(this.scopes, other.scopes) && + java.util.Objects.deepEquals(this.callbackUrl, other.callbackUrl) && + java.util.Objects.deepEquals(this.authorizeUrl, other.authorizeUrl) && + java.util.Objects.deepEquals(this.tokenFetchUrl, other.tokenFetchUrl) && + java.util.Objects.deepEquals(this.userInfoUrl, other.userInfoUrl) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + instanceId, + name, + clientId, + public_, + scopes, + callbackUrl, + authorizeUrl, + tokenFetchUrl, + userInfoUrl, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(OAuthApplication.class, + "object", object, + "id", id, + "instanceId", instanceId, + "name", name, + "clientId", clientId, + "public_", public_, + "scopes", scopes, + "callbackUrl", callbackUrl, + "authorizeUrl", authorizeUrl, + "tokenFetchUrl", tokenFetchUrl, + "userInfoUrl", userInfoUrl, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private OAuthApplicationObject object; + + private String id; + + private String instanceId; + + private String name; + + private String clientId; + + private Boolean public_; + + private String scopes; + + private String callbackUrl; + + private String authorizeUrl; + + private String tokenFetchUrl; + + private String userInfoUrl; + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(OAuthApplicationObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder instanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + public Builder public_(boolean public_) { + Utils.checkNotNull(public_, "public_"); + this.public_ = public_; + return this; + } + + public Builder scopes(String scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + public Builder callbackUrl(String callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = callbackUrl; + return this; + } + + public Builder authorizeUrl(String authorizeUrl) { + Utils.checkNotNull(authorizeUrl, "authorizeUrl"); + this.authorizeUrl = authorizeUrl; + return this; + } + + public Builder tokenFetchUrl(String tokenFetchUrl) { + Utils.checkNotNull(tokenFetchUrl, "tokenFetchUrl"); + this.tokenFetchUrl = tokenFetchUrl; + return this; + } + + public Builder userInfoUrl(String userInfoUrl) { + Utils.checkNotNull(userInfoUrl, "userInfoUrl"); + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public OAuthApplication build() { + return new OAuthApplication( + object, + id, + instanceId, + name, + clientId, + public_, + scopes, + callbackUrl, + authorizeUrl, + tokenFetchUrl, + userInfoUrl, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationObject.java b/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationObject.java new file mode 100644 index 0000000..f857d0e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OAuthApplicationObject { + OAUTH_APPLICATION("oauth_application"); + + @JsonValue + private final String value; + + private OAuthApplicationObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationWithSecret.java b/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationWithSecret.java new file mode 100644 index 0000000..72bbe86 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationWithSecret.java @@ -0,0 +1,557 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class OAuthApplicationWithSecret { + + @JsonProperty("object") + private OAuthApplicationWithSecretObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("instance_id") + private String instanceId; + + @JsonProperty("name") + private String name; + + @JsonProperty("client_id") + private String clientId; + + @JsonProperty("public") + private boolean public_; + + @JsonProperty("scopes") + private String scopes; + + @JsonProperty("callback_url") + private String callbackUrl; + + @JsonProperty("authorize_url") + private String authorizeUrl; + + @JsonProperty("token_fetch_url") + private String tokenFetchUrl; + + @JsonProperty("user_info_url") + private String userInfoUrl; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + /** + * Empty if public client. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("client_secret") + private Optional clientSecret; + + @JsonCreator + public OAuthApplicationWithSecret( + @JsonProperty("object") OAuthApplicationWithSecretObject object, + @JsonProperty("id") String id, + @JsonProperty("instance_id") String instanceId, + @JsonProperty("name") String name, + @JsonProperty("client_id") String clientId, + @JsonProperty("public") boolean public_, + @JsonProperty("scopes") String scopes, + @JsonProperty("callback_url") String callbackUrl, + @JsonProperty("authorize_url") String authorizeUrl, + @JsonProperty("token_fetch_url") String tokenFetchUrl, + @JsonProperty("user_info_url") String userInfoUrl, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt, + @JsonProperty("client_secret") Optional clientSecret) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(instanceId, "instanceId"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(clientId, "clientId"); + Utils.checkNotNull(public_, "public_"); + Utils.checkNotNull(scopes, "scopes"); + Utils.checkNotNull(callbackUrl, "callbackUrl"); + Utils.checkNotNull(authorizeUrl, "authorizeUrl"); + Utils.checkNotNull(tokenFetchUrl, "tokenFetchUrl"); + Utils.checkNotNull(userInfoUrl, "userInfoUrl"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(clientSecret, "clientSecret"); + this.object = object; + this.id = id; + this.instanceId = instanceId; + this.name = name; + this.clientId = clientId; + this.public_ = public_; + this.scopes = scopes; + this.callbackUrl = callbackUrl; + this.authorizeUrl = authorizeUrl; + this.tokenFetchUrl = tokenFetchUrl; + this.userInfoUrl = userInfoUrl; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.clientSecret = clientSecret; + } + + public OAuthApplicationWithSecret( + OAuthApplicationWithSecretObject object, + String id, + String instanceId, + String name, + String clientId, + boolean public_, + String scopes, + String callbackUrl, + String authorizeUrl, + String tokenFetchUrl, + String userInfoUrl, + long createdAt, + long updatedAt) { + this(object, id, instanceId, name, clientId, public_, scopes, callbackUrl, authorizeUrl, tokenFetchUrl, userInfoUrl, createdAt, updatedAt, Optional.empty()); + } + + @JsonIgnore + public OAuthApplicationWithSecretObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String instanceId() { + return instanceId; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public String clientId() { + return clientId; + } + + @JsonIgnore + public boolean public_() { + return public_; + } + + @JsonIgnore + public String scopes() { + return scopes; + } + + @JsonIgnore + public String callbackUrl() { + return callbackUrl; + } + + @JsonIgnore + public String authorizeUrl() { + return authorizeUrl; + } + + @JsonIgnore + public String tokenFetchUrl() { + return tokenFetchUrl; + } + + @JsonIgnore + public String userInfoUrl() { + return userInfoUrl; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + /** + * Empty if public client. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clientSecret() { + return (Optional) clientSecret; + } + + public final static Builder builder() { + return new Builder(); + } + + public OAuthApplicationWithSecret withObject(OAuthApplicationWithSecretObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public OAuthApplicationWithSecret withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public OAuthApplicationWithSecret withInstanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + public OAuthApplicationWithSecret withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public OAuthApplicationWithSecret withClientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + public OAuthApplicationWithSecret withPublic(boolean public_) { + Utils.checkNotNull(public_, "public_"); + this.public_ = public_; + return this; + } + + public OAuthApplicationWithSecret withScopes(String scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + public OAuthApplicationWithSecret withCallbackUrl(String callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = callbackUrl; + return this; + } + + public OAuthApplicationWithSecret withAuthorizeUrl(String authorizeUrl) { + Utils.checkNotNull(authorizeUrl, "authorizeUrl"); + this.authorizeUrl = authorizeUrl; + return this; + } + + public OAuthApplicationWithSecret withTokenFetchUrl(String tokenFetchUrl) { + Utils.checkNotNull(tokenFetchUrl, "tokenFetchUrl"); + this.tokenFetchUrl = tokenFetchUrl; + return this; + } + + public OAuthApplicationWithSecret withUserInfoUrl(String userInfoUrl) { + Utils.checkNotNull(userInfoUrl, "userInfoUrl"); + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public OAuthApplicationWithSecret withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public OAuthApplicationWithSecret withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Empty if public client. + * + */ + public OAuthApplicationWithSecret withClientSecret(String clientSecret) { + Utils.checkNotNull(clientSecret, "clientSecret"); + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + * Empty if public client. + * + */ + public OAuthApplicationWithSecret withClientSecret(Optional clientSecret) { + Utils.checkNotNull(clientSecret, "clientSecret"); + this.clientSecret = clientSecret; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthApplicationWithSecret other = (OAuthApplicationWithSecret) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.instanceId, other.instanceId) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.clientId, other.clientId) && + java.util.Objects.deepEquals(this.public_, other.public_) && + java.util.Objects.deepEquals(this.scopes, other.scopes) && + java.util.Objects.deepEquals(this.callbackUrl, other.callbackUrl) && + java.util.Objects.deepEquals(this.authorizeUrl, other.authorizeUrl) && + java.util.Objects.deepEquals(this.tokenFetchUrl, other.tokenFetchUrl) && + java.util.Objects.deepEquals(this.userInfoUrl, other.userInfoUrl) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.clientSecret, other.clientSecret); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + instanceId, + name, + clientId, + public_, + scopes, + callbackUrl, + authorizeUrl, + tokenFetchUrl, + userInfoUrl, + createdAt, + updatedAt, + clientSecret); + } + + @Override + public String toString() { + return Utils.toString(OAuthApplicationWithSecret.class, + "object", object, + "id", id, + "instanceId", instanceId, + "name", name, + "clientId", clientId, + "public_", public_, + "scopes", scopes, + "callbackUrl", callbackUrl, + "authorizeUrl", authorizeUrl, + "tokenFetchUrl", tokenFetchUrl, + "userInfoUrl", userInfoUrl, + "createdAt", createdAt, + "updatedAt", updatedAt, + "clientSecret", clientSecret); + } + + public final static class Builder { + + private OAuthApplicationWithSecretObject object; + + private String id; + + private String instanceId; + + private String name; + + private String clientId; + + private Boolean public_; + + private String scopes; + + private String callbackUrl; + + private String authorizeUrl; + + private String tokenFetchUrl; + + private String userInfoUrl; + + private Long createdAt; + + private Long updatedAt; + + private Optional clientSecret = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder object(OAuthApplicationWithSecretObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder instanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + public Builder public_(boolean public_) { + Utils.checkNotNull(public_, "public_"); + this.public_ = public_; + return this; + } + + public Builder scopes(String scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + public Builder callbackUrl(String callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = callbackUrl; + return this; + } + + public Builder authorizeUrl(String authorizeUrl) { + Utils.checkNotNull(authorizeUrl, "authorizeUrl"); + this.authorizeUrl = authorizeUrl; + return this; + } + + public Builder tokenFetchUrl(String tokenFetchUrl) { + Utils.checkNotNull(tokenFetchUrl, "tokenFetchUrl"); + this.tokenFetchUrl = tokenFetchUrl; + return this; + } + + public Builder userInfoUrl(String userInfoUrl) { + Utils.checkNotNull(userInfoUrl, "userInfoUrl"); + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Empty if public client. + * + */ + public Builder clientSecret(String clientSecret) { + Utils.checkNotNull(clientSecret, "clientSecret"); + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + * Empty if public client. + * + */ + public Builder clientSecret(Optional clientSecret) { + Utils.checkNotNull(clientSecret, "clientSecret"); + this.clientSecret = clientSecret; + return this; + } + + public OAuthApplicationWithSecret build() { + return new OAuthApplicationWithSecret( + object, + id, + instanceId, + name, + clientId, + public_, + scopes, + callbackUrl, + authorizeUrl, + tokenFetchUrl, + userInfoUrl, + createdAt, + updatedAt, + clientSecret); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationWithSecretObject.java b/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationWithSecretObject.java new file mode 100644 index 0000000..c218a61 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OAuthApplicationWithSecretObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OAuthApplicationWithSecretObject { + OAUTH_APPLICATION("oauth_application"); + + @JsonValue + private final String value; + + private OAuthApplicationWithSecretObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OAuthApplications.java b/src/main/java/com/clerk/backend_api/models/components/OAuthApplications.java new file mode 100644 index 0000000..2bf5d52 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OAuthApplications.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OAuthApplications { + + @JsonProperty("data") + private java.util.List data; + + /** + * Total number of OAuth applications + * + */ + @JsonProperty("total_count") + private long totalCount; + + @JsonCreator + public OAuthApplications( + @JsonProperty("data") java.util.List data, + @JsonProperty("total_count") long totalCount) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(totalCount, "totalCount"); + this.data = data; + this.totalCount = totalCount; + } + + @JsonIgnore + public java.util.List data() { + return data; + } + + /** + * Total number of OAuth applications + * + */ + @JsonIgnore + public long totalCount() { + return totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + public OAuthApplications withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of OAuth applications + * + */ + public OAuthApplications withTotalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthApplications other = (OAuthApplications) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(OAuthApplications.class, + "data", data, + "totalCount", totalCount); + } + + public final static class Builder { + + private java.util.List data; + + private Long totalCount; + + private Builder() { + // force use of static builder() method + } + + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of OAuth applications + * + */ + public Builder totalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public OAuthApplications build() { + return new OAuthApplications( + data, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OTPVerificationStatus.java b/src/main/java/com/clerk/backend_api/models/components/OTPVerificationStatus.java new file mode 100644 index 0000000..ce43cde --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OTPVerificationStatus.java @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OTPVerificationStatus { + UNVERIFIED("unverified"), + VERIFIED("verified"), + FAILED("failed"), + EXPIRED("expired"); + + @JsonValue + private final String value; + + private OTPVerificationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OTPVerificationStrategy.java b/src/main/java/com/clerk/backend_api/models/components/OTPVerificationStrategy.java new file mode 100644 index 0000000..537e58e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OTPVerificationStrategy.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OTPVerificationStrategy { + PHONE_CODE("phone_code"), + EMAIL_CODE("email_code"), + RESET_PASSWORD_EMAIL_CODE("reset_password_email_code"); + + @JsonValue + private final String value; + + private OTPVerificationStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Oauth.java b/src/main/java/com/clerk/backend_api/models/components/Oauth.java new file mode 100644 index 0000000..fd077c8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Oauth.java @@ -0,0 +1,288 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Oauth { + + @JsonProperty("status") + private OauthVerificationStatus status; + + @JsonProperty("strategy") + private OauthVerificationStrategy strategy; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_verification_redirect_url") + private Optional externalVerificationRedirectUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("error") + private JsonNullable error; + + @JsonProperty("expire_at") + private long expireAt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attempts") + private JsonNullable attempts; + + @JsonCreator + public Oauth( + @JsonProperty("status") OauthVerificationStatus status, + @JsonProperty("strategy") OauthVerificationStrategy strategy, + @JsonProperty("external_verification_redirect_url") Optional externalVerificationRedirectUrl, + @JsonProperty("error") JsonNullable error, + @JsonProperty("expire_at") long expireAt, + @JsonProperty("attempts") JsonNullable attempts) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + Utils.checkNotNull(error, "error"); + Utils.checkNotNull(expireAt, "expireAt"); + Utils.checkNotNull(attempts, "attempts"); + this.status = status; + this.strategy = strategy; + this.externalVerificationRedirectUrl = externalVerificationRedirectUrl; + this.error = error; + this.expireAt = expireAt; + this.attempts = attempts; + } + + public Oauth( + OauthVerificationStatus status, + OauthVerificationStrategy strategy, + long expireAt) { + this(status, strategy, Optional.empty(), JsonNullable.undefined(), expireAt, JsonNullable.undefined()); + } + + @JsonIgnore + public OauthVerificationStatus status() { + return status; + } + + @JsonIgnore + public OauthVerificationStrategy strategy() { + return strategy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional externalVerificationRedirectUrl() { + return (Optional) externalVerificationRedirectUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable error() { + return (JsonNullable) error; + } + + @JsonIgnore + public long expireAt() { + return expireAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attempts() { + return (JsonNullable) attempts; + } + + public final static Builder builder() { + return new Builder(); + } + + public Oauth withStatus(OauthVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Oauth withStrategy(OauthVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Oauth withExternalVerificationRedirectUrl(String externalVerificationRedirectUrl) { + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + this.externalVerificationRedirectUrl = Optional.ofNullable(externalVerificationRedirectUrl); + return this; + } + + public Oauth withExternalVerificationRedirectUrl(Optional externalVerificationRedirectUrl) { + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + this.externalVerificationRedirectUrl = externalVerificationRedirectUrl; + return this; + } + + public Oauth withError(Error error) { + Utils.checkNotNull(error, "error"); + this.error = JsonNullable.of(error); + return this; + } + + public Oauth withError(JsonNullable error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + public Oauth withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Oauth withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Oauth withAttempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Oauth other = (Oauth) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.externalVerificationRedirectUrl, other.externalVerificationRedirectUrl) && + java.util.Objects.deepEquals(this.error, other.error) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt) && + java.util.Objects.deepEquals(this.attempts, other.attempts); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + externalVerificationRedirectUrl, + error, + expireAt, + attempts); + } + + @Override + public String toString() { + return Utils.toString(Oauth.class, + "status", status, + "strategy", strategy, + "externalVerificationRedirectUrl", externalVerificationRedirectUrl, + "error", error, + "expireAt", expireAt, + "attempts", attempts); + } + + public final static class Builder { + + private OauthVerificationStatus status; + + private OauthVerificationStrategy strategy; + + private Optional externalVerificationRedirectUrl = Optional.empty(); + + private JsonNullable error = JsonNullable.undefined(); + + private Long expireAt; + + private JsonNullable attempts = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder status(OauthVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(OauthVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder externalVerificationRedirectUrl(String externalVerificationRedirectUrl) { + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + this.externalVerificationRedirectUrl = Optional.ofNullable(externalVerificationRedirectUrl); + return this; + } + + public Builder externalVerificationRedirectUrl(Optional externalVerificationRedirectUrl) { + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + this.externalVerificationRedirectUrl = externalVerificationRedirectUrl; + return this; + } + + public Builder error(Error error) { + Utils.checkNotNull(error, "error"); + this.error = JsonNullable.of(error); + return this; + } + + public Builder error(JsonNullable error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Builder attempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Oauth build() { + return new Oauth( + status, + strategy, + externalVerificationRedirectUrl, + error, + expireAt, + attempts); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OauthVerificationStatus.java b/src/main/java/com/clerk/backend_api/models/components/OauthVerificationStatus.java new file mode 100644 index 0000000..fdcf5db --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OauthVerificationStatus.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OauthVerificationStatus { + UNVERIFIED("unverified"), + VERIFIED("verified"), + FAILED("failed"), + EXPIRED("expired"), + TRANSFERABLE("transferable"); + + @JsonValue + private final String value; + + private OauthVerificationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OauthVerificationStrategy.java b/src/main/java/com/clerk/backend_api/models/components/OauthVerificationStrategy.java new file mode 100644 index 0000000..4e473f9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OauthVerificationStrategy.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OauthVerificationStrategy { + OAUTH_GOOGLE("oauth_google"), + OAUTH_MOCK("oauth_mock"); + + @JsonValue + private final String value; + + private OauthVerificationStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Object.java b/src/main/java/com/clerk/backend_api/models/components/Object.java new file mode 100644 index 0000000..bfe5519 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Object.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * Object - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum Object { + CLIENT("client"); + + @JsonValue + private final String value; + + private Object(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Organization.java b/src/main/java/com/clerk/backend_api/models/components/Organization.java new file mode 100644 index 0000000..67fd358 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Organization.java @@ -0,0 +1,500 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Organization { + + @JsonProperty("object") + private OrganizationObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("slug") + private String slug; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("members_count") + private JsonNullable membersCount; + + @JsonProperty("max_allowed_memberships") + private long maxAllowedMemberships; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("admin_delete_enabled") + private Optional adminDeleteEnabled; + + @JsonProperty("public_metadata") + private OrganizationPublicMetadata publicMetadata; + + @JsonProperty("private_metadata") + private OrganizationPrivateMetadata privateMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_by") + private Optional createdBy; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public Organization( + @JsonProperty("object") OrganizationObject object, + @JsonProperty("id") String id, + @JsonProperty("name") String name, + @JsonProperty("slug") String slug, + @JsonProperty("members_count") JsonNullable membersCount, + @JsonProperty("max_allowed_memberships") long maxAllowedMemberships, + @JsonProperty("admin_delete_enabled") Optional adminDeleteEnabled, + @JsonProperty("public_metadata") OrganizationPublicMetadata publicMetadata, + @JsonProperty("private_metadata") OrganizationPrivateMetadata privateMetadata, + @JsonProperty("created_by") Optional createdBy, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(membersCount, "membersCount"); + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(createdBy, "createdBy"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.name = name; + this.slug = slug; + this.membersCount = membersCount; + this.maxAllowedMemberships = maxAllowedMemberships; + this.adminDeleteEnabled = adminDeleteEnabled; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.createdBy = createdBy; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public Organization( + OrganizationObject object, + String id, + String name, + String slug, + long maxAllowedMemberships, + OrganizationPublicMetadata publicMetadata, + OrganizationPrivateMetadata privateMetadata, + long createdAt, + long updatedAt) { + this(object, id, name, slug, JsonNullable.undefined(), maxAllowedMemberships, Optional.empty(), publicMetadata, privateMetadata, Optional.empty(), createdAt, updatedAt); + } + + @JsonIgnore + public OrganizationObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public String slug() { + return slug; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable membersCount() { + return (JsonNullable) membersCount; + } + + @JsonIgnore + public long maxAllowedMemberships() { + return maxAllowedMemberships; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional adminDeleteEnabled() { + return (Optional) adminDeleteEnabled; + } + + @JsonIgnore + public OrganizationPublicMetadata publicMetadata() { + return publicMetadata; + } + + @JsonIgnore + public OrganizationPrivateMetadata privateMetadata() { + return privateMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdBy() { + return (Optional) createdBy; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Organization withObject(OrganizationObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Organization withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Organization withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Organization withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Organization withMembersCount(long membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = JsonNullable.of(membersCount); + return this; + } + + public Organization withMembersCount(JsonNullable membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = membersCount; + return this; + } + + public Organization withMaxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public Organization withAdminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = Optional.ofNullable(adminDeleteEnabled); + return this; + } + + public Organization withAdminDeleteEnabled(Optional adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public Organization withPublicMetadata(OrganizationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Organization withPrivateMetadata(OrganizationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public Organization withCreatedBy(String createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + public Organization withCreatedBy(Optional createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = createdBy; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Organization withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Organization withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Organization other = (Organization) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.membersCount, other.membersCount) && + java.util.Objects.deepEquals(this.maxAllowedMemberships, other.maxAllowedMemberships) && + java.util.Objects.deepEquals(this.adminDeleteEnabled, other.adminDeleteEnabled) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.createdBy, other.createdBy) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + name, + slug, + membersCount, + maxAllowedMemberships, + adminDeleteEnabled, + publicMetadata, + privateMetadata, + createdBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(Organization.class, + "object", object, + "id", id, + "name", name, + "slug", slug, + "membersCount", membersCount, + "maxAllowedMemberships", maxAllowedMemberships, + "adminDeleteEnabled", adminDeleteEnabled, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "createdBy", createdBy, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private OrganizationObject object; + + private String id; + + private String name; + + private String slug; + + private JsonNullable membersCount = JsonNullable.undefined(); + + private Long maxAllowedMemberships; + + private Optional adminDeleteEnabled = Optional.empty(); + + private OrganizationPublicMetadata publicMetadata; + + private OrganizationPrivateMetadata privateMetadata; + + private Optional createdBy = Optional.empty(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(OrganizationObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder membersCount(long membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = JsonNullable.of(membersCount); + return this; + } + + public Builder membersCount(JsonNullable membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = membersCount; + return this; + } + + public Builder maxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public Builder adminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = Optional.ofNullable(adminDeleteEnabled); + return this; + } + + public Builder adminDeleteEnabled(Optional adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public Builder publicMetadata(OrganizationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder privateMetadata(OrganizationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public Builder createdBy(String createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + public Builder createdBy(Optional createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = createdBy; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public Organization build() { + return new Organization( + object, + id, + name, + slug, + membersCount, + maxAllowedMemberships, + adminDeleteEnabled, + publicMetadata, + privateMetadata, + createdBy, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitation.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitation.java new file mode 100644 index 0000000..608a568 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitation.java @@ -0,0 +1,561 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * OrganizationInvitation - An organization invitation + */ + +public class OrganizationInvitation { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_address") + private Optional emailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("role") + private Optional role; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("organization_id") + private Optional organizationId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + /** + * Unix timestamp of creation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private Optional createdAt; + + /** + * Unix timestamp of last update. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private Optional updatedAt; + + @JsonCreator + public OrganizationInvitation( + @JsonProperty("id") Optional id, + @JsonProperty("object") Optional object, + @JsonProperty("email_address") Optional emailAddress, + @JsonProperty("role") Optional role, + @JsonProperty("organization_id") Optional organizationId, + @JsonProperty("status") Optional status, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("created_at") Optional createdAt, + @JsonProperty("updated_at") Optional updatedAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(role, "role"); + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.id = id; + this.object = object; + this.emailAddress = emailAddress; + this.role = role; + this.organizationId = organizationId; + this.status = status; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public OrganizationInvitation() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional emailAddress() { + return (Optional) emailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional role() { + return (Optional) role; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationId() { + return (Optional) organizationId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + /** + * Unix timestamp of creation. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + /** + * Unix timestamp of last update. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public OrganizationInvitation withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public OrganizationInvitation withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public OrganizationInvitation withObject(OrganizationInvitationObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public OrganizationInvitation withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public OrganizationInvitation withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + public OrganizationInvitation withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public OrganizationInvitation withRole(String role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public OrganizationInvitation withRole(Optional role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public OrganizationInvitation withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + public OrganizationInvitation withOrganizationId(Optional organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public OrganizationInvitation withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public OrganizationInvitation withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public OrganizationInvitation withPublicMetadata(OrganizationInvitationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public OrganizationInvitation withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public OrganizationInvitation withPrivateMetadata(OrganizationInvitationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + public OrganizationInvitation withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Unix timestamp of creation. + */ + public OrganizationInvitation withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation. + */ + public OrganizationInvitation withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + */ + public OrganizationInvitation withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + */ + public OrganizationInvitation withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationInvitation other = (OrganizationInvitation) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.role, other.role) && + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + emailAddress, + role, + organizationId, + status, + publicMetadata, + privateMetadata, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(OrganizationInvitation.class, + "id", id, + "object", object, + "emailAddress", emailAddress, + "role", role, + "organizationId", organizationId, + "status", status, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional object = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional role = Optional.empty(); + + private Optional organizationId = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(OrganizationInvitationObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder role(String role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public Builder role(Optional role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + public Builder organizationId(Optional organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder publicMetadata(OrganizationInvitationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder privateMetadata(OrganizationInvitationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Unix timestamp of creation. + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation. + */ + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + */ + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public OrganizationInvitation build() { + return new OrganizationInvitation( + id, + object, + emailAddress, + role, + organizationId, + status, + publicMetadata, + privateMetadata, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationObject.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationObject.java new file mode 100644 index 0000000..63305df --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * OrganizationInvitationObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum OrganizationInvitationObject { + ORGANIZATION_INVITATION("organization_invitation"); + + @JsonValue + private final String value; + + private OrganizationInvitationObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationPrivateMetadata.java new file mode 100644 index 0000000..30065cc --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationPrivateMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationInvitationPrivateMetadata { + + @JsonCreator + public OrganizationInvitationPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationInvitationPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationInvitationPrivateMetadata build() { + return new OrganizationInvitationPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationPublicMetadata.java new file mode 100644 index 0000000..75bb545 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitationPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationInvitationPublicMetadata { + + @JsonCreator + public OrganizationInvitationPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationInvitationPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationInvitationPublicMetadata build() { + return new OrganizationInvitationPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitations.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitations.java new file mode 100644 index 0000000..5c24bc3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationInvitations.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationInvitations { + + @JsonProperty("data") + private java.util.List data; + + /** + * Total number of organization invitations + * + */ + @JsonProperty("total_count") + private long totalCount; + + @JsonCreator + public OrganizationInvitations( + @JsonProperty("data") java.util.List data, + @JsonProperty("total_count") long totalCount) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(totalCount, "totalCount"); + this.data = data; + this.totalCount = totalCount; + } + + @JsonIgnore + public java.util.List data() { + return data; + } + + /** + * Total number of organization invitations + * + */ + @JsonIgnore + public long totalCount() { + return totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + public OrganizationInvitations withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of organization invitations + * + */ + public OrganizationInvitations withTotalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationInvitations other = (OrganizationInvitations) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(OrganizationInvitations.class, + "data", data, + "totalCount", totalCount); + } + + public final static class Builder { + + private java.util.List data; + + private Long totalCount; + + private Builder() { + // force use of static builder() method + } + + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of organization invitations + * + */ + public Builder totalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public OrganizationInvitations build() { + return new OrganizationInvitations( + data, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMembership.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembership.java new file mode 100644 index 0000000..5825e00 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembership.java @@ -0,0 +1,597 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * OrganizationMembership - Hello world + */ + +public class OrganizationMembership { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("role") + private Optional role; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("permissions") + private Optional> permissions; + + /** + * Metadata saved on the organization membership, accessible from both Frontend and Backend APIs + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the organization membership, accessible only from the Backend API + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("organization") + private Optional organization; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_user_data") + private Optional publicUserData; + + /** + * Unix timestamp of creation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private Optional createdAt; + + /** + * Unix timestamp of last update. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private Optional updatedAt; + + @JsonCreator + public OrganizationMembership( + @JsonProperty("id") Optional id, + @JsonProperty("object") Optional object, + @JsonProperty("role") Optional role, + @JsonProperty("permissions") Optional> permissions, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("organization") Optional organization, + @JsonProperty("public_user_data") Optional publicUserData, + @JsonProperty("created_at") Optional createdAt, + @JsonProperty("updated_at") Optional updatedAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(role, "role"); + Utils.checkNotNull(permissions, "permissions"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(organization, "organization"); + Utils.checkNotNull(publicUserData, "publicUserData"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.id = id; + this.object = object; + this.role = role; + this.permissions = permissions; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.organization = organization; + this.publicUserData = publicUserData; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public OrganizationMembership() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional role() { + return (Optional) role; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> permissions() { + return (Optional>) permissions; + } + + /** + * Metadata saved on the organization membership, accessible from both Frontend and Backend APIs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the organization membership, accessible only from the Backend API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organization() { + return (Optional) organization; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicUserData() { + return (Optional) publicUserData; + } + + /** + * Unix timestamp of creation. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + /** + * Unix timestamp of last update. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public OrganizationMembership withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public OrganizationMembership withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public OrganizationMembership withObject(OrganizationMembershipObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public OrganizationMembership withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public OrganizationMembership withRole(String role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public OrganizationMembership withRole(Optional role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public OrganizationMembership withPermissions(java.util.List permissions) { + Utils.checkNotNull(permissions, "permissions"); + this.permissions = Optional.ofNullable(permissions); + return this; + } + + public OrganizationMembership withPermissions(Optional> permissions) { + Utils.checkNotNull(permissions, "permissions"); + this.permissions = permissions; + return this; + } + + /** + * Metadata saved on the organization membership, accessible from both Frontend and Backend APIs + */ + public OrganizationMembership withPublicMetadata(OrganizationMembershipPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization membership, accessible from both Frontend and Backend APIs + */ + public OrganizationMembership withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization membership, accessible only from the Backend API + */ + public OrganizationMembership withPrivateMetadata(OrganizationMembershipPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization membership, accessible only from the Backend API + */ + public OrganizationMembership withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public OrganizationMembership withOrganization(OrganizationMembershipOrganization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + public OrganizationMembership withOrganization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + public OrganizationMembership withPublicUserData(PublicUserData publicUserData) { + Utils.checkNotNull(publicUserData, "publicUserData"); + this.publicUserData = Optional.ofNullable(publicUserData); + return this; + } + + public OrganizationMembership withPublicUserData(Optional publicUserData) { + Utils.checkNotNull(publicUserData, "publicUserData"); + this.publicUserData = publicUserData; + return this; + } + + /** + * Unix timestamp of creation. + */ + public OrganizationMembership withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation. + */ + public OrganizationMembership withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + */ + public OrganizationMembership withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + */ + public OrganizationMembership withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationMembership other = (OrganizationMembership) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.role, other.role) && + java.util.Objects.deepEquals(this.permissions, other.permissions) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.organization, other.organization) && + java.util.Objects.deepEquals(this.publicUserData, other.publicUserData) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + role, + permissions, + publicMetadata, + privateMetadata, + organization, + publicUserData, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(OrganizationMembership.class, + "id", id, + "object", object, + "role", role, + "permissions", permissions, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "organization", organization, + "publicUserData", publicUserData, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional object = Optional.empty(); + + private Optional role = Optional.empty(); + + private Optional> permissions = Optional.empty(); + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Optional organization = Optional.empty(); + + private Optional publicUserData = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(OrganizationMembershipObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder role(String role) { + Utils.checkNotNull(role, "role"); + this.role = Optional.ofNullable(role); + return this; + } + + public Builder role(Optional role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public Builder permissions(java.util.List permissions) { + Utils.checkNotNull(permissions, "permissions"); + this.permissions = Optional.ofNullable(permissions); + return this; + } + + public Builder permissions(Optional> permissions) { + Utils.checkNotNull(permissions, "permissions"); + this.permissions = permissions; + return this; + } + + /** + * Metadata saved on the organization membership, accessible from both Frontend and Backend APIs + */ + public Builder publicMetadata(OrganizationMembershipPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization membership, accessible from both Frontend and Backend APIs + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization membership, accessible only from the Backend API + */ + public Builder privateMetadata(OrganizationMembershipPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization membership, accessible only from the Backend API + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public Builder organization(OrganizationMembershipOrganization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + public Builder organization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + public Builder publicUserData(PublicUserData publicUserData) { + Utils.checkNotNull(publicUserData, "publicUserData"); + this.publicUserData = Optional.ofNullable(publicUserData); + return this; + } + + public Builder publicUserData(Optional publicUserData) { + Utils.checkNotNull(publicUserData, "publicUserData"); + this.publicUserData = publicUserData; + return this; + } + + /** + * Unix timestamp of creation. + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation. + */ + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + */ + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public OrganizationMembership build() { + return new OrganizationMembership( + id, + object, + role, + permissions, + publicMetadata, + privateMetadata, + organization, + publicUserData, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipObject.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipObject.java new file mode 100644 index 0000000..b9e9e95 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * OrganizationMembershipObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum OrganizationMembershipObject { + ORGANIZATION_MEMBERSHIP("organization_membership"); + + @JsonValue + private final String value; + + private OrganizationMembershipObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganization.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganization.java new file mode 100644 index 0000000..3eafa35 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganization.java @@ -0,0 +1,500 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class OrganizationMembershipOrganization { + + @JsonProperty("object") + private OrganizationMembershipOrganizationObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("slug") + private String slug; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("members_count") + private JsonNullable membersCount; + + @JsonProperty("max_allowed_memberships") + private long maxAllowedMemberships; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("admin_delete_enabled") + private Optional adminDeleteEnabled; + + @JsonProperty("public_metadata") + private OrganizationMembershipOrganizationPublicMetadata publicMetadata; + + @JsonProperty("private_metadata") + private OrganizationMembershipOrganizationPrivateMetadata privateMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_by") + private Optional createdBy; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public OrganizationMembershipOrganization( + @JsonProperty("object") OrganizationMembershipOrganizationObject object, + @JsonProperty("id") String id, + @JsonProperty("name") String name, + @JsonProperty("slug") String slug, + @JsonProperty("members_count") JsonNullable membersCount, + @JsonProperty("max_allowed_memberships") long maxAllowedMemberships, + @JsonProperty("admin_delete_enabled") Optional adminDeleteEnabled, + @JsonProperty("public_metadata") OrganizationMembershipOrganizationPublicMetadata publicMetadata, + @JsonProperty("private_metadata") OrganizationMembershipOrganizationPrivateMetadata privateMetadata, + @JsonProperty("created_by") Optional createdBy, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(membersCount, "membersCount"); + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(createdBy, "createdBy"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.name = name; + this.slug = slug; + this.membersCount = membersCount; + this.maxAllowedMemberships = maxAllowedMemberships; + this.adminDeleteEnabled = adminDeleteEnabled; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.createdBy = createdBy; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public OrganizationMembershipOrganization( + OrganizationMembershipOrganizationObject object, + String id, + String name, + String slug, + long maxAllowedMemberships, + OrganizationMembershipOrganizationPublicMetadata publicMetadata, + OrganizationMembershipOrganizationPrivateMetadata privateMetadata, + long createdAt, + long updatedAt) { + this(object, id, name, slug, JsonNullable.undefined(), maxAllowedMemberships, Optional.empty(), publicMetadata, privateMetadata, Optional.empty(), createdAt, updatedAt); + } + + @JsonIgnore + public OrganizationMembershipOrganizationObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public String slug() { + return slug; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable membersCount() { + return (JsonNullable) membersCount; + } + + @JsonIgnore + public long maxAllowedMemberships() { + return maxAllowedMemberships; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional adminDeleteEnabled() { + return (Optional) adminDeleteEnabled; + } + + @JsonIgnore + public OrganizationMembershipOrganizationPublicMetadata publicMetadata() { + return publicMetadata; + } + + @JsonIgnore + public OrganizationMembershipOrganizationPrivateMetadata privateMetadata() { + return privateMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdBy() { + return (Optional) createdBy; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public OrganizationMembershipOrganization withObject(OrganizationMembershipOrganizationObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public OrganizationMembershipOrganization withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public OrganizationMembershipOrganization withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public OrganizationMembershipOrganization withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public OrganizationMembershipOrganization withMembersCount(long membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = JsonNullable.of(membersCount); + return this; + } + + public OrganizationMembershipOrganization withMembersCount(JsonNullable membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = membersCount; + return this; + } + + public OrganizationMembershipOrganization withMaxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public OrganizationMembershipOrganization withAdminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = Optional.ofNullable(adminDeleteEnabled); + return this; + } + + public OrganizationMembershipOrganization withAdminDeleteEnabled(Optional adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public OrganizationMembershipOrganization withPublicMetadata(OrganizationMembershipOrganizationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public OrganizationMembershipOrganization withPrivateMetadata(OrganizationMembershipOrganizationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public OrganizationMembershipOrganization withCreatedBy(String createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + public OrganizationMembershipOrganization withCreatedBy(Optional createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = createdBy; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public OrganizationMembershipOrganization withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public OrganizationMembershipOrganization withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationMembershipOrganization other = (OrganizationMembershipOrganization) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.membersCount, other.membersCount) && + java.util.Objects.deepEquals(this.maxAllowedMemberships, other.maxAllowedMemberships) && + java.util.Objects.deepEquals(this.adminDeleteEnabled, other.adminDeleteEnabled) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.createdBy, other.createdBy) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + name, + slug, + membersCount, + maxAllowedMemberships, + adminDeleteEnabled, + publicMetadata, + privateMetadata, + createdBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(OrganizationMembershipOrganization.class, + "object", object, + "id", id, + "name", name, + "slug", slug, + "membersCount", membersCount, + "maxAllowedMemberships", maxAllowedMemberships, + "adminDeleteEnabled", adminDeleteEnabled, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "createdBy", createdBy, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private OrganizationMembershipOrganizationObject object; + + private String id; + + private String name; + + private String slug; + + private JsonNullable membersCount = JsonNullable.undefined(); + + private Long maxAllowedMemberships; + + private Optional adminDeleteEnabled = Optional.empty(); + + private OrganizationMembershipOrganizationPublicMetadata publicMetadata; + + private OrganizationMembershipOrganizationPrivateMetadata privateMetadata; + + private Optional createdBy = Optional.empty(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(OrganizationMembershipOrganizationObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder membersCount(long membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = JsonNullable.of(membersCount); + return this; + } + + public Builder membersCount(JsonNullable membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = membersCount; + return this; + } + + public Builder maxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public Builder adminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = Optional.ofNullable(adminDeleteEnabled); + return this; + } + + public Builder adminDeleteEnabled(Optional adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public Builder publicMetadata(OrganizationMembershipOrganizationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder privateMetadata(OrganizationMembershipOrganizationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public Builder createdBy(String createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + public Builder createdBy(Optional createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = createdBy; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public OrganizationMembershipOrganization build() { + return new OrganizationMembershipOrganization( + object, + id, + name, + slug, + membersCount, + maxAllowedMemberships, + adminDeleteEnabled, + publicMetadata, + privateMetadata, + createdBy, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationObject.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationObject.java new file mode 100644 index 0000000..0090a76 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OrganizationMembershipOrganizationObject { + ORGANIZATION("organization"); + + @JsonValue + private final String value; + + private OrganizationMembershipOrganizationObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationPrivateMetadata.java new file mode 100644 index 0000000..09d4693 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationPrivateMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationMembershipOrganizationPrivateMetadata { + + @JsonCreator + public OrganizationMembershipOrganizationPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationMembershipOrganizationPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationMembershipOrganizationPrivateMetadata build() { + return new OrganizationMembershipOrganizationPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationPublicMetadata.java new file mode 100644 index 0000000..2218789 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipOrganizationPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationMembershipOrganizationPublicMetadata { + + @JsonCreator + public OrganizationMembershipOrganizationPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationMembershipOrganizationPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationMembershipOrganizationPublicMetadata build() { + return new OrganizationMembershipOrganizationPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipPrivateMetadata.java new file mode 100644 index 0000000..55de95c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipPrivateMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * OrganizationMembershipPrivateMetadata - Metadata saved on the organization membership, accessible only from the Backend API + */ + +public class OrganizationMembershipPrivateMetadata { + + @JsonCreator + public OrganizationMembershipPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationMembershipPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationMembershipPrivateMetadata build() { + return new OrganizationMembershipPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipPublicMetadata.java new file mode 100644 index 0000000..4af1165 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMembershipPublicMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * OrganizationMembershipPublicMetadata - Metadata saved on the organization membership, accessible from both Frontend and Backend APIs + */ + +public class OrganizationMembershipPublicMetadata { + + @JsonCreator + public OrganizationMembershipPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationMembershipPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationMembershipPublicMetadata build() { + return new OrganizationMembershipPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationMemberships.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationMemberships.java new file mode 100644 index 0000000..ed9e43f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationMemberships.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationMemberships { + + @JsonProperty("data") + private java.util.List data; + + /** + * Total number of organization memberships + * + */ + @JsonProperty("total_count") + private long totalCount; + + @JsonCreator + public OrganizationMemberships( + @JsonProperty("data") java.util.List data, + @JsonProperty("total_count") long totalCount) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(totalCount, "totalCount"); + this.data = data; + this.totalCount = totalCount; + } + + @JsonIgnore + public java.util.List data() { + return data; + } + + /** + * Total number of organization memberships + * + */ + @JsonIgnore + public long totalCount() { + return totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + public OrganizationMemberships withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of organization memberships + * + */ + public OrganizationMemberships withTotalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationMemberships other = (OrganizationMemberships) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(OrganizationMemberships.class, + "data", data, + "totalCount", totalCount); + } + + public final static class Builder { + + private java.util.List data; + + private Long totalCount; + + private Builder() { + // force use of static builder() method + } + + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of organization memberships + * + */ + public Builder totalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public OrganizationMemberships build() { + return new OrganizationMemberships( + data, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationObject.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationObject.java new file mode 100644 index 0000000..695ff48 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OrganizationObject { + ORGANIZATION("organization"); + + @JsonValue + private final String value; + + private OrganizationObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationPrivateMetadata.java new file mode 100644 index 0000000..a48680d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationPrivateMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationPrivateMetadata { + + @JsonCreator + public OrganizationPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationPrivateMetadata build() { + return new OrganizationPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationPublicMetadata.java new file mode 100644 index 0000000..7669276 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationPublicMetadata { + + @JsonCreator + public OrganizationPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationPublicMetadata build() { + return new OrganizationPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationSettings.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationSettings.java new file mode 100644 index 0000000..ad98854 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationSettings.java @@ -0,0 +1,442 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class OrganizationSettings { + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + @JsonProperty("object") + private OrganizationSettingsObject object; + + @JsonProperty("enabled") + private boolean enabled; + + @JsonProperty("max_allowed_memberships") + private long maxAllowedMemberships; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("max_allowed_roles") + private Optional maxAllowedRoles; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("max_allowed_permissions") + private Optional maxAllowedPermissions; + + /** + * The role key that a user will be assigned after creating an organization. + */ + @JsonProperty("creator_role") + private String creatorRole; + + /** + * The default for whether an admin can delete an organization with the Frontend API. + */ + @JsonProperty("admin_delete_enabled") + private boolean adminDeleteEnabled; + + @JsonProperty("domains_enabled") + private boolean domainsEnabled; + + @JsonProperty("domains_enrollment_modes") + private java.util.List domainsEnrollmentModes; + + /** + * The role key that it will be used in order to create an organization invitation or suggestion. + */ + @JsonProperty("domains_default_role") + private String domainsDefaultRole; + + @JsonCreator + public OrganizationSettings( + @JsonProperty("object") OrganizationSettingsObject object, + @JsonProperty("enabled") boolean enabled, + @JsonProperty("max_allowed_memberships") long maxAllowedMemberships, + @JsonProperty("max_allowed_roles") Optional maxAllowedRoles, + @JsonProperty("max_allowed_permissions") Optional maxAllowedPermissions, + @JsonProperty("creator_role") String creatorRole, + @JsonProperty("admin_delete_enabled") boolean adminDeleteEnabled, + @JsonProperty("domains_enabled") boolean domainsEnabled, + @JsonProperty("domains_enrollment_modes") java.util.List domainsEnrollmentModes, + @JsonProperty("domains_default_role") String domainsDefaultRole) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(enabled, "enabled"); + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + Utils.checkNotNull(maxAllowedRoles, "maxAllowedRoles"); + Utils.checkNotNull(maxAllowedPermissions, "maxAllowedPermissions"); + Utils.checkNotNull(creatorRole, "creatorRole"); + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + Utils.checkNotNull(domainsEnabled, "domainsEnabled"); + Utils.checkNotNull(domainsEnrollmentModes, "domainsEnrollmentModes"); + Utils.checkNotNull(domainsDefaultRole, "domainsDefaultRole"); + this.object = object; + this.enabled = enabled; + this.maxAllowedMemberships = maxAllowedMemberships; + this.maxAllowedRoles = maxAllowedRoles; + this.maxAllowedPermissions = maxAllowedPermissions; + this.creatorRole = creatorRole; + this.adminDeleteEnabled = adminDeleteEnabled; + this.domainsEnabled = domainsEnabled; + this.domainsEnrollmentModes = domainsEnrollmentModes; + this.domainsDefaultRole = domainsDefaultRole; + } + + public OrganizationSettings( + OrganizationSettingsObject object, + boolean enabled, + long maxAllowedMemberships, + String creatorRole, + boolean adminDeleteEnabled, + boolean domainsEnabled, + java.util.List domainsEnrollmentModes, + String domainsDefaultRole) { + this(object, enabled, maxAllowedMemberships, Optional.empty(), Optional.empty(), creatorRole, adminDeleteEnabled, domainsEnabled, domainsEnrollmentModes, domainsDefaultRole); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + @JsonIgnore + public OrganizationSettingsObject object() { + return object; + } + + @JsonIgnore + public boolean enabled() { + return enabled; + } + + @JsonIgnore + public long maxAllowedMemberships() { + return maxAllowedMemberships; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional maxAllowedRoles() { + return (Optional) maxAllowedRoles; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional maxAllowedPermissions() { + return (Optional) maxAllowedPermissions; + } + + /** + * The role key that a user will be assigned after creating an organization. + */ + @JsonIgnore + public String creatorRole() { + return creatorRole; + } + + /** + * The default for whether an admin can delete an organization with the Frontend API. + */ + @JsonIgnore + public boolean adminDeleteEnabled() { + return adminDeleteEnabled; + } + + @JsonIgnore + public boolean domainsEnabled() { + return domainsEnabled; + } + + @JsonIgnore + public java.util.List domainsEnrollmentModes() { + return domainsEnrollmentModes; + } + + /** + * The role key that it will be used in order to create an organization invitation or suggestion. + */ + @JsonIgnore + public String domainsDefaultRole() { + return domainsDefaultRole; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public OrganizationSettings withObject(OrganizationSettingsObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public OrganizationSettings withEnabled(boolean enabled) { + Utils.checkNotNull(enabled, "enabled"); + this.enabled = enabled; + return this; + } + + public OrganizationSettings withMaxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public OrganizationSettings withMaxAllowedRoles(long maxAllowedRoles) { + Utils.checkNotNull(maxAllowedRoles, "maxAllowedRoles"); + this.maxAllowedRoles = Optional.ofNullable(maxAllowedRoles); + return this; + } + + public OrganizationSettings withMaxAllowedRoles(Optional maxAllowedRoles) { + Utils.checkNotNull(maxAllowedRoles, "maxAllowedRoles"); + this.maxAllowedRoles = maxAllowedRoles; + return this; + } + + public OrganizationSettings withMaxAllowedPermissions(long maxAllowedPermissions) { + Utils.checkNotNull(maxAllowedPermissions, "maxAllowedPermissions"); + this.maxAllowedPermissions = Optional.ofNullable(maxAllowedPermissions); + return this; + } + + public OrganizationSettings withMaxAllowedPermissions(Optional maxAllowedPermissions) { + Utils.checkNotNull(maxAllowedPermissions, "maxAllowedPermissions"); + this.maxAllowedPermissions = maxAllowedPermissions; + return this; + } + + /** + * The role key that a user will be assigned after creating an organization. + */ + public OrganizationSettings withCreatorRole(String creatorRole) { + Utils.checkNotNull(creatorRole, "creatorRole"); + this.creatorRole = creatorRole; + return this; + } + + /** + * The default for whether an admin can delete an organization with the Frontend API. + */ + public OrganizationSettings withAdminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public OrganizationSettings withDomainsEnabled(boolean domainsEnabled) { + Utils.checkNotNull(domainsEnabled, "domainsEnabled"); + this.domainsEnabled = domainsEnabled; + return this; + } + + public OrganizationSettings withDomainsEnrollmentModes(java.util.List domainsEnrollmentModes) { + Utils.checkNotNull(domainsEnrollmentModes, "domainsEnrollmentModes"); + this.domainsEnrollmentModes = domainsEnrollmentModes; + return this; + } + + /** + * The role key that it will be used in order to create an organization invitation or suggestion. + */ + public OrganizationSettings withDomainsDefaultRole(String domainsDefaultRole) { + Utils.checkNotNull(domainsDefaultRole, "domainsDefaultRole"); + this.domainsDefaultRole = domainsDefaultRole; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationSettings other = (OrganizationSettings) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.enabled, other.enabled) && + java.util.Objects.deepEquals(this.maxAllowedMemberships, other.maxAllowedMemberships) && + java.util.Objects.deepEquals(this.maxAllowedRoles, other.maxAllowedRoles) && + java.util.Objects.deepEquals(this.maxAllowedPermissions, other.maxAllowedPermissions) && + java.util.Objects.deepEquals(this.creatorRole, other.creatorRole) && + java.util.Objects.deepEquals(this.adminDeleteEnabled, other.adminDeleteEnabled) && + java.util.Objects.deepEquals(this.domainsEnabled, other.domainsEnabled) && + java.util.Objects.deepEquals(this.domainsEnrollmentModes, other.domainsEnrollmentModes) && + java.util.Objects.deepEquals(this.domainsDefaultRole, other.domainsDefaultRole); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + enabled, + maxAllowedMemberships, + maxAllowedRoles, + maxAllowedPermissions, + creatorRole, + adminDeleteEnabled, + domainsEnabled, + domainsEnrollmentModes, + domainsDefaultRole); + } + + @Override + public String toString() { + return Utils.toString(OrganizationSettings.class, + "object", object, + "enabled", enabled, + "maxAllowedMemberships", maxAllowedMemberships, + "maxAllowedRoles", maxAllowedRoles, + "maxAllowedPermissions", maxAllowedPermissions, + "creatorRole", creatorRole, + "adminDeleteEnabled", adminDeleteEnabled, + "domainsEnabled", domainsEnabled, + "domainsEnrollmentModes", domainsEnrollmentModes, + "domainsDefaultRole", domainsDefaultRole); + } + + public final static class Builder { + + private OrganizationSettingsObject object; + + private Boolean enabled; + + private Long maxAllowedMemberships; + + private Optional maxAllowedRoles = Optional.empty(); + + private Optional maxAllowedPermissions = Optional.empty(); + + private String creatorRole; + + private Boolean adminDeleteEnabled; + + private Boolean domainsEnabled; + + private java.util.List domainsEnrollmentModes; + + private String domainsDefaultRole; + + private Builder() { + // force use of static builder() method + } + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + public Builder object(OrganizationSettingsObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder enabled(boolean enabled) { + Utils.checkNotNull(enabled, "enabled"); + this.enabled = enabled; + return this; + } + + public Builder maxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public Builder maxAllowedRoles(long maxAllowedRoles) { + Utils.checkNotNull(maxAllowedRoles, "maxAllowedRoles"); + this.maxAllowedRoles = Optional.ofNullable(maxAllowedRoles); + return this; + } + + public Builder maxAllowedRoles(Optional maxAllowedRoles) { + Utils.checkNotNull(maxAllowedRoles, "maxAllowedRoles"); + this.maxAllowedRoles = maxAllowedRoles; + return this; + } + + public Builder maxAllowedPermissions(long maxAllowedPermissions) { + Utils.checkNotNull(maxAllowedPermissions, "maxAllowedPermissions"); + this.maxAllowedPermissions = Optional.ofNullable(maxAllowedPermissions); + return this; + } + + public Builder maxAllowedPermissions(Optional maxAllowedPermissions) { + Utils.checkNotNull(maxAllowedPermissions, "maxAllowedPermissions"); + this.maxAllowedPermissions = maxAllowedPermissions; + return this; + } + + /** + * The role key that a user will be assigned after creating an organization. + */ + public Builder creatorRole(String creatorRole) { + Utils.checkNotNull(creatorRole, "creatorRole"); + this.creatorRole = creatorRole; + return this; + } + + /** + * The default for whether an admin can delete an organization with the Frontend API. + */ + public Builder adminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public Builder domainsEnabled(boolean domainsEnabled) { + Utils.checkNotNull(domainsEnabled, "domainsEnabled"); + this.domainsEnabled = domainsEnabled; + return this; + } + + public Builder domainsEnrollmentModes(java.util.List domainsEnrollmentModes) { + Utils.checkNotNull(domainsEnrollmentModes, "domainsEnrollmentModes"); + this.domainsEnrollmentModes = domainsEnrollmentModes; + return this; + } + + /** + * The role key that it will be used in order to create an organization invitation or suggestion. + */ + public Builder domainsDefaultRole(String domainsDefaultRole) { + Utils.checkNotNull(domainsDefaultRole, "domainsDefaultRole"); + this.domainsDefaultRole = domainsDefaultRole; + return this; + } + + public OrganizationSettings build() { + return new OrganizationSettings( + object, + enabled, + maxAllowedMemberships, + maxAllowedRoles, + maxAllowedPermissions, + creatorRole, + adminDeleteEnabled, + domainsEnabled, + domainsEnrollmentModes, + domainsDefaultRole); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationSettingsObject.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationSettingsObject.java new file mode 100644 index 0000000..078dc76 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationSettingsObject.java @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * OrganizationSettingsObject - String representing the object's type. Objects of the same type share the same value. + */ +public enum OrganizationSettingsObject { + ORGANIZATION_SETTINGS("organization_settings"); + + @JsonValue + private final String value; + + private OrganizationSettingsObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogo.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogo.java new file mode 100644 index 0000000..bae517a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogo.java @@ -0,0 +1,641 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class OrganizationWithLogo { + + @JsonProperty("object") + private OrganizationWithLogoObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("slug") + private String slug; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("members_count") + private JsonNullable membersCount; + + @JsonProperty("max_allowed_memberships") + private long maxAllowedMemberships; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("admin_delete_enabled") + private Optional adminDeleteEnabled; + + @JsonProperty("public_metadata") + private OrganizationWithLogoPublicMetadata publicMetadata; + + @JsonProperty("private_metadata") + private OrganizationWithLogoPrivateMetadata privateMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_by") + private Optional createdBy; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("logo_url") + @Deprecated + private Optional logoUrl; + + @JsonProperty("image_url") + private String imageUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("has_image") + private Optional hasImage; + + @JsonCreator + public OrganizationWithLogo( + @JsonProperty("object") OrganizationWithLogoObject object, + @JsonProperty("id") String id, + @JsonProperty("name") String name, + @JsonProperty("slug") String slug, + @JsonProperty("members_count") JsonNullable membersCount, + @JsonProperty("max_allowed_memberships") long maxAllowedMemberships, + @JsonProperty("admin_delete_enabled") Optional adminDeleteEnabled, + @JsonProperty("public_metadata") OrganizationWithLogoPublicMetadata publicMetadata, + @JsonProperty("private_metadata") OrganizationWithLogoPrivateMetadata privateMetadata, + @JsonProperty("created_by") Optional createdBy, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt, + @JsonProperty("logo_url") Optional logoUrl, + @JsonProperty("image_url") String imageUrl, + @JsonProperty("has_image") Optional hasImage) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(membersCount, "membersCount"); + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(createdBy, "createdBy"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(logoUrl, "logoUrl"); + Utils.checkNotNull(imageUrl, "imageUrl"); + Utils.checkNotNull(hasImage, "hasImage"); + this.object = object; + this.id = id; + this.name = name; + this.slug = slug; + this.membersCount = membersCount; + this.maxAllowedMemberships = maxAllowedMemberships; + this.adminDeleteEnabled = adminDeleteEnabled; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.createdBy = createdBy; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.logoUrl = logoUrl; + this.imageUrl = imageUrl; + this.hasImage = hasImage; + } + + public OrganizationWithLogo( + OrganizationWithLogoObject object, + String id, + String name, + String slug, + long maxAllowedMemberships, + OrganizationWithLogoPublicMetadata publicMetadata, + OrganizationWithLogoPrivateMetadata privateMetadata, + long createdAt, + long updatedAt, + String imageUrl) { + this(object, id, name, slug, JsonNullable.undefined(), maxAllowedMemberships, Optional.empty(), publicMetadata, privateMetadata, Optional.empty(), createdAt, updatedAt, Optional.empty(), imageUrl, Optional.empty()); + } + + @JsonIgnore + public OrganizationWithLogoObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public String slug() { + return slug; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable membersCount() { + return (JsonNullable) membersCount; + } + + @JsonIgnore + public long maxAllowedMemberships() { + return maxAllowedMemberships; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional adminDeleteEnabled() { + return (Optional) adminDeleteEnabled; + } + + @JsonIgnore + public OrganizationWithLogoPublicMetadata publicMetadata() { + return publicMetadata; + } + + @JsonIgnore + public OrganizationWithLogoPrivateMetadata privateMetadata() { + return privateMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdBy() { + return (Optional) createdBy; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional logoUrl() { + return (Optional) logoUrl; + } + + @JsonIgnore + public String imageUrl() { + return imageUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasImage() { + return (Optional) hasImage; + } + + public final static Builder builder() { + return new Builder(); + } + + public OrganizationWithLogo withObject(OrganizationWithLogoObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public OrganizationWithLogo withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public OrganizationWithLogo withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public OrganizationWithLogo withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public OrganizationWithLogo withMembersCount(long membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = JsonNullable.of(membersCount); + return this; + } + + public OrganizationWithLogo withMembersCount(JsonNullable membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = membersCount; + return this; + } + + public OrganizationWithLogo withMaxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public OrganizationWithLogo withAdminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = Optional.ofNullable(adminDeleteEnabled); + return this; + } + + public OrganizationWithLogo withAdminDeleteEnabled(Optional adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public OrganizationWithLogo withPublicMetadata(OrganizationWithLogoPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public OrganizationWithLogo withPrivateMetadata(OrganizationWithLogoPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public OrganizationWithLogo withCreatedBy(String createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + public OrganizationWithLogo withCreatedBy(Optional createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = createdBy; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public OrganizationWithLogo withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public OrganizationWithLogo withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public OrganizationWithLogo withLogoUrl(String logoUrl) { + Utils.checkNotNull(logoUrl, "logoUrl"); + this.logoUrl = Optional.ofNullable(logoUrl); + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public OrganizationWithLogo withLogoUrl(Optional logoUrl) { + Utils.checkNotNull(logoUrl, "logoUrl"); + this.logoUrl = logoUrl; + return this; + } + + public OrganizationWithLogo withImageUrl(String imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = imageUrl; + return this; + } + + public OrganizationWithLogo withHasImage(boolean hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = Optional.ofNullable(hasImage); + return this; + } + + public OrganizationWithLogo withHasImage(Optional hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = hasImage; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationWithLogo other = (OrganizationWithLogo) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.membersCount, other.membersCount) && + java.util.Objects.deepEquals(this.maxAllowedMemberships, other.maxAllowedMemberships) && + java.util.Objects.deepEquals(this.adminDeleteEnabled, other.adminDeleteEnabled) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.createdBy, other.createdBy) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.logoUrl, other.logoUrl) && + java.util.Objects.deepEquals(this.imageUrl, other.imageUrl) && + java.util.Objects.deepEquals(this.hasImage, other.hasImage); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + name, + slug, + membersCount, + maxAllowedMemberships, + adminDeleteEnabled, + publicMetadata, + privateMetadata, + createdBy, + createdAt, + updatedAt, + logoUrl, + imageUrl, + hasImage); + } + + @Override + public String toString() { + return Utils.toString(OrganizationWithLogo.class, + "object", object, + "id", id, + "name", name, + "slug", slug, + "membersCount", membersCount, + "maxAllowedMemberships", maxAllowedMemberships, + "adminDeleteEnabled", adminDeleteEnabled, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "createdBy", createdBy, + "createdAt", createdAt, + "updatedAt", updatedAt, + "logoUrl", logoUrl, + "imageUrl", imageUrl, + "hasImage", hasImage); + } + + public final static class Builder { + + private OrganizationWithLogoObject object; + + private String id; + + private String name; + + private String slug; + + private JsonNullable membersCount = JsonNullable.undefined(); + + private Long maxAllowedMemberships; + + private Optional adminDeleteEnabled = Optional.empty(); + + private OrganizationWithLogoPublicMetadata publicMetadata; + + private OrganizationWithLogoPrivateMetadata privateMetadata; + + private Optional createdBy = Optional.empty(); + + private Long createdAt; + + private Long updatedAt; + + @Deprecated + private Optional logoUrl = Optional.empty(); + + private String imageUrl; + + private Optional hasImage = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder object(OrganizationWithLogoObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder membersCount(long membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = JsonNullable.of(membersCount); + return this; + } + + public Builder membersCount(JsonNullable membersCount) { + Utils.checkNotNull(membersCount, "membersCount"); + this.membersCount = membersCount; + return this; + } + + public Builder maxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public Builder adminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = Optional.ofNullable(adminDeleteEnabled); + return this; + } + + public Builder adminDeleteEnabled(Optional adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public Builder publicMetadata(OrganizationWithLogoPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder privateMetadata(OrganizationWithLogoPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public Builder createdBy(String createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + public Builder createdBy(Optional createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = createdBy; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder logoUrl(String logoUrl) { + Utils.checkNotNull(logoUrl, "logoUrl"); + this.logoUrl = Optional.ofNullable(logoUrl); + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder logoUrl(Optional logoUrl) { + Utils.checkNotNull(logoUrl, "logoUrl"); + this.logoUrl = logoUrl; + return this; + } + + public Builder imageUrl(String imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = imageUrl; + return this; + } + + public Builder hasImage(boolean hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = Optional.ofNullable(hasImage); + return this; + } + + public Builder hasImage(Optional hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = hasImage; + return this; + } + + public OrganizationWithLogo build() { + return new OrganizationWithLogo( + object, + id, + name, + slug, + membersCount, + maxAllowedMemberships, + adminDeleteEnabled, + publicMetadata, + privateMetadata, + createdBy, + createdAt, + updatedAt, + logoUrl, + imageUrl, + hasImage); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoObject.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoObject.java new file mode 100644 index 0000000..c7d6593 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum OrganizationWithLogoObject { + ORGANIZATION("organization"); + + @JsonValue + private final String value; + + private OrganizationWithLogoObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoPrivateMetadata.java new file mode 100644 index 0000000..874727c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoPrivateMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationWithLogoPrivateMetadata { + + @JsonCreator + public OrganizationWithLogoPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationWithLogoPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationWithLogoPrivateMetadata build() { + return new OrganizationWithLogoPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoPublicMetadata.java new file mode 100644 index 0000000..3adfb21 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/OrganizationWithLogoPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class OrganizationWithLogoPublicMetadata { + + @JsonCreator + public OrganizationWithLogoPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(OrganizationWithLogoPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public OrganizationWithLogoPublicMetadata build() { + return new OrganizationWithLogoPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Organizations.java b/src/main/java/com/clerk/backend_api/models/components/Organizations.java new file mode 100644 index 0000000..9688344 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Organizations.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Organizations { + + @JsonProperty("data") + private java.util.List data; + + /** + * Total number of organizations + * + */ + @JsonProperty("total_count") + private long totalCount; + + @JsonCreator + public Organizations( + @JsonProperty("data") java.util.List data, + @JsonProperty("total_count") long totalCount) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(totalCount, "totalCount"); + this.data = data; + this.totalCount = totalCount; + } + + @JsonIgnore + public java.util.List data() { + return data; + } + + /** + * Total number of organizations + * + */ + @JsonIgnore + public long totalCount() { + return totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + public Organizations withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of organizations + * + */ + public Organizations withTotalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Organizations other = (Organizations) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(Organizations.class, + "data", data, + "totalCount", totalCount); + } + + public final static class Builder { + + private java.util.List data; + + private Long totalCount; + + private Builder() { + // force use of static builder() method + } + + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of organizations + * + */ + public Builder totalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public Organizations build() { + return new Organizations( + data, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Otp.java b/src/main/java/com/clerk/backend_api/models/components/Otp.java new file mode 100644 index 0000000..afcd23f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Otp.java @@ -0,0 +1,177 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Otp { + + @JsonProperty("status") + private VerificationStatus status; + + @JsonProperty("strategy") + private Strategy strategy; + + @JsonProperty("attempts") + private long attempts; + + @JsonProperty("expire_at") + private long expireAt; + + @JsonCreator + public Otp( + @JsonProperty("status") VerificationStatus status, + @JsonProperty("strategy") Strategy strategy, + @JsonProperty("attempts") long attempts, + @JsonProperty("expire_at") long expireAt) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(attempts, "attempts"); + Utils.checkNotNull(expireAt, "expireAt"); + this.status = status; + this.strategy = strategy; + this.attempts = attempts; + this.expireAt = expireAt; + } + + @JsonIgnore + public VerificationStatus status() { + return status; + } + + @JsonIgnore + public Strategy strategy() { + return strategy; + } + + @JsonIgnore + public long attempts() { + return attempts; + } + + @JsonIgnore + public long expireAt() { + return expireAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Otp withStatus(VerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Otp withStrategy(Strategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Otp withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Otp withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Otp other = (Otp) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.attempts, other.attempts) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + attempts, + expireAt); + } + + @Override + public String toString() { + return Utils.toString(Otp.class, + "status", status, + "strategy", strategy, + "attempts", attempts, + "expireAt", expireAt); + } + + public final static class Builder { + + private VerificationStatus status; + + private Strategy strategy; + + private Long attempts; + + private Long expireAt; + + private Builder() { + // force use of static builder() method + } + + public Builder status(VerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(Strategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Otp build() { + return new Otp( + status, + strategy, + attempts, + expireAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Passkey.java b/src/main/java/com/clerk/backend_api/models/components/Passkey.java new file mode 100644 index 0000000..122f363 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Passkey.java @@ -0,0 +1,258 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Passkey { + + @JsonProperty("status") + private PasskeyVerificationStatus status; + + @JsonProperty("strategy") + private PasskeyVerificationStrategy strategy; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("nonce") + private Optional nonce; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attempts") + private JsonNullable attempts; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expire_at") + private JsonNullable expireAt; + + @JsonCreator + public Passkey( + @JsonProperty("status") PasskeyVerificationStatus status, + @JsonProperty("strategy") PasskeyVerificationStrategy strategy, + @JsonProperty("nonce") Optional nonce, + @JsonProperty("attempts") JsonNullable attempts, + @JsonProperty("expire_at") JsonNullable expireAt) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(nonce, "nonce"); + Utils.checkNotNull(attempts, "attempts"); + Utils.checkNotNull(expireAt, "expireAt"); + this.status = status; + this.strategy = strategy; + this.nonce = nonce; + this.attempts = attempts; + this.expireAt = expireAt; + } + + public Passkey( + PasskeyVerificationStatus status, + PasskeyVerificationStrategy strategy) { + this(status, strategy, Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + @JsonIgnore + public PasskeyVerificationStatus status() { + return status; + } + + @JsonIgnore + public PasskeyVerificationStrategy strategy() { + return strategy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional nonce() { + return (Optional) nonce; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attempts() { + return (JsonNullable) attempts; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable expireAt() { + return (JsonNullable) expireAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Passkey withStatus(PasskeyVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Passkey withStrategy(PasskeyVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Passkey withNonce(VerificationNonce nonce) { + Utils.checkNotNull(nonce, "nonce"); + this.nonce = Optional.ofNullable(nonce); + return this; + } + + public Passkey withNonce(Optional nonce) { + Utils.checkNotNull(nonce, "nonce"); + this.nonce = nonce; + return this; + } + + public Passkey withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Passkey withAttempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Passkey withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Passkey withExpireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Passkey other = (Passkey) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.nonce, other.nonce) && + java.util.Objects.deepEquals(this.attempts, other.attempts) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + nonce, + attempts, + expireAt); + } + + @Override + public String toString() { + return Utils.toString(Passkey.class, + "status", status, + "strategy", strategy, + "nonce", nonce, + "attempts", attempts, + "expireAt", expireAt); + } + + public final static class Builder { + + private PasskeyVerificationStatus status; + + private PasskeyVerificationStrategy strategy; + + private Optional nonce = Optional.empty(); + + private JsonNullable attempts = JsonNullable.undefined(); + + private JsonNullable expireAt = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder status(PasskeyVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(PasskeyVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder nonce(VerificationNonce nonce) { + Utils.checkNotNull(nonce, "nonce"); + this.nonce = Optional.ofNullable(nonce); + return this; + } + + public Builder nonce(Optional nonce) { + Utils.checkNotNull(nonce, "nonce"); + this.nonce = nonce; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Builder attempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Builder expireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Passkey build() { + return new Passkey( + status, + strategy, + nonce, + attempts, + expireAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/PasskeyVerificationStatus.java b/src/main/java/com/clerk/backend_api/models/components/PasskeyVerificationStatus.java new file mode 100644 index 0000000..6747ddb --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/PasskeyVerificationStatus.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum PasskeyVerificationStatus { + VERIFIED("verified"); + + @JsonValue + private final String value; + + private PasskeyVerificationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/PasskeyVerificationStrategy.java b/src/main/java/com/clerk/backend_api/models/components/PasskeyVerificationStrategy.java new file mode 100644 index 0000000..0bfc3e3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/PasskeyVerificationStrategy.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum PasskeyVerificationStrategy { + PASSKEY("passkey"); + + @JsonValue + private final String value; + + private PasskeyVerificationStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/PhoneNumber.java b/src/main/java/com/clerk/backend_api/models/components/PhoneNumber.java new file mode 100644 index 0000000..d08e0ae --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/PhoneNumber.java @@ -0,0 +1,512 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class PhoneNumber { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonProperty("object") + private PhoneNumberObject object; + + @JsonProperty("phone_number") + private String phoneNumber; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reserved_for_second_factor") + private Optional reservedForSecondFactor; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("default_second_factor") + private Optional defaultSecondFactor; + + @JsonProperty("reserved") + private boolean reserved; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("verification") + private Optional verification; + + @JsonProperty("linked_to") + private java.util.List linkedTo; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("backup_codes") + private JsonNullable> backupCodes; + + /** + * Unix timestamp of creation + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of creation + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public PhoneNumber( + @JsonProperty("id") Optional id, + @JsonProperty("object") PhoneNumberObject object, + @JsonProperty("phone_number") String phoneNumber, + @JsonProperty("reserved_for_second_factor") Optional reservedForSecondFactor, + @JsonProperty("default_second_factor") Optional defaultSecondFactor, + @JsonProperty("reserved") boolean reserved, + @JsonProperty("verification") Optional verification, + @JsonProperty("linked_to") java.util.List linkedTo, + @JsonProperty("backup_codes") JsonNullable> backupCodes, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + Utils.checkNotNull(defaultSecondFactor, "defaultSecondFactor"); + Utils.checkNotNull(reserved, "reserved"); + Utils.checkNotNull(verification, "verification"); + Utils.checkNotNull(linkedTo, "linkedTo"); + Utils.checkNotNull(backupCodes, "backupCodes"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.id = id; + this.object = object; + this.phoneNumber = phoneNumber; + this.reservedForSecondFactor = reservedForSecondFactor; + this.defaultSecondFactor = defaultSecondFactor; + this.reserved = reserved; + this.verification = verification; + this.linkedTo = linkedTo; + this.backupCodes = backupCodes; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public PhoneNumber( + PhoneNumberObject object, + String phoneNumber, + boolean reserved, + java.util.List linkedTo, + long createdAt, + long updatedAt) { + this(Optional.empty(), object, phoneNumber, Optional.empty(), Optional.empty(), reserved, Optional.empty(), linkedTo, JsonNullable.undefined(), createdAt, updatedAt); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonIgnore + public PhoneNumberObject object() { + return object; + } + + @JsonIgnore + public String phoneNumber() { + return phoneNumber; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional reservedForSecondFactor() { + return (Optional) reservedForSecondFactor; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional defaultSecondFactor() { + return (Optional) defaultSecondFactor; + } + + @JsonIgnore + public boolean reserved() { + return reserved; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional verification() { + return (Optional) verification; + } + + @JsonIgnore + public java.util.List linkedTo() { + return linkedTo; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> backupCodes() { + return (JsonNullable>) backupCodes; + } + + /** + * Unix timestamp of creation + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of creation + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public PhoneNumber withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public PhoneNumber withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public PhoneNumber withObject(PhoneNumberObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public PhoneNumber withPhoneNumber(String phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + public PhoneNumber withReservedForSecondFactor(boolean reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = Optional.ofNullable(reservedForSecondFactor); + return this; + } + + public PhoneNumber withReservedForSecondFactor(Optional reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = reservedForSecondFactor; + return this; + } + + public PhoneNumber withDefaultSecondFactor(boolean defaultSecondFactor) { + Utils.checkNotNull(defaultSecondFactor, "defaultSecondFactor"); + this.defaultSecondFactor = Optional.ofNullable(defaultSecondFactor); + return this; + } + + public PhoneNumber withDefaultSecondFactor(Optional defaultSecondFactor) { + Utils.checkNotNull(defaultSecondFactor, "defaultSecondFactor"); + this.defaultSecondFactor = defaultSecondFactor; + return this; + } + + public PhoneNumber withReserved(boolean reserved) { + Utils.checkNotNull(reserved, "reserved"); + this.reserved = reserved; + return this; + } + + public PhoneNumber withVerification(PhoneNumberVerification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public PhoneNumber withVerification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + public PhoneNumber withLinkedTo(java.util.List linkedTo) { + Utils.checkNotNull(linkedTo, "linkedTo"); + this.linkedTo = linkedTo; + return this; + } + + public PhoneNumber withBackupCodes(java.util.List backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = JsonNullable.of(backupCodes); + return this; + } + + public PhoneNumber withBackupCodes(JsonNullable> backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = backupCodes; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public PhoneNumber withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public PhoneNumber withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneNumber other = (PhoneNumber) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber) && + java.util.Objects.deepEquals(this.reservedForSecondFactor, other.reservedForSecondFactor) && + java.util.Objects.deepEquals(this.defaultSecondFactor, other.defaultSecondFactor) && + java.util.Objects.deepEquals(this.reserved, other.reserved) && + java.util.Objects.deepEquals(this.verification, other.verification) && + java.util.Objects.deepEquals(this.linkedTo, other.linkedTo) && + java.util.Objects.deepEquals(this.backupCodes, other.backupCodes) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + phoneNumber, + reservedForSecondFactor, + defaultSecondFactor, + reserved, + verification, + linkedTo, + backupCodes, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(PhoneNumber.class, + "id", id, + "object", object, + "phoneNumber", phoneNumber, + "reservedForSecondFactor", reservedForSecondFactor, + "defaultSecondFactor", defaultSecondFactor, + "reserved", reserved, + "verification", verification, + "linkedTo", linkedTo, + "backupCodes", backupCodes, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private PhoneNumberObject object; + + private String phoneNumber; + + private Optional reservedForSecondFactor = Optional.empty(); + + private Optional defaultSecondFactor = Optional.empty(); + + private Boolean reserved; + + private Optional verification = Optional.empty(); + + private java.util.List linkedTo; + + private JsonNullable> backupCodes = JsonNullable.undefined(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(PhoneNumberObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + public Builder reservedForSecondFactor(boolean reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = Optional.ofNullable(reservedForSecondFactor); + return this; + } + + public Builder reservedForSecondFactor(Optional reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = reservedForSecondFactor; + return this; + } + + public Builder defaultSecondFactor(boolean defaultSecondFactor) { + Utils.checkNotNull(defaultSecondFactor, "defaultSecondFactor"); + this.defaultSecondFactor = Optional.ofNullable(defaultSecondFactor); + return this; + } + + public Builder defaultSecondFactor(Optional defaultSecondFactor) { + Utils.checkNotNull(defaultSecondFactor, "defaultSecondFactor"); + this.defaultSecondFactor = defaultSecondFactor; + return this; + } + + public Builder reserved(boolean reserved) { + Utils.checkNotNull(reserved, "reserved"); + this.reserved = reserved; + return this; + } + + public Builder verification(PhoneNumberVerification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public Builder verification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + public Builder linkedTo(java.util.List linkedTo) { + Utils.checkNotNull(linkedTo, "linkedTo"); + this.linkedTo = linkedTo; + return this; + } + + public Builder backupCodes(java.util.List backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = JsonNullable.of(backupCodes); + return this; + } + + public Builder backupCodes(JsonNullable> backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = backupCodes; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public PhoneNumber build() { + return new PhoneNumber( + id, + object, + phoneNumber, + reservedForSecondFactor, + defaultSecondFactor, + reserved, + verification, + linkedTo, + backupCodes, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/PhoneNumberObject.java b/src/main/java/com/clerk/backend_api/models/components/PhoneNumberObject.java new file mode 100644 index 0000000..90799c1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/PhoneNumberObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * PhoneNumberObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum PhoneNumberObject { + PHONE_NUMBER("phone_number"); + + @JsonValue + private final String value; + + private PhoneNumberObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/PhoneNumberVerification.java b/src/main/java/com/clerk/backend_api/models/components/PhoneNumberVerification.java new file mode 100644 index 0000000..2b44ea9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/PhoneNumberVerification.java @@ -0,0 +1,100 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.time.OffsetDateTime; +import java.time.LocalDate; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.clerk.backend_api.utils.TypedObject; +import com.clerk.backend_api.utils.Utils.JsonShape; + + +@JsonDeserialize(using = PhoneNumberVerification._Deserializer.class) +public class PhoneNumberVerification { + + @com.fasterxml.jackson.annotation.JsonValue + private TypedObject value; + + private PhoneNumberVerification(TypedObject value) { + this.value = value; + } + + public static PhoneNumberVerification of(VerificationOTP value) { + Utils.checkNotNull(value, "value"); + return new PhoneNumberVerification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static PhoneNumberVerification of(VerificationAdmin value) { + Utils.checkNotNull(value, "value"); + return new PhoneNumberVerification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code VerificationOTP}
  • + *
  • {@code VerificationAdmin}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneNumberVerification other = (PhoneNumberVerification) o; + return java.util.Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends com.clerk.backend_api.utils.OneOfDeserializer { + + public _Deserializer() { + super(PhoneNumberVerification.class, + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT), + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(PhoneNumberVerification.class, + "value", value); + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/components/PrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/components/PrivateMetadata.java new file mode 100644 index 0000000..92ce70e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/PrivateMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class PrivateMetadata { + + @JsonCreator + public PrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(PrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public PrivateMetadata build() { + return new PrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ProxyCheck.java b/src/main/java/com/clerk/backend_api/models/components/ProxyCheck.java new file mode 100644 index 0000000..7aa884c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ProxyCheck.java @@ -0,0 +1,293 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class ProxyCheck { + + @JsonProperty("object") + private ProxyCheckObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("domain_id") + private String domainId; + + @JsonProperty("last_run_at") + private long lastRunAt; + + @JsonProperty("proxy_url") + private String proxyUrl; + + @JsonProperty("successful") + private boolean successful; + + @JsonProperty("created_at") + private long createdAt; + + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public ProxyCheck( + @JsonProperty("object") ProxyCheckObject object, + @JsonProperty("id") String id, + @JsonProperty("domain_id") String domainId, + @JsonProperty("last_run_at") long lastRunAt, + @JsonProperty("proxy_url") String proxyUrl, + @JsonProperty("successful") boolean successful, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(domainId, "domainId"); + Utils.checkNotNull(lastRunAt, "lastRunAt"); + Utils.checkNotNull(proxyUrl, "proxyUrl"); + Utils.checkNotNull(successful, "successful"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.domainId = domainId; + this.lastRunAt = lastRunAt; + this.proxyUrl = proxyUrl; + this.successful = successful; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + @JsonIgnore + public ProxyCheckObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String domainId() { + return domainId; + } + + @JsonIgnore + public long lastRunAt() { + return lastRunAt; + } + + @JsonIgnore + public String proxyUrl() { + return proxyUrl; + } + + @JsonIgnore + public boolean successful() { + return successful; + } + + @JsonIgnore + public long createdAt() { + return createdAt; + } + + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public ProxyCheck withObject(ProxyCheckObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public ProxyCheck withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public ProxyCheck withDomainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + public ProxyCheck withLastRunAt(long lastRunAt) { + Utils.checkNotNull(lastRunAt, "lastRunAt"); + this.lastRunAt = lastRunAt; + return this; + } + + public ProxyCheck withProxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + public ProxyCheck withSuccessful(boolean successful) { + Utils.checkNotNull(successful, "successful"); + this.successful = successful; + return this; + } + + public ProxyCheck withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public ProxyCheck withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProxyCheck other = (ProxyCheck) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.domainId, other.domainId) && + java.util.Objects.deepEquals(this.lastRunAt, other.lastRunAt) && + java.util.Objects.deepEquals(this.proxyUrl, other.proxyUrl) && + java.util.Objects.deepEquals(this.successful, other.successful) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + domainId, + lastRunAt, + proxyUrl, + successful, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(ProxyCheck.class, + "object", object, + "id", id, + "domainId", domainId, + "lastRunAt", lastRunAt, + "proxyUrl", proxyUrl, + "successful", successful, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private ProxyCheckObject object; + + private String id; + + private String domainId; + + private Long lastRunAt; + + private String proxyUrl; + + private Boolean successful; + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(ProxyCheckObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder domainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + public Builder lastRunAt(long lastRunAt) { + Utils.checkNotNull(lastRunAt, "lastRunAt"); + this.lastRunAt = lastRunAt; + return this; + } + + public Builder proxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + public Builder successful(boolean successful) { + Utils.checkNotNull(successful, "successful"); + this.successful = successful; + return this; + } + + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public ProxyCheck build() { + return new ProxyCheck( + object, + id, + domainId, + lastRunAt, + proxyUrl, + successful, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/ProxyCheckObject.java b/src/main/java/com/clerk/backend_api/models/components/ProxyCheckObject.java new file mode 100644 index 0000000..3b26a87 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/ProxyCheckObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum ProxyCheckObject { + PROXY_CHECK("proxy_check"); + + @JsonValue + private final String value; + + private ProxyCheckObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/PublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/PublicMetadata.java new file mode 100644 index 0000000..a49b493 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/PublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class PublicMetadata { + + @JsonCreator + public PublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(PublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public PublicMetadata build() { + return new PublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/PublicUserData.java b/src/main/java/com/clerk/backend_api/models/components/PublicUserData.java new file mode 100644 index 0000000..d6b86ae --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/PublicUserData.java @@ -0,0 +1,395 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class PublicUserData { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("user_id") + private Optional userId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private JsonNullable firstName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private JsonNullable lastName; + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("profile_image_url") + @Deprecated + private JsonNullable profileImageUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("image_url") + private Optional imageUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("has_image") + private Optional hasImage; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("identifier") + private JsonNullable identifier; + + @JsonCreator + public PublicUserData( + @JsonProperty("user_id") Optional userId, + @JsonProperty("first_name") JsonNullable firstName, + @JsonProperty("last_name") JsonNullable lastName, + @JsonProperty("profile_image_url") JsonNullable profileImageUrl, + @JsonProperty("image_url") Optional imageUrl, + @JsonProperty("has_image") Optional hasImage, + @JsonProperty("identifier") JsonNullable identifier) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + Utils.checkNotNull(imageUrl, "imageUrl"); + Utils.checkNotNull(hasImage, "hasImage"); + Utils.checkNotNull(identifier, "identifier"); + this.userId = userId; + this.firstName = firstName; + this.lastName = lastName; + this.profileImageUrl = profileImageUrl; + this.imageUrl = imageUrl; + this.hasImage = hasImage; + this.identifier = identifier; + } + + public PublicUserData() { + this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable firstName() { + return (JsonNullable) firstName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastName() { + return (JsonNullable) lastName; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable profileImageUrl() { + return (JsonNullable) profileImageUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional imageUrl() { + return (Optional) imageUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasImage() { + return (Optional) hasImage; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable identifier() { + return (JsonNullable) identifier; + } + + public final static Builder builder() { + return new Builder(); + } + + public PublicUserData withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public PublicUserData withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public PublicUserData withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + public PublicUserData withFirstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public PublicUserData withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + public PublicUserData withLastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public PublicUserData withProfileImageUrl(String profileImageUrl) { + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + this.profileImageUrl = JsonNullable.of(profileImageUrl); + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public PublicUserData withProfileImageUrl(JsonNullable profileImageUrl) { + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + this.profileImageUrl = profileImageUrl; + return this; + } + + public PublicUserData withImageUrl(String imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = Optional.ofNullable(imageUrl); + return this; + } + + public PublicUserData withImageUrl(Optional imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = imageUrl; + return this; + } + + public PublicUserData withHasImage(boolean hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = Optional.ofNullable(hasImage); + return this; + } + + public PublicUserData withHasImage(Optional hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = hasImage; + return this; + } + + public PublicUserData withIdentifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = JsonNullable.of(identifier); + return this; + } + + public PublicUserData withIdentifier(JsonNullable identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicUserData other = (PublicUserData) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName) && + java.util.Objects.deepEquals(this.profileImageUrl, other.profileImageUrl) && + java.util.Objects.deepEquals(this.imageUrl, other.imageUrl) && + java.util.Objects.deepEquals(this.hasImage, other.hasImage) && + java.util.Objects.deepEquals(this.identifier, other.identifier); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + firstName, + lastName, + profileImageUrl, + imageUrl, + hasImage, + identifier); + } + + @Override + public String toString() { + return Utils.toString(PublicUserData.class, + "userId", userId, + "firstName", firstName, + "lastName", lastName, + "profileImageUrl", profileImageUrl, + "imageUrl", imageUrl, + "hasImage", hasImage, + "identifier", identifier); + } + + public final static class Builder { + + private Optional userId = Optional.empty(); + + private JsonNullable firstName = JsonNullable.undefined(); + + private JsonNullable lastName = JsonNullable.undefined(); + + @Deprecated + private JsonNullable profileImageUrl = JsonNullable.undefined(); + + private Optional imageUrl = Optional.empty(); + + private Optional hasImage = Optional.empty(); + + private JsonNullable identifier = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + public Builder firstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + public Builder lastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder profileImageUrl(String profileImageUrl) { + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + this.profileImageUrl = JsonNullable.of(profileImageUrl); + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder profileImageUrl(JsonNullable profileImageUrl) { + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + this.profileImageUrl = profileImageUrl; + return this; + } + + public Builder imageUrl(String imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = Optional.ofNullable(imageUrl); + return this; + } + + public Builder imageUrl(Optional imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = imageUrl; + return this; + } + + public Builder hasImage(boolean hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = Optional.ofNullable(hasImage); + return this; + } + + public Builder hasImage(Optional hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = hasImage; + return this; + } + + public Builder identifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = JsonNullable.of(identifier); + return this; + } + + public Builder identifier(JsonNullable identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public PublicUserData build() { + return new PublicUserData( + userId, + firstName, + lastName, + profileImageUrl, + imageUrl, + hasImage, + identifier); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/RedirectURL.java b/src/main/java/com/clerk/backend_api/models/components/RedirectURL.java new file mode 100644 index 0000000..3c3c482 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/RedirectURL.java @@ -0,0 +1,238 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RedirectURL { + + @JsonProperty("object") + private RedirectURLObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("url") + private String url; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public RedirectURL( + @JsonProperty("object") RedirectURLObject object, + @JsonProperty("id") String id, + @JsonProperty("url") String url, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(url, "url"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.url = url; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + @JsonIgnore + public RedirectURLObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String url() { + return url; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public RedirectURL withObject(RedirectURLObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public RedirectURL withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public RedirectURL withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public RedirectURL withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public RedirectURL withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RedirectURL other = (RedirectURL) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.url, other.url) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + url, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(RedirectURL.class, + "object", object, + "id", id, + "url", url, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private RedirectURLObject object; + + private String id; + + private String url; + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(RedirectURLObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public RedirectURL build() { + return new RedirectURL( + object, + id, + url, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/RedirectURLObject.java b/src/main/java/com/clerk/backend_api/models/components/RedirectURLObject.java new file mode 100644 index 0000000..fd358fd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/RedirectURLObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum RedirectURLObject { + REDIRECT_URL("redirect_url"); + + @JsonValue + private final String value; + + private RedirectURLObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLAccount.java b/src/main/java/com/clerk/backend_api/models/components/SAMLAccount.java new file mode 100644 index 0000000..7115ec4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLAccount.java @@ -0,0 +1,450 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class SAMLAccount { + + @JsonProperty("id") + private String id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonProperty("object") + private SAMLAccountObject object; + + @JsonProperty("provider") + private String provider; + + @JsonProperty("active") + private boolean active; + + @JsonProperty("email_address") + private String emailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private JsonNullable firstName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private JsonNullable lastName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("provider_user_id") + private JsonNullable providerUserId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("verification") + private Optional verification; + + @JsonCreator + public SAMLAccount( + @JsonProperty("id") String id, + @JsonProperty("object") SAMLAccountObject object, + @JsonProperty("provider") String provider, + @JsonProperty("active") boolean active, + @JsonProperty("email_address") String emailAddress, + @JsonProperty("first_name") JsonNullable firstName, + @JsonProperty("last_name") JsonNullable lastName, + @JsonProperty("provider_user_id") JsonNullable providerUserId, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("verification") Optional verification) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(provider, "provider"); + Utils.checkNotNull(active, "active"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + Utils.checkNotNull(providerUserId, "providerUserId"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(verification, "verification"); + this.id = id; + this.object = object; + this.provider = provider; + this.active = active; + this.emailAddress = emailAddress; + this.firstName = firstName; + this.lastName = lastName; + this.providerUserId = providerUserId; + this.publicMetadata = publicMetadata; + this.verification = verification; + } + + public SAMLAccount( + String id, + SAMLAccountObject object, + String provider, + boolean active, + String emailAddress) { + this(id, object, provider, active, emailAddress, JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public String id() { + return id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonIgnore + public SAMLAccountObject object() { + return object; + } + + @JsonIgnore + public String provider() { + return provider; + } + + @JsonIgnore + public boolean active() { + return active; + } + + @JsonIgnore + public String emailAddress() { + return emailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable firstName() { + return (JsonNullable) firstName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastName() { + return (JsonNullable) lastName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable providerUserId() { + return (JsonNullable) providerUserId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional verification() { + return (Optional) verification; + } + + public final static Builder builder() { + return new Builder(); + } + + public SAMLAccount withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public SAMLAccount withObject(SAMLAccountObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public SAMLAccount withProvider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + public SAMLAccount withActive(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + public SAMLAccount withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public SAMLAccount withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + public SAMLAccount withFirstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public SAMLAccount withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + public SAMLAccount withLastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + public SAMLAccount withProviderUserId(String providerUserId) { + Utils.checkNotNull(providerUserId, "providerUserId"); + this.providerUserId = JsonNullable.of(providerUserId); + return this; + } + + public SAMLAccount withProviderUserId(JsonNullable providerUserId) { + Utils.checkNotNull(providerUserId, "providerUserId"); + this.providerUserId = providerUserId; + return this; + } + + public SAMLAccount withPublicMetadata(SAMLAccountPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public SAMLAccount withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public SAMLAccount withVerification(SAMLAccountVerification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public SAMLAccount withVerification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SAMLAccount other = (SAMLAccount) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.provider, other.provider) && + java.util.Objects.deepEquals(this.active, other.active) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName) && + java.util.Objects.deepEquals(this.providerUserId, other.providerUserId) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.verification, other.verification); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + provider, + active, + emailAddress, + firstName, + lastName, + providerUserId, + publicMetadata, + verification); + } + + @Override + public String toString() { + return Utils.toString(SAMLAccount.class, + "id", id, + "object", object, + "provider", provider, + "active", active, + "emailAddress", emailAddress, + "firstName", firstName, + "lastName", lastName, + "providerUserId", providerUserId, + "publicMetadata", publicMetadata, + "verification", verification); + } + + public final static class Builder { + + private String id; + + private SAMLAccountObject object; + + private String provider; + + private Boolean active; + + private String emailAddress; + + private JsonNullable firstName = JsonNullable.undefined(); + + private JsonNullable lastName = JsonNullable.undefined(); + + private JsonNullable providerUserId = JsonNullable.undefined(); + + private Optional publicMetadata = Optional.empty(); + + private Optional verification = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(SAMLAccountObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder provider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + public Builder active(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + public Builder firstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + public Builder lastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + public Builder providerUserId(String providerUserId) { + Utils.checkNotNull(providerUserId, "providerUserId"); + this.providerUserId = JsonNullable.of(providerUserId); + return this; + } + + public Builder providerUserId(JsonNullable providerUserId) { + Utils.checkNotNull(providerUserId, "providerUserId"); + this.providerUserId = providerUserId; + return this; + } + + public Builder publicMetadata(SAMLAccountPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder verification(SAMLAccountVerification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public Builder verification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + public SAMLAccount build() { + return new SAMLAccount( + id, + object, + provider, + active, + emailAddress, + firstName, + lastName, + providerUserId, + publicMetadata, + verification); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLAccountObject.java b/src/main/java/com/clerk/backend_api/models/components/SAMLAccountObject.java new file mode 100644 index 0000000..7660d03 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLAccountObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * SAMLAccountObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum SAMLAccountObject { + SAML_ACCOUNT("saml_account"); + + @JsonValue + private final String value; + + private SAMLAccountObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLAccountPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/SAMLAccountPublicMetadata.java new file mode 100644 index 0000000..9075b7c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLAccountPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class SAMLAccountPublicMetadata { + + @JsonCreator + public SAMLAccountPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(SAMLAccountPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public SAMLAccountPublicMetadata build() { + return new SAMLAccountPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLAccountVerification.java b/src/main/java/com/clerk/backend_api/models/components/SAMLAccountVerification.java new file mode 100644 index 0000000..9294fea --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLAccountVerification.java @@ -0,0 +1,100 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.time.OffsetDateTime; +import java.time.LocalDate; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.clerk.backend_api.utils.TypedObject; +import com.clerk.backend_api.utils.Utils.JsonShape; + + +@JsonDeserialize(using = SAMLAccountVerification._Deserializer.class) +public class SAMLAccountVerification { + + @com.fasterxml.jackson.annotation.JsonValue + private TypedObject value; + + private SAMLAccountVerification(TypedObject value) { + this.value = value; + } + + public static SAMLAccountVerification of(Saml value) { + Utils.checkNotNull(value, "value"); + return new SAMLAccountVerification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static SAMLAccountVerification of(Ticket value) { + Utils.checkNotNull(value, "value"); + return new SAMLAccountVerification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code Saml}
  • + *
  • {@code Ticket}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SAMLAccountVerification other = (SAMLAccountVerification) o; + return java.util.Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends com.clerk.backend_api.utils.OneOfDeserializer { + + public _Deserializer() { + super(SAMLAccountVerification.class, + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT), + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(SAMLAccountVerification.class, + "value", value); + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLConnection.java b/src/main/java/com/clerk/backend_api/models/components/SAMLConnection.java new file mode 100644 index 0000000..2e00423 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLConnection.java @@ -0,0 +1,835 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class SAMLConnection { + + @JsonProperty("object") + private SAMLConnectionObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("domain") + private String domain; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("idp_entity_id") + private Optional idpEntityId; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("idp_sso_url") + private Optional idpSsoUrl; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("idp_certificate") + private Optional idpCertificate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_metadata_url") + private JsonNullable idpMetadataUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_metadata") + private JsonNullable idpMetadata; + + @JsonProperty("acs_url") + private String acsUrl; + + @JsonProperty("sp_entity_id") + private String spEntityId; + + @JsonProperty("sp_metadata_url") + private String spMetadataUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attribute_mapping") + private Optional attributeMapping; + + @JsonProperty("active") + private boolean active; + + @JsonProperty("provider") + private String provider; + + @JsonProperty("user_count") + private long userCount; + + @JsonProperty("sync_user_attributes") + private boolean syncUserAttributes; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allow_subdomains") + private Optional allowSubdomains; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allow_idp_initiated") + private Optional allowIdpInitiated; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public SAMLConnection( + @JsonProperty("object") SAMLConnectionObject object, + @JsonProperty("id") String id, + @JsonProperty("name") String name, + @JsonProperty("domain") String domain, + @JsonProperty("idp_entity_id") Optional idpEntityId, + @JsonProperty("idp_sso_url") Optional idpSsoUrl, + @JsonProperty("idp_certificate") Optional idpCertificate, + @JsonProperty("idp_metadata_url") JsonNullable idpMetadataUrl, + @JsonProperty("idp_metadata") JsonNullable idpMetadata, + @JsonProperty("acs_url") String acsUrl, + @JsonProperty("sp_entity_id") String spEntityId, + @JsonProperty("sp_metadata_url") String spMetadataUrl, + @JsonProperty("attribute_mapping") Optional attributeMapping, + @JsonProperty("active") boolean active, + @JsonProperty("provider") String provider, + @JsonProperty("user_count") long userCount, + @JsonProperty("sync_user_attributes") boolean syncUserAttributes, + @JsonProperty("allow_subdomains") Optional allowSubdomains, + @JsonProperty("allow_idp_initiated") Optional allowIdpInitiated, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(domain, "domain"); + Utils.checkNotNull(idpEntityId, "idpEntityId"); + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + Utils.checkNotNull(idpCertificate, "idpCertificate"); + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + Utils.checkNotNull(idpMetadata, "idpMetadata"); + Utils.checkNotNull(acsUrl, "acsUrl"); + Utils.checkNotNull(spEntityId, "spEntityId"); + Utils.checkNotNull(spMetadataUrl, "spMetadataUrl"); + Utils.checkNotNull(attributeMapping, "attributeMapping"); + Utils.checkNotNull(active, "active"); + Utils.checkNotNull(provider, "provider"); + Utils.checkNotNull(userCount, "userCount"); + Utils.checkNotNull(syncUserAttributes, "syncUserAttributes"); + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.name = name; + this.domain = domain; + this.idpEntityId = idpEntityId; + this.idpSsoUrl = idpSsoUrl; + this.idpCertificate = idpCertificate; + this.idpMetadataUrl = idpMetadataUrl; + this.idpMetadata = idpMetadata; + this.acsUrl = acsUrl; + this.spEntityId = spEntityId; + this.spMetadataUrl = spMetadataUrl; + this.attributeMapping = attributeMapping; + this.active = active; + this.provider = provider; + this.userCount = userCount; + this.syncUserAttributes = syncUserAttributes; + this.allowSubdomains = allowSubdomains; + this.allowIdpInitiated = allowIdpInitiated; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public SAMLConnection( + SAMLConnectionObject object, + String id, + String name, + String domain, + String acsUrl, + String spEntityId, + String spMetadataUrl, + boolean active, + String provider, + long userCount, + boolean syncUserAttributes, + long createdAt, + long updatedAt) { + this(object, id, name, domain, Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), acsUrl, spEntityId, spMetadataUrl, Optional.empty(), active, provider, userCount, syncUserAttributes, Optional.empty(), Optional.empty(), createdAt, updatedAt); + } + + @JsonIgnore + public SAMLConnectionObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String name() { + return name; + } + + @JsonIgnore + public String domain() { + return domain; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional idpEntityId() { + return (Optional) idpEntityId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional idpSsoUrl() { + return (Optional) idpSsoUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional idpCertificate() { + return (Optional) idpCertificate; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpMetadataUrl() { + return (JsonNullable) idpMetadataUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpMetadata() { + return (JsonNullable) idpMetadata; + } + + @JsonIgnore + public String acsUrl() { + return acsUrl; + } + + @JsonIgnore + public String spEntityId() { + return spEntityId; + } + + @JsonIgnore + public String spMetadataUrl() { + return spMetadataUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional attributeMapping() { + return (Optional) attributeMapping; + } + + @JsonIgnore + public boolean active() { + return active; + } + + @JsonIgnore + public String provider() { + return provider; + } + + @JsonIgnore + public long userCount() { + return userCount; + } + + @JsonIgnore + public boolean syncUserAttributes() { + return syncUserAttributes; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowSubdomains() { + return (Optional) allowSubdomains; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowIdpInitiated() { + return (Optional) allowIdpInitiated; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public SAMLConnection withObject(SAMLConnectionObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public SAMLConnection withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public SAMLConnection withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public SAMLConnection withDomain(String domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + public SAMLConnection withIdpEntityId(String idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = Optional.ofNullable(idpEntityId); + return this; + } + + public SAMLConnection withIdpEntityId(Optional idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = idpEntityId; + return this; + } + + public SAMLConnection withIdpSsoUrl(String idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = Optional.ofNullable(idpSsoUrl); + return this; + } + + public SAMLConnection withIdpSsoUrl(Optional idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = idpSsoUrl; + return this; + } + + public SAMLConnection withIdpCertificate(String idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = Optional.ofNullable(idpCertificate); + return this; + } + + public SAMLConnection withIdpCertificate(Optional idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = idpCertificate; + return this; + } + + public SAMLConnection withIdpMetadataUrl(String idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = JsonNullable.of(idpMetadataUrl); + return this; + } + + public SAMLConnection withIdpMetadataUrl(JsonNullable idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = idpMetadataUrl; + return this; + } + + public SAMLConnection withIdpMetadata(String idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = JsonNullable.of(idpMetadata); + return this; + } + + public SAMLConnection withIdpMetadata(JsonNullable idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = idpMetadata; + return this; + } + + public SAMLConnection withAcsUrl(String acsUrl) { + Utils.checkNotNull(acsUrl, "acsUrl"); + this.acsUrl = acsUrl; + return this; + } + + public SAMLConnection withSpEntityId(String spEntityId) { + Utils.checkNotNull(spEntityId, "spEntityId"); + this.spEntityId = spEntityId; + return this; + } + + public SAMLConnection withSpMetadataUrl(String spMetadataUrl) { + Utils.checkNotNull(spMetadataUrl, "spMetadataUrl"); + this.spMetadataUrl = spMetadataUrl; + return this; + } + + public SAMLConnection withAttributeMapping(AttributeMapping attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = Optional.ofNullable(attributeMapping); + return this; + } + + public SAMLConnection withAttributeMapping(Optional attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = attributeMapping; + return this; + } + + public SAMLConnection withActive(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + public SAMLConnection withProvider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + public SAMLConnection withUserCount(long userCount) { + Utils.checkNotNull(userCount, "userCount"); + this.userCount = userCount; + return this; + } + + public SAMLConnection withSyncUserAttributes(boolean syncUserAttributes) { + Utils.checkNotNull(syncUserAttributes, "syncUserAttributes"); + this.syncUserAttributes = syncUserAttributes; + return this; + } + + public SAMLConnection withAllowSubdomains(boolean allowSubdomains) { + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + this.allowSubdomains = Optional.ofNullable(allowSubdomains); + return this; + } + + public SAMLConnection withAllowSubdomains(Optional allowSubdomains) { + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + this.allowSubdomains = allowSubdomains; + return this; + } + + public SAMLConnection withAllowIdpInitiated(boolean allowIdpInitiated) { + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.allowIdpInitiated = Optional.ofNullable(allowIdpInitiated); + return this; + } + + public SAMLConnection withAllowIdpInitiated(Optional allowIdpInitiated) { + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.allowIdpInitiated = allowIdpInitiated; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public SAMLConnection withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public SAMLConnection withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SAMLConnection other = (SAMLConnection) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.domain, other.domain) && + java.util.Objects.deepEquals(this.idpEntityId, other.idpEntityId) && + java.util.Objects.deepEquals(this.idpSsoUrl, other.idpSsoUrl) && + java.util.Objects.deepEquals(this.idpCertificate, other.idpCertificate) && + java.util.Objects.deepEquals(this.idpMetadataUrl, other.idpMetadataUrl) && + java.util.Objects.deepEquals(this.idpMetadata, other.idpMetadata) && + java.util.Objects.deepEquals(this.acsUrl, other.acsUrl) && + java.util.Objects.deepEquals(this.spEntityId, other.spEntityId) && + java.util.Objects.deepEquals(this.spMetadataUrl, other.spMetadataUrl) && + java.util.Objects.deepEquals(this.attributeMapping, other.attributeMapping) && + java.util.Objects.deepEquals(this.active, other.active) && + java.util.Objects.deepEquals(this.provider, other.provider) && + java.util.Objects.deepEquals(this.userCount, other.userCount) && + java.util.Objects.deepEquals(this.syncUserAttributes, other.syncUserAttributes) && + java.util.Objects.deepEquals(this.allowSubdomains, other.allowSubdomains) && + java.util.Objects.deepEquals(this.allowIdpInitiated, other.allowIdpInitiated) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + name, + domain, + idpEntityId, + idpSsoUrl, + idpCertificate, + idpMetadataUrl, + idpMetadata, + acsUrl, + spEntityId, + spMetadataUrl, + attributeMapping, + active, + provider, + userCount, + syncUserAttributes, + allowSubdomains, + allowIdpInitiated, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(SAMLConnection.class, + "object", object, + "id", id, + "name", name, + "domain", domain, + "idpEntityId", idpEntityId, + "idpSsoUrl", idpSsoUrl, + "idpCertificate", idpCertificate, + "idpMetadataUrl", idpMetadataUrl, + "idpMetadata", idpMetadata, + "acsUrl", acsUrl, + "spEntityId", spEntityId, + "spMetadataUrl", spMetadataUrl, + "attributeMapping", attributeMapping, + "active", active, + "provider", provider, + "userCount", userCount, + "syncUserAttributes", syncUserAttributes, + "allowSubdomains", allowSubdomains, + "allowIdpInitiated", allowIdpInitiated, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private SAMLConnectionObject object; + + private String id; + + private String name; + + private String domain; + + private Optional idpEntityId = Optional.empty(); + + private Optional idpSsoUrl = Optional.empty(); + + private Optional idpCertificate = Optional.empty(); + + private JsonNullable idpMetadataUrl = JsonNullable.undefined(); + + private JsonNullable idpMetadata = JsonNullable.undefined(); + + private String acsUrl; + + private String spEntityId; + + private String spMetadataUrl; + + private Optional attributeMapping = Optional.empty(); + + private Boolean active; + + private String provider; + + private Long userCount; + + private Boolean syncUserAttributes; + + private Optional allowSubdomains = Optional.empty(); + + private Optional allowIdpInitiated = Optional.empty(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(SAMLConnectionObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder domain(String domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + public Builder idpEntityId(String idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = Optional.ofNullable(idpEntityId); + return this; + } + + public Builder idpEntityId(Optional idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = idpEntityId; + return this; + } + + public Builder idpSsoUrl(String idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = Optional.ofNullable(idpSsoUrl); + return this; + } + + public Builder idpSsoUrl(Optional idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = idpSsoUrl; + return this; + } + + public Builder idpCertificate(String idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = Optional.ofNullable(idpCertificate); + return this; + } + + public Builder idpCertificate(Optional idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = idpCertificate; + return this; + } + + public Builder idpMetadataUrl(String idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = JsonNullable.of(idpMetadataUrl); + return this; + } + + public Builder idpMetadataUrl(JsonNullable idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = idpMetadataUrl; + return this; + } + + public Builder idpMetadata(String idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = JsonNullable.of(idpMetadata); + return this; + } + + public Builder idpMetadata(JsonNullable idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = idpMetadata; + return this; + } + + public Builder acsUrl(String acsUrl) { + Utils.checkNotNull(acsUrl, "acsUrl"); + this.acsUrl = acsUrl; + return this; + } + + public Builder spEntityId(String spEntityId) { + Utils.checkNotNull(spEntityId, "spEntityId"); + this.spEntityId = spEntityId; + return this; + } + + public Builder spMetadataUrl(String spMetadataUrl) { + Utils.checkNotNull(spMetadataUrl, "spMetadataUrl"); + this.spMetadataUrl = spMetadataUrl; + return this; + } + + public Builder attributeMapping(AttributeMapping attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = Optional.ofNullable(attributeMapping); + return this; + } + + public Builder attributeMapping(Optional attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = attributeMapping; + return this; + } + + public Builder active(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + public Builder provider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + public Builder userCount(long userCount) { + Utils.checkNotNull(userCount, "userCount"); + this.userCount = userCount; + return this; + } + + public Builder syncUserAttributes(boolean syncUserAttributes) { + Utils.checkNotNull(syncUserAttributes, "syncUserAttributes"); + this.syncUserAttributes = syncUserAttributes; + return this; + } + + public Builder allowSubdomains(boolean allowSubdomains) { + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + this.allowSubdomains = Optional.ofNullable(allowSubdomains); + return this; + } + + public Builder allowSubdomains(Optional allowSubdomains) { + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + this.allowSubdomains = allowSubdomains; + return this; + } + + public Builder allowIdpInitiated(boolean allowIdpInitiated) { + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.allowIdpInitiated = Optional.ofNullable(allowIdpInitiated); + return this; + } + + public Builder allowIdpInitiated(Optional allowIdpInitiated) { + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.allowIdpInitiated = allowIdpInitiated; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public SAMLConnection build() { + return new SAMLConnection( + object, + id, + name, + domain, + idpEntityId, + idpSsoUrl, + idpCertificate, + idpMetadataUrl, + idpMetadata, + acsUrl, + spEntityId, + spMetadataUrl, + attributeMapping, + active, + provider, + userCount, + syncUserAttributes, + allowSubdomains, + allowIdpInitiated, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLConnectionObject.java b/src/main/java/com/clerk/backend_api/models/components/SAMLConnectionObject.java new file mode 100644 index 0000000..8104504 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLConnectionObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum SAMLConnectionObject { + SAML_CONNECTION("saml_connection"); + + @JsonValue + private final String value; + + private SAMLConnectionObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLConnections.java b/src/main/java/com/clerk/backend_api/models/components/SAMLConnections.java new file mode 100644 index 0000000..41571d8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLConnections.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class SAMLConnections { + + @JsonProperty("data") + private java.util.List data; + + /** + * Total number of SAML Connections + * + */ + @JsonProperty("total_count") + private long totalCount; + + @JsonCreator + public SAMLConnections( + @JsonProperty("data") java.util.List data, + @JsonProperty("total_count") long totalCount) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(totalCount, "totalCount"); + this.data = data; + this.totalCount = totalCount; + } + + @JsonIgnore + public java.util.List data() { + return data; + } + + /** + * Total number of SAML Connections + * + */ + @JsonIgnore + public long totalCount() { + return totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + public SAMLConnections withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of SAML Connections + * + */ + public SAMLConnections withTotalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SAMLConnections other = (SAMLConnections) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(SAMLConnections.class, + "data", data, + "totalCount", totalCount); + } + + public final static class Builder { + + private java.util.List data; + + private Long totalCount; + + private Builder() { + // force use of static builder() method + } + + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Total number of SAML Connections + * + */ + public Builder totalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public SAMLConnections build() { + return new SAMLConnections( + data, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLErrorClerkError.java b/src/main/java/com/clerk/backend_api/models/components/SAMLErrorClerkError.java new file mode 100644 index 0000000..c4832f2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLErrorClerkError.java @@ -0,0 +1,244 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class SAMLErrorClerkError { + + @JsonProperty("message") + private String message; + + @JsonProperty("long_message") + private String longMessage; + + @JsonProperty("code") + private String code; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("meta") + private Optional meta; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("clerk_trace_id") + private Optional clerkTraceId; + + @JsonCreator + public SAMLErrorClerkError( + @JsonProperty("message") String message, + @JsonProperty("long_message") String longMessage, + @JsonProperty("code") String code, + @JsonProperty("meta") Optional meta, + @JsonProperty("clerk_trace_id") Optional clerkTraceId) { + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(longMessage, "longMessage"); + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(meta, "meta"); + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.message = message; + this.longMessage = longMessage; + this.code = code; + this.meta = meta; + this.clerkTraceId = clerkTraceId; + } + + public SAMLErrorClerkError( + String message, + String longMessage, + String code) { + this(message, longMessage, code, Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public String message() { + return message; + } + + @JsonIgnore + public String longMessage() { + return longMessage; + } + + @JsonIgnore + public String code() { + return code; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional meta() { + return (Optional) meta; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clerkTraceId() { + return (Optional) clerkTraceId; + } + + public final static Builder builder() { + return new Builder(); + } + + public SAMLErrorClerkError withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public SAMLErrorClerkError withLongMessage(String longMessage) { + Utils.checkNotNull(longMessage, "longMessage"); + this.longMessage = longMessage; + return this; + } + + public SAMLErrorClerkError withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public SAMLErrorClerkError withMeta(ClerkErrorErrorMeta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + public SAMLErrorClerkError withMeta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + public SAMLErrorClerkError withClerkTraceId(String clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = Optional.ofNullable(clerkTraceId); + return this; + } + + public SAMLErrorClerkError withClerkTraceId(Optional clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = clerkTraceId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SAMLErrorClerkError other = (SAMLErrorClerkError) o; + return + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.longMessage, other.longMessage) && + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.meta, other.meta) && + java.util.Objects.deepEquals(this.clerkTraceId, other.clerkTraceId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + message, + longMessage, + code, + meta, + clerkTraceId); + } + + @Override + public String toString() { + return Utils.toString(SAMLErrorClerkError.class, + "message", message, + "longMessage", longMessage, + "code", code, + "meta", meta, + "clerkTraceId", clerkTraceId); + } + + public final static class Builder { + + private String message; + + private String longMessage; + + private String code; + + private Optional meta = Optional.empty(); + + private Optional clerkTraceId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public Builder longMessage(String longMessage) { + Utils.checkNotNull(longMessage, "longMessage"); + this.longMessage = longMessage; + return this; + } + + public Builder code(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public Builder meta(ClerkErrorErrorMeta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + public Builder meta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + public Builder clerkTraceId(String clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = Optional.ofNullable(clerkTraceId); + return this; + } + + public Builder clerkTraceId(Optional clerkTraceId) { + Utils.checkNotNull(clerkTraceId, "clerkTraceId"); + this.clerkTraceId = clerkTraceId; + return this; + } + + public SAMLErrorClerkError build() { + return new SAMLErrorClerkError( + message, + longMessage, + code, + meta, + clerkTraceId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLVerificationStatus.java b/src/main/java/com/clerk/backend_api/models/components/SAMLVerificationStatus.java new file mode 100644 index 0000000..0431964 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLVerificationStatus.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum SAMLVerificationStatus { + UNVERIFIED("unverified"), + VERIFIED("verified"), + FAILED("failed"), + EXPIRED("expired"), + TRANSFERABLE("transferable"); + + @JsonValue + private final String value; + + private SAMLVerificationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SAMLVerificationStrategy.java b/src/main/java/com/clerk/backend_api/models/components/SAMLVerificationStrategy.java new file mode 100644 index 0000000..25ae266 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SAMLVerificationStrategy.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum SAMLVerificationStrategy { + SAML("saml"); + + @JsonValue + private final String value; + + private SAMLVerificationStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Saml.java b/src/main/java/com/clerk/backend_api/models/components/Saml.java new file mode 100644 index 0000000..2a14e46 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Saml.java @@ -0,0 +1,288 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Saml { + + @JsonProperty("status") + private SAMLVerificationStatus status; + + @JsonProperty("strategy") + private SAMLVerificationStrategy strategy; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("external_verification_redirect_url") + private Optional externalVerificationRedirectUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("error") + private JsonNullable error; + + @JsonProperty("expire_at") + private long expireAt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attempts") + private JsonNullable attempts; + + @JsonCreator + public Saml( + @JsonProperty("status") SAMLVerificationStatus status, + @JsonProperty("strategy") SAMLVerificationStrategy strategy, + @JsonProperty("external_verification_redirect_url") Optional externalVerificationRedirectUrl, + @JsonProperty("error") JsonNullable error, + @JsonProperty("expire_at") long expireAt, + @JsonProperty("attempts") JsonNullable attempts) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + Utils.checkNotNull(error, "error"); + Utils.checkNotNull(expireAt, "expireAt"); + Utils.checkNotNull(attempts, "attempts"); + this.status = status; + this.strategy = strategy; + this.externalVerificationRedirectUrl = externalVerificationRedirectUrl; + this.error = error; + this.expireAt = expireAt; + this.attempts = attempts; + } + + public Saml( + SAMLVerificationStatus status, + SAMLVerificationStrategy strategy, + long expireAt) { + this(status, strategy, Optional.empty(), JsonNullable.undefined(), expireAt, JsonNullable.undefined()); + } + + @JsonIgnore + public SAMLVerificationStatus status() { + return status; + } + + @JsonIgnore + public SAMLVerificationStrategy strategy() { + return strategy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional externalVerificationRedirectUrl() { + return (Optional) externalVerificationRedirectUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable error() { + return (JsonNullable) error; + } + + @JsonIgnore + public long expireAt() { + return expireAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attempts() { + return (JsonNullable) attempts; + } + + public final static Builder builder() { + return new Builder(); + } + + public Saml withStatus(SAMLVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Saml withStrategy(SAMLVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Saml withExternalVerificationRedirectUrl(String externalVerificationRedirectUrl) { + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + this.externalVerificationRedirectUrl = Optional.ofNullable(externalVerificationRedirectUrl); + return this; + } + + public Saml withExternalVerificationRedirectUrl(Optional externalVerificationRedirectUrl) { + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + this.externalVerificationRedirectUrl = externalVerificationRedirectUrl; + return this; + } + + public Saml withError(VerificationError error) { + Utils.checkNotNull(error, "error"); + this.error = JsonNullable.of(error); + return this; + } + + public Saml withError(JsonNullable error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + public Saml withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Saml withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Saml withAttempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Saml other = (Saml) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.externalVerificationRedirectUrl, other.externalVerificationRedirectUrl) && + java.util.Objects.deepEquals(this.error, other.error) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt) && + java.util.Objects.deepEquals(this.attempts, other.attempts); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + externalVerificationRedirectUrl, + error, + expireAt, + attempts); + } + + @Override + public String toString() { + return Utils.toString(Saml.class, + "status", status, + "strategy", strategy, + "externalVerificationRedirectUrl", externalVerificationRedirectUrl, + "error", error, + "expireAt", expireAt, + "attempts", attempts); + } + + public final static class Builder { + + private SAMLVerificationStatus status; + + private SAMLVerificationStrategy strategy; + + private Optional externalVerificationRedirectUrl = Optional.empty(); + + private JsonNullable error = JsonNullable.undefined(); + + private Long expireAt; + + private JsonNullable attempts = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder status(SAMLVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(SAMLVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder externalVerificationRedirectUrl(String externalVerificationRedirectUrl) { + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + this.externalVerificationRedirectUrl = Optional.ofNullable(externalVerificationRedirectUrl); + return this; + } + + public Builder externalVerificationRedirectUrl(Optional externalVerificationRedirectUrl) { + Utils.checkNotNull(externalVerificationRedirectUrl, "externalVerificationRedirectUrl"); + this.externalVerificationRedirectUrl = externalVerificationRedirectUrl; + return this; + } + + public Builder error(VerificationError error) { + Utils.checkNotNull(error, "error"); + this.error = JsonNullable.of(error); + return this; + } + + public Builder error(JsonNullable error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Builder attempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Saml build() { + return new Saml( + status, + strategy, + externalVerificationRedirectUrl, + error, + expireAt, + attempts); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SchemasPasskey.java b/src/main/java/com/clerk/backend_api/models/components/SchemasPasskey.java new file mode 100644 index 0000000..5ab6c36 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SchemasPasskey.java @@ -0,0 +1,276 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class SchemasPasskey { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonProperty("object") + private SchemasPasskeyObject object; + + @JsonProperty("name") + private String name; + + /** + * Unix timestamp of when the passkey was last used. + * + */ + @JsonProperty("last_used_at") + private long lastUsedAt; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("verification") + private Optional verification; + + @JsonCreator + public SchemasPasskey( + @JsonProperty("id") Optional id, + @JsonProperty("object") SchemasPasskeyObject object, + @JsonProperty("name") String name, + @JsonProperty("last_used_at") long lastUsedAt, + @JsonProperty("verification") Optional verification) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(lastUsedAt, "lastUsedAt"); + Utils.checkNotNull(verification, "verification"); + this.id = id; + this.object = object; + this.name = name; + this.lastUsedAt = lastUsedAt; + this.verification = verification; + } + + public SchemasPasskey( + SchemasPasskeyObject object, + String name, + long lastUsedAt) { + this(Optional.empty(), object, name, lastUsedAt, Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonIgnore + public SchemasPasskeyObject object() { + return object; + } + + @JsonIgnore + public String name() { + return name; + } + + /** + * Unix timestamp of when the passkey was last used. + * + */ + @JsonIgnore + public long lastUsedAt() { + return lastUsedAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional verification() { + return (Optional) verification; + } + + public final static Builder builder() { + return new Builder(); + } + + public SchemasPasskey withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public SchemasPasskey withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public SchemasPasskey withObject(SchemasPasskeyObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public SchemasPasskey withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Unix timestamp of when the passkey was last used. + * + */ + public SchemasPasskey withLastUsedAt(long lastUsedAt) { + Utils.checkNotNull(lastUsedAt, "lastUsedAt"); + this.lastUsedAt = lastUsedAt; + return this; + } + + public SchemasPasskey withVerification(SchemasPasskeyVerification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public SchemasPasskey withVerification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemasPasskey other = (SchemasPasskey) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.lastUsedAt, other.lastUsedAt) && + java.util.Objects.deepEquals(this.verification, other.verification); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + name, + lastUsedAt, + verification); + } + + @Override + public String toString() { + return Utils.toString(SchemasPasskey.class, + "id", id, + "object", object, + "name", name, + "lastUsedAt", lastUsedAt, + "verification", verification); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private SchemasPasskeyObject object; + + private String name; + + private Long lastUsedAt; + + private Optional verification = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(SchemasPasskeyObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Unix timestamp of when the passkey was last used. + * + */ + public Builder lastUsedAt(long lastUsedAt) { + Utils.checkNotNull(lastUsedAt, "lastUsedAt"); + this.lastUsedAt = lastUsedAt; + return this; + } + + public Builder verification(SchemasPasskeyVerification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public Builder verification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + public SchemasPasskey build() { + return new SchemasPasskey( + id, + object, + name, + lastUsedAt, + verification); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SchemasPasskeyObject.java b/src/main/java/com/clerk/backend_api/models/components/SchemasPasskeyObject.java new file mode 100644 index 0000000..692b84d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SchemasPasskeyObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * SchemasPasskeyObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum SchemasPasskeyObject { + PASSKEY("passkey"); + + @JsonValue + private final String value; + + private SchemasPasskeyObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SchemasPasskeyVerification.java b/src/main/java/com/clerk/backend_api/models/components/SchemasPasskeyVerification.java new file mode 100644 index 0000000..a8d3d45 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SchemasPasskeyVerification.java @@ -0,0 +1,93 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.time.OffsetDateTime; +import java.time.LocalDate; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.clerk.backend_api.utils.TypedObject; +import com.clerk.backend_api.utils.Utils.JsonShape; + + +@JsonDeserialize(using = SchemasPasskeyVerification._Deserializer.class) +public class SchemasPasskeyVerification { + + @com.fasterxml.jackson.annotation.JsonValue + private TypedObject value; + + private SchemasPasskeyVerification(TypedObject value) { + this.value = value; + } + + public static SchemasPasskeyVerification of(Passkey value) { + Utils.checkNotNull(value, "value"); + return new SchemasPasskeyVerification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code Passkey}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemasPasskeyVerification other = (SchemasPasskeyVerification) o; + return java.util.Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends com.clerk.backend_api.utils.OneOfDeserializer { + + public _Deserializer() { + super(SchemasPasskeyVerification.class, + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(SchemasPasskeyVerification.class, + "value", value); + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Security.java b/src/main/java/com/clerk/backend_api/models/components/Security.java new file mode 100644 index 0000000..87b5c03 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Security.java @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Security { + + @SpeakeasyMetadata("security:scheme=true,type=http,subtype=bearer,name=Authorization") + private String bearerAuth; + + @JsonCreator + public Security( + String bearerAuth) { + Utils.checkNotNull(bearerAuth, "bearerAuth"); + this.bearerAuth = bearerAuth; + } + + @JsonIgnore + public String bearerAuth() { + return bearerAuth; + } + + public final static Builder builder() { + return new Builder(); + } + + public Security withBearerAuth(String bearerAuth) { + Utils.checkNotNull(bearerAuth, "bearerAuth"); + this.bearerAuth = bearerAuth; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Security other = (Security) o; + return + java.util.Objects.deepEquals(this.bearerAuth, other.bearerAuth); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bearerAuth); + } + + @Override + public String toString() { + return Utils.toString(Security.class, + "bearerAuth", bearerAuth); + } + + public final static class Builder { + + private String bearerAuth; + + private Builder() { + // force use of static builder() method + } + + public Builder bearerAuth(String bearerAuth) { + Utils.checkNotNull(bearerAuth, "bearerAuth"); + this.bearerAuth = bearerAuth; + return this; + } + + public Security build() { + return new Security( + bearerAuth); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Session.java b/src/main/java/com/clerk/backend_api/models/components/Session.java new file mode 100644 index 0000000..dbdd6ff --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Session.java @@ -0,0 +1,502 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Session { + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonProperty("object") + private SessionObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("user_id") + private String userId; + + @JsonProperty("client_id") + private String clientId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("actor") + private JsonNullable actor; + + @JsonProperty("status") + private Status status; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_active_organization_id") + private JsonNullable lastActiveOrganizationId; + + @JsonProperty("last_active_at") + private long lastActiveAt; + + @JsonProperty("expire_at") + private long expireAt; + + @JsonProperty("abandon_at") + private long abandonAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + @JsonCreator + public Session( + @JsonProperty("object") SessionObject object, + @JsonProperty("id") String id, + @JsonProperty("user_id") String userId, + @JsonProperty("client_id") String clientId, + @JsonProperty("actor") JsonNullable actor, + @JsonProperty("status") Status status, + @JsonProperty("last_active_organization_id") JsonNullable lastActiveOrganizationId, + @JsonProperty("last_active_at") long lastActiveAt, + @JsonProperty("expire_at") long expireAt, + @JsonProperty("abandon_at") long abandonAt, + @JsonProperty("updated_at") long updatedAt, + @JsonProperty("created_at") long createdAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(clientId, "clientId"); + Utils.checkNotNull(actor, "actor"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(lastActiveOrganizationId, "lastActiveOrganizationId"); + Utils.checkNotNull(lastActiveAt, "lastActiveAt"); + Utils.checkNotNull(expireAt, "expireAt"); + Utils.checkNotNull(abandonAt, "abandonAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(createdAt, "createdAt"); + this.object = object; + this.id = id; + this.userId = userId; + this.clientId = clientId; + this.actor = actor; + this.status = status; + this.lastActiveOrganizationId = lastActiveOrganizationId; + this.lastActiveAt = lastActiveAt; + this.expireAt = expireAt; + this.abandonAt = abandonAt; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + } + + public Session( + SessionObject object, + String id, + String userId, + String clientId, + Status status, + long lastActiveAt, + long expireAt, + long abandonAt, + long updatedAt, + long createdAt) { + this(object, id, userId, clientId, JsonNullable.undefined(), status, JsonNullable.undefined(), lastActiveAt, expireAt, abandonAt, updatedAt, createdAt); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonIgnore + public SessionObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public String userId() { + return userId; + } + + @JsonIgnore + public String clientId() { + return clientId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable actor() { + return (JsonNullable) actor; + } + + @JsonIgnore + public Status status() { + return status; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastActiveOrganizationId() { + return (JsonNullable) lastActiveOrganizationId; + } + + @JsonIgnore + public long lastActiveAt() { + return lastActiveAt; + } + + @JsonIgnore + public long expireAt() { + return expireAt; + } + + @JsonIgnore + public long abandonAt() { + return abandonAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Session withObject(SessionObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Session withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Session withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Session withClientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + public Session withActor(Actor actor) { + Utils.checkNotNull(actor, "actor"); + this.actor = JsonNullable.of(actor); + return this; + } + + public Session withActor(JsonNullable actor) { + Utils.checkNotNull(actor, "actor"); + this.actor = actor; + return this; + } + + public Session withStatus(Status status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Session withLastActiveOrganizationId(String lastActiveOrganizationId) { + Utils.checkNotNull(lastActiveOrganizationId, "lastActiveOrganizationId"); + this.lastActiveOrganizationId = JsonNullable.of(lastActiveOrganizationId); + return this; + } + + public Session withLastActiveOrganizationId(JsonNullable lastActiveOrganizationId) { + Utils.checkNotNull(lastActiveOrganizationId, "lastActiveOrganizationId"); + this.lastActiveOrganizationId = lastActiveOrganizationId; + return this; + } + + public Session withLastActiveAt(long lastActiveAt) { + Utils.checkNotNull(lastActiveAt, "lastActiveAt"); + this.lastActiveAt = lastActiveAt; + return this; + } + + public Session withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Session withAbandonAt(long abandonAt) { + Utils.checkNotNull(abandonAt, "abandonAt"); + this.abandonAt = abandonAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Session withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Session withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Session other = (Session) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.clientId, other.clientId) && + java.util.Objects.deepEquals(this.actor, other.actor) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.lastActiveOrganizationId, other.lastActiveOrganizationId) && + java.util.Objects.deepEquals(this.lastActiveAt, other.lastActiveAt) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt) && + java.util.Objects.deepEquals(this.abandonAt, other.abandonAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + userId, + clientId, + actor, + status, + lastActiveOrganizationId, + lastActiveAt, + expireAt, + abandonAt, + updatedAt, + createdAt); + } + + @Override + public String toString() { + return Utils.toString(Session.class, + "object", object, + "id", id, + "userId", userId, + "clientId", clientId, + "actor", actor, + "status", status, + "lastActiveOrganizationId", lastActiveOrganizationId, + "lastActiveAt", lastActiveAt, + "expireAt", expireAt, + "abandonAt", abandonAt, + "updatedAt", updatedAt, + "createdAt", createdAt); + } + + public final static class Builder { + + private SessionObject object; + + private String id; + + private String userId; + + private String clientId; + + private JsonNullable actor = JsonNullable.undefined(); + + private Status status; + + private JsonNullable lastActiveOrganizationId = JsonNullable.undefined(); + + private Long lastActiveAt; + + private Long expireAt; + + private Long abandonAt; + + private Long updatedAt; + + private Long createdAt; + + private Builder() { + // force use of static builder() method + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(SessionObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + public Builder actor(Actor actor) { + Utils.checkNotNull(actor, "actor"); + this.actor = JsonNullable.of(actor); + return this; + } + + public Builder actor(JsonNullable actor) { + Utils.checkNotNull(actor, "actor"); + this.actor = actor; + return this; + } + + public Builder status(Status status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder lastActiveOrganizationId(String lastActiveOrganizationId) { + Utils.checkNotNull(lastActiveOrganizationId, "lastActiveOrganizationId"); + this.lastActiveOrganizationId = JsonNullable.of(lastActiveOrganizationId); + return this; + } + + public Builder lastActiveOrganizationId(JsonNullable lastActiveOrganizationId) { + Utils.checkNotNull(lastActiveOrganizationId, "lastActiveOrganizationId"); + this.lastActiveOrganizationId = lastActiveOrganizationId; + return this; + } + + public Builder lastActiveAt(long lastActiveAt) { + Utils.checkNotNull(lastActiveAt, "lastActiveAt"); + this.lastActiveAt = lastActiveAt; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Builder abandonAt(long abandonAt) { + Utils.checkNotNull(abandonAt, "abandonAt"); + this.abandonAt = abandonAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public Session build() { + return new Session( + object, + id, + userId, + clientId, + actor, + status, + lastActiveOrganizationId, + lastActiveAt, + expireAt, + abandonAt, + updatedAt, + createdAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SessionObject.java b/src/main/java/com/clerk/backend_api/models/components/SessionObject.java new file mode 100644 index 0000000..b5aa004 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SessionObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * SessionObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum SessionObject { + SESSION("session"); + + @JsonValue + private final String value; + + private SessionObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SignInToken.java b/src/main/java/com/clerk/backend_api/models/components/SignInToken.java new file mode 100644 index 0000000..c7eedf1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SignInToken.java @@ -0,0 +1,367 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class SignInToken { + + @JsonProperty("object") + private SignInTokenObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("status") + private SignInTokenStatus status; + + @JsonProperty("user_id") + private String userId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("token") + private Optional token; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("url") + private JsonNullable url; + + /** + * Unix timestamp of creation. + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of last update. + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public SignInToken( + @JsonProperty("object") SignInTokenObject object, + @JsonProperty("id") String id, + @JsonProperty("status") SignInTokenStatus status, + @JsonProperty("user_id") String userId, + @JsonProperty("token") Optional token, + @JsonProperty("url") JsonNullable url, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(token, "token"); + Utils.checkNotNull(url, "url"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.object = object; + this.id = id; + this.status = status; + this.userId = userId; + this.token = token; + this.url = url; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public SignInToken( + SignInTokenObject object, + String id, + SignInTokenStatus status, + String userId, + long createdAt, + long updatedAt) { + this(object, id, status, userId, Optional.empty(), JsonNullable.undefined(), createdAt, updatedAt); + } + + @JsonIgnore + public SignInTokenObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public SignInTokenStatus status() { + return status; + } + + @JsonIgnore + public String userId() { + return userId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional token() { + return (Optional) token; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable url() { + return (JsonNullable) url; + } + + /** + * Unix timestamp of creation. + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of last update. + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public SignInToken withObject(SignInTokenObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public SignInToken withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public SignInToken withStatus(SignInTokenStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public SignInToken withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public SignInToken withToken(String token) { + Utils.checkNotNull(token, "token"); + this.token = Optional.ofNullable(token); + return this; + } + + public SignInToken withToken(Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + public SignInToken withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = JsonNullable.of(url); + return this; + } + + public SignInToken withUrl(JsonNullable url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public SignInToken withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public SignInToken withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignInToken other = (SignInToken) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.token, other.token) && + java.util.Objects.deepEquals(this.url, other.url) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + status, + userId, + token, + url, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(SignInToken.class, + "object", object, + "id", id, + "status", status, + "userId", userId, + "token", token, + "url", url, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private SignInTokenObject object; + + private String id; + + private SignInTokenStatus status; + + private String userId; + + private Optional token = Optional.empty(); + + private JsonNullable url = JsonNullable.undefined(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(SignInTokenObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder status(SignInTokenStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder token(String token) { + Utils.checkNotNull(token, "token"); + this.token = Optional.ofNullable(token); + return this; + } + + public Builder token(Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = JsonNullable.of(url); + return this; + } + + public Builder url(JsonNullable url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public SignInToken build() { + return new SignInToken( + object, + id, + status, + userId, + token, + url, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SignInTokenObject.java b/src/main/java/com/clerk/backend_api/models/components/SignInTokenObject.java new file mode 100644 index 0000000..0a77efa --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SignInTokenObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum SignInTokenObject { + SIGN_IN_TOKEN("sign_in_token"); + + @JsonValue + private final String value; + + private SignInTokenObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SignInTokenStatus.java b/src/main/java/com/clerk/backend_api/models/components/SignInTokenStatus.java new file mode 100644 index 0000000..f0e51e6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SignInTokenStatus.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum SignInTokenStatus { + PENDING("pending"), + ACCEPTED("accepted"), + REVOKED("revoked"); + + @JsonValue + private final String value; + + private SignInTokenStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SignUp.java b/src/main/java/com/clerk/backend_api/models/components/SignUp.java new file mode 100644 index 0000000..16ca72a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SignUp.java @@ -0,0 +1,980 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class SignUp { + + @JsonProperty("object") + private SignUpObject object; + + @JsonProperty("id") + private String id; + + @JsonProperty("status") + private SignUpStatus status; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("required_fields") + private Optional> requiredFields; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("optional_fields") + private Optional> optionalFields; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("missing_fields") + private Optional> missingFields; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unverified_fields") + private Optional> unverifiedFields; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("verifications") + private Optional verifications; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("username") + private JsonNullable username; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_address") + private JsonNullable emailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone_number") + private JsonNullable phoneNumber; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("web3_wallet") + private JsonNullable web3Wallet; + + @JsonProperty("password_enabled") + private boolean passwordEnabled; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private JsonNullable firstName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private JsonNullable lastName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unsafe_metadata") + private Optional unsafeMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + @JsonProperty("custom_action") + private boolean customAction; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_id") + private JsonNullable externalId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_session_id") + private JsonNullable createdSessionId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_user_id") + private JsonNullable createdUserId; + + @JsonProperty("abandon_at") + private long abandonAt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_account") + private Optional externalAccount; + + @JsonCreator + public SignUp( + @JsonProperty("object") SignUpObject object, + @JsonProperty("id") String id, + @JsonProperty("status") SignUpStatus status, + @JsonProperty("required_fields") Optional> requiredFields, + @JsonProperty("optional_fields") Optional> optionalFields, + @JsonProperty("missing_fields") Optional> missingFields, + @JsonProperty("unverified_fields") Optional> unverifiedFields, + @JsonProperty("verifications") Optional verifications, + @JsonProperty("username") JsonNullable username, + @JsonProperty("email_address") JsonNullable emailAddress, + @JsonProperty("phone_number") JsonNullable phoneNumber, + @JsonProperty("web3_wallet") JsonNullable web3Wallet, + @JsonProperty("password_enabled") boolean passwordEnabled, + @JsonProperty("first_name") JsonNullable firstName, + @JsonProperty("last_name") JsonNullable lastName, + @JsonProperty("unsafe_metadata") Optional unsafeMetadata, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("custom_action") boolean customAction, + @JsonProperty("external_id") JsonNullable externalId, + @JsonProperty("created_session_id") JsonNullable createdSessionId, + @JsonProperty("created_user_id") JsonNullable createdUserId, + @JsonProperty("abandon_at") long abandonAt, + @JsonProperty("external_account") Optional externalAccount) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(requiredFields, "requiredFields"); + Utils.checkNotNull(optionalFields, "optionalFields"); + Utils.checkNotNull(missingFields, "missingFields"); + Utils.checkNotNull(unverifiedFields, "unverifiedFields"); + Utils.checkNotNull(verifications, "verifications"); + Utils.checkNotNull(username, "username"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + Utils.checkNotNull(web3Wallet, "web3Wallet"); + Utils.checkNotNull(passwordEnabled, "passwordEnabled"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(customAction, "customAction"); + Utils.checkNotNull(externalId, "externalId"); + Utils.checkNotNull(createdSessionId, "createdSessionId"); + Utils.checkNotNull(createdUserId, "createdUserId"); + Utils.checkNotNull(abandonAt, "abandonAt"); + Utils.checkNotNull(externalAccount, "externalAccount"); + this.object = object; + this.id = id; + this.status = status; + this.requiredFields = requiredFields; + this.optionalFields = optionalFields; + this.missingFields = missingFields; + this.unverifiedFields = unverifiedFields; + this.verifications = verifications; + this.username = username; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.web3Wallet = web3Wallet; + this.passwordEnabled = passwordEnabled; + this.firstName = firstName; + this.lastName = lastName; + this.unsafeMetadata = unsafeMetadata; + this.publicMetadata = publicMetadata; + this.customAction = customAction; + this.externalId = externalId; + this.createdSessionId = createdSessionId; + this.createdUserId = createdUserId; + this.abandonAt = abandonAt; + this.externalAccount = externalAccount; + } + + public SignUp( + SignUpObject object, + String id, + SignUpStatus status, + boolean passwordEnabled, + boolean customAction, + long abandonAt) { + this(object, id, status, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), passwordEnabled, JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), customAction, JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), abandonAt, Optional.empty()); + } + + @JsonIgnore + public SignUpObject object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public SignUpStatus status() { + return status; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> requiredFields() { + return (Optional>) requiredFields; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> optionalFields() { + return (Optional>) optionalFields; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> missingFields() { + return (Optional>) missingFields; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> unverifiedFields() { + return (Optional>) unverifiedFields; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional verifications() { + return (Optional) verifications; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable username() { + return (JsonNullable) username; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable emailAddress() { + return (JsonNullable) emailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable phoneNumber() { + return (JsonNullable) phoneNumber; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable web3Wallet() { + return (JsonNullable) web3Wallet; + } + + @JsonIgnore + public boolean passwordEnabled() { + return passwordEnabled; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable firstName() { + return (JsonNullable) firstName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastName() { + return (JsonNullable) lastName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unsafeMetadata() { + return (Optional) unsafeMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + @JsonIgnore + public boolean customAction() { + return customAction; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable externalId() { + return (JsonNullable) externalId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable createdSessionId() { + return (JsonNullable) createdSessionId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable createdUserId() { + return (JsonNullable) createdUserId; + } + + @JsonIgnore + public long abandonAt() { + return abandonAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional externalAccount() { + return (Optional) externalAccount; + } + + public final static Builder builder() { + return new Builder(); + } + + public SignUp withObject(SignUpObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public SignUp withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public SignUp withStatus(SignUpStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public SignUp withRequiredFields(java.util.List requiredFields) { + Utils.checkNotNull(requiredFields, "requiredFields"); + this.requiredFields = Optional.ofNullable(requiredFields); + return this; + } + + public SignUp withRequiredFields(Optional> requiredFields) { + Utils.checkNotNull(requiredFields, "requiredFields"); + this.requiredFields = requiredFields; + return this; + } + + public SignUp withOptionalFields(java.util.List optionalFields) { + Utils.checkNotNull(optionalFields, "optionalFields"); + this.optionalFields = Optional.ofNullable(optionalFields); + return this; + } + + public SignUp withOptionalFields(Optional> optionalFields) { + Utils.checkNotNull(optionalFields, "optionalFields"); + this.optionalFields = optionalFields; + return this; + } + + public SignUp withMissingFields(java.util.List missingFields) { + Utils.checkNotNull(missingFields, "missingFields"); + this.missingFields = Optional.ofNullable(missingFields); + return this; + } + + public SignUp withMissingFields(Optional> missingFields) { + Utils.checkNotNull(missingFields, "missingFields"); + this.missingFields = missingFields; + return this; + } + + public SignUp withUnverifiedFields(java.util.List unverifiedFields) { + Utils.checkNotNull(unverifiedFields, "unverifiedFields"); + this.unverifiedFields = Optional.ofNullable(unverifiedFields); + return this; + } + + public SignUp withUnverifiedFields(Optional> unverifiedFields) { + Utils.checkNotNull(unverifiedFields, "unverifiedFields"); + this.unverifiedFields = unverifiedFields; + return this; + } + + public SignUp withVerifications(Verifications verifications) { + Utils.checkNotNull(verifications, "verifications"); + this.verifications = Optional.ofNullable(verifications); + return this; + } + + public SignUp withVerifications(Optional verifications) { + Utils.checkNotNull(verifications, "verifications"); + this.verifications = verifications; + return this; + } + + public SignUp withUsername(String username) { + Utils.checkNotNull(username, "username"); + this.username = JsonNullable.of(username); + return this; + } + + public SignUp withUsername(JsonNullable username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + public SignUp withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + public SignUp withEmailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public SignUp withPhoneNumber(String phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = JsonNullable.of(phoneNumber); + return this; + } + + public SignUp withPhoneNumber(JsonNullable phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + public SignUp withWeb3Wallet(String web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = JsonNullable.of(web3Wallet); + return this; + } + + public SignUp withWeb3Wallet(JsonNullable web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + public SignUp withPasswordEnabled(boolean passwordEnabled) { + Utils.checkNotNull(passwordEnabled, "passwordEnabled"); + this.passwordEnabled = passwordEnabled; + return this; + } + + public SignUp withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + public SignUp withFirstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public SignUp withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + public SignUp withLastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + public SignUp withUnsafeMetadata(SignUpUnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + public SignUp withUnsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + public SignUp withPublicMetadata(SignUpPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public SignUp withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public SignUp withCustomAction(boolean customAction) { + Utils.checkNotNull(customAction, "customAction"); + this.customAction = customAction; + return this; + } + + public SignUp withExternalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + public SignUp withExternalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + public SignUp withCreatedSessionId(String createdSessionId) { + Utils.checkNotNull(createdSessionId, "createdSessionId"); + this.createdSessionId = JsonNullable.of(createdSessionId); + return this; + } + + public SignUp withCreatedSessionId(JsonNullable createdSessionId) { + Utils.checkNotNull(createdSessionId, "createdSessionId"); + this.createdSessionId = createdSessionId; + return this; + } + + public SignUp withCreatedUserId(String createdUserId) { + Utils.checkNotNull(createdUserId, "createdUserId"); + this.createdUserId = JsonNullable.of(createdUserId); + return this; + } + + public SignUp withCreatedUserId(JsonNullable createdUserId) { + Utils.checkNotNull(createdUserId, "createdUserId"); + this.createdUserId = createdUserId; + return this; + } + + public SignUp withAbandonAt(long abandonAt) { + Utils.checkNotNull(abandonAt, "abandonAt"); + this.abandonAt = abandonAt; + return this; + } + + public SignUp withExternalAccount(ExternalAccount externalAccount) { + Utils.checkNotNull(externalAccount, "externalAccount"); + this.externalAccount = Optional.ofNullable(externalAccount); + return this; + } + + public SignUp withExternalAccount(Optional externalAccount) { + Utils.checkNotNull(externalAccount, "externalAccount"); + this.externalAccount = externalAccount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignUp other = (SignUp) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.requiredFields, other.requiredFields) && + java.util.Objects.deepEquals(this.optionalFields, other.optionalFields) && + java.util.Objects.deepEquals(this.missingFields, other.missingFields) && + java.util.Objects.deepEquals(this.unverifiedFields, other.unverifiedFields) && + java.util.Objects.deepEquals(this.verifications, other.verifications) && + java.util.Objects.deepEquals(this.username, other.username) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber) && + java.util.Objects.deepEquals(this.web3Wallet, other.web3Wallet) && + java.util.Objects.deepEquals(this.passwordEnabled, other.passwordEnabled) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName) && + java.util.Objects.deepEquals(this.unsafeMetadata, other.unsafeMetadata) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.customAction, other.customAction) && + java.util.Objects.deepEquals(this.externalId, other.externalId) && + java.util.Objects.deepEquals(this.createdSessionId, other.createdSessionId) && + java.util.Objects.deepEquals(this.createdUserId, other.createdUserId) && + java.util.Objects.deepEquals(this.abandonAt, other.abandonAt) && + java.util.Objects.deepEquals(this.externalAccount, other.externalAccount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + id, + status, + requiredFields, + optionalFields, + missingFields, + unverifiedFields, + verifications, + username, + emailAddress, + phoneNumber, + web3Wallet, + passwordEnabled, + firstName, + lastName, + unsafeMetadata, + publicMetadata, + customAction, + externalId, + createdSessionId, + createdUserId, + abandonAt, + externalAccount); + } + + @Override + public String toString() { + return Utils.toString(SignUp.class, + "object", object, + "id", id, + "status", status, + "requiredFields", requiredFields, + "optionalFields", optionalFields, + "missingFields", missingFields, + "unverifiedFields", unverifiedFields, + "verifications", verifications, + "username", username, + "emailAddress", emailAddress, + "phoneNumber", phoneNumber, + "web3Wallet", web3Wallet, + "passwordEnabled", passwordEnabled, + "firstName", firstName, + "lastName", lastName, + "unsafeMetadata", unsafeMetadata, + "publicMetadata", publicMetadata, + "customAction", customAction, + "externalId", externalId, + "createdSessionId", createdSessionId, + "createdUserId", createdUserId, + "abandonAt", abandonAt, + "externalAccount", externalAccount); + } + + public final static class Builder { + + private SignUpObject object; + + private String id; + + private SignUpStatus status; + + private Optional> requiredFields = Optional.empty(); + + private Optional> optionalFields = Optional.empty(); + + private Optional> missingFields = Optional.empty(); + + private Optional> unverifiedFields = Optional.empty(); + + private Optional verifications = Optional.empty(); + + private JsonNullable username = JsonNullable.undefined(); + + private JsonNullable emailAddress = JsonNullable.undefined(); + + private JsonNullable phoneNumber = JsonNullable.undefined(); + + private JsonNullable web3Wallet = JsonNullable.undefined(); + + private Boolean passwordEnabled; + + private JsonNullable firstName = JsonNullable.undefined(); + + private JsonNullable lastName = JsonNullable.undefined(); + + private Optional unsafeMetadata = Optional.empty(); + + private Optional publicMetadata = Optional.empty(); + + private Boolean customAction; + + private JsonNullable externalId = JsonNullable.undefined(); + + private JsonNullable createdSessionId = JsonNullable.undefined(); + + private JsonNullable createdUserId = JsonNullable.undefined(); + + private Long abandonAt; + + private Optional externalAccount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder object(SignUpObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder status(SignUpStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder requiredFields(java.util.List requiredFields) { + Utils.checkNotNull(requiredFields, "requiredFields"); + this.requiredFields = Optional.ofNullable(requiredFields); + return this; + } + + public Builder requiredFields(Optional> requiredFields) { + Utils.checkNotNull(requiredFields, "requiredFields"); + this.requiredFields = requiredFields; + return this; + } + + public Builder optionalFields(java.util.List optionalFields) { + Utils.checkNotNull(optionalFields, "optionalFields"); + this.optionalFields = Optional.ofNullable(optionalFields); + return this; + } + + public Builder optionalFields(Optional> optionalFields) { + Utils.checkNotNull(optionalFields, "optionalFields"); + this.optionalFields = optionalFields; + return this; + } + + public Builder missingFields(java.util.List missingFields) { + Utils.checkNotNull(missingFields, "missingFields"); + this.missingFields = Optional.ofNullable(missingFields); + return this; + } + + public Builder missingFields(Optional> missingFields) { + Utils.checkNotNull(missingFields, "missingFields"); + this.missingFields = missingFields; + return this; + } + + public Builder unverifiedFields(java.util.List unverifiedFields) { + Utils.checkNotNull(unverifiedFields, "unverifiedFields"); + this.unverifiedFields = Optional.ofNullable(unverifiedFields); + return this; + } + + public Builder unverifiedFields(Optional> unverifiedFields) { + Utils.checkNotNull(unverifiedFields, "unverifiedFields"); + this.unverifiedFields = unverifiedFields; + return this; + } + + public Builder verifications(Verifications verifications) { + Utils.checkNotNull(verifications, "verifications"); + this.verifications = Optional.ofNullable(verifications); + return this; + } + + public Builder verifications(Optional verifications) { + Utils.checkNotNull(verifications, "verifications"); + this.verifications = verifications; + return this; + } + + public Builder username(String username) { + Utils.checkNotNull(username, "username"); + this.username = JsonNullable.of(username); + return this; + } + + public Builder username(JsonNullable username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + public Builder emailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = JsonNullable.of(phoneNumber); + return this; + } + + public Builder phoneNumber(JsonNullable phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + public Builder web3Wallet(String web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = JsonNullable.of(web3Wallet); + return this; + } + + public Builder web3Wallet(JsonNullable web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + public Builder passwordEnabled(boolean passwordEnabled) { + Utils.checkNotNull(passwordEnabled, "passwordEnabled"); + this.passwordEnabled = passwordEnabled; + return this; + } + + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + public Builder firstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + public Builder lastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + public Builder unsafeMetadata(SignUpUnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + public Builder unsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + public Builder publicMetadata(SignUpPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder customAction(boolean customAction) { + Utils.checkNotNull(customAction, "customAction"); + this.customAction = customAction; + return this; + } + + public Builder externalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + public Builder externalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + public Builder createdSessionId(String createdSessionId) { + Utils.checkNotNull(createdSessionId, "createdSessionId"); + this.createdSessionId = JsonNullable.of(createdSessionId); + return this; + } + + public Builder createdSessionId(JsonNullable createdSessionId) { + Utils.checkNotNull(createdSessionId, "createdSessionId"); + this.createdSessionId = createdSessionId; + return this; + } + + public Builder createdUserId(String createdUserId) { + Utils.checkNotNull(createdUserId, "createdUserId"); + this.createdUserId = JsonNullable.of(createdUserId); + return this; + } + + public Builder createdUserId(JsonNullable createdUserId) { + Utils.checkNotNull(createdUserId, "createdUserId"); + this.createdUserId = createdUserId; + return this; + } + + public Builder abandonAt(long abandonAt) { + Utils.checkNotNull(abandonAt, "abandonAt"); + this.abandonAt = abandonAt; + return this; + } + + public Builder externalAccount(ExternalAccount externalAccount) { + Utils.checkNotNull(externalAccount, "externalAccount"); + this.externalAccount = Optional.ofNullable(externalAccount); + return this; + } + + public Builder externalAccount(Optional externalAccount) { + Utils.checkNotNull(externalAccount, "externalAccount"); + this.externalAccount = externalAccount; + return this; + } + + public SignUp build() { + return new SignUp( + object, + id, + status, + requiredFields, + optionalFields, + missingFields, + unverifiedFields, + verifications, + username, + emailAddress, + phoneNumber, + web3Wallet, + passwordEnabled, + firstName, + lastName, + unsafeMetadata, + publicMetadata, + customAction, + externalId, + createdSessionId, + createdUserId, + abandonAt, + externalAccount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SignUpObject.java b/src/main/java/com/clerk/backend_api/models/components/SignUpObject.java new file mode 100644 index 0000000..5fac919 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SignUpObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum SignUpObject { + SIGN_UP_ATTEMPT("sign_up_attempt"); + + @JsonValue + private final String value; + + private SignUpObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SignUpPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/components/SignUpPublicMetadata.java new file mode 100644 index 0000000..4851388 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SignUpPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class SignUpPublicMetadata { + + @JsonCreator + public SignUpPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(SignUpPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public SignUpPublicMetadata build() { + return new SignUpPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/SignUpStatus.java b/src/main/java/com/clerk/backend_api/models/components/SignUpStatus.java new file mode 100644 index 0000000..e050671 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SignUpStatus.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum SignUpStatus { + MISSING_REQUIREMENTS("missing_requirements"), + COMPLETE("complete"), + ABANDONED("abandoned"); + + @JsonValue + private final String value; + + private SignUpStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SignUpUnsafeMetadata.java b/src/main/java/com/clerk/backend_api/models/components/SignUpUnsafeMetadata.java new file mode 100644 index 0000000..2b5157a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SignUpUnsafeMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class SignUpUnsafeMetadata { + + @JsonCreator + public SignUpUnsafeMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(SignUpUnsafeMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public SignUpUnsafeMetadata build() { + return new SignUpUnsafeMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Status.java b/src/main/java/com/clerk/backend_api/models/components/Status.java new file mode 100644 index 0000000..785d07e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Status.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum Status { + ACTIVE("active"), + REVOKED("revoked"), + ENDED("ended"), + EXPIRED("expired"), + REMOVED("removed"), + ABANDONED("abandoned"), + REPLACED("replaced"); + + @JsonValue + private final String value; + + private Status(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Strategy.java b/src/main/java/com/clerk/backend_api/models/components/Strategy.java new file mode 100644 index 0000000..b83f0fc --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Strategy.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum Strategy { + PHONE_CODE("phone_code"), + EMAIL_CODE("email_code"), + RESET_PASSWORD_EMAIL_CODE("reset_password_email_code"); + + @JsonValue + private final String value; + + private Strategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/SvixURL.java b/src/main/java/com/clerk/backend_api/models/components/SvixURL.java new file mode 100644 index 0000000..d74f7f9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/SvixURL.java @@ -0,0 +1,90 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class SvixURL { + + @JsonProperty("svix_url") + private String svixUrl; + + @JsonCreator + public SvixURL( + @JsonProperty("svix_url") String svixUrl) { + Utils.checkNotNull(svixUrl, "svixUrl"); + this.svixUrl = svixUrl; + } + + @JsonIgnore + public String svixUrl() { + return svixUrl; + } + + public final static Builder builder() { + return new Builder(); + } + + public SvixURL withSvixUrl(String svixUrl) { + Utils.checkNotNull(svixUrl, "svixUrl"); + this.svixUrl = svixUrl; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SvixURL other = (SvixURL) o; + return + java.util.Objects.deepEquals(this.svixUrl, other.svixUrl); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + svixUrl); + } + + @Override + public String toString() { + return Utils.toString(SvixURL.class, + "svixUrl", svixUrl); + } + + public final static class Builder { + + private String svixUrl; + + private Builder() { + // force use of static builder() method + } + + public Builder svixUrl(String svixUrl) { + Utils.checkNotNull(svixUrl, "svixUrl"); + this.svixUrl = svixUrl; + return this; + } + + public SvixURL build() { + return new SvixURL( + svixUrl); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Template.java b/src/main/java/com/clerk/backend_api/models/components/Template.java new file mode 100644 index 0000000..6ee66b8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Template.java @@ -0,0 +1,1296 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Template { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + /** + * the id of the instance the template belongs to + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("instance_id") + private JsonNullable instanceId; + + /** + * whether this is a system (default) or user overridden) template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("resource_type") + private Optional resourceType; + + /** + * whether this is an email or SMS template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("template_type") + private Optional templateType; + + /** + * user-friendly name of the template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + /** + * machine-friendly name of the template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("slug") + private Optional slug; + + /** + * position with the listing of templates + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("position") + private Optional position; + + /** + * whether this template can be reverted to the corresponding system default + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("can_revert") + private Optional canRevert; + + /** + * whether this template can be deleted + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("can_delete") + private Optional canDelete; + + /** + * whether this template can be disabled, true only for notification SMS templates + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("can_disable") + private Optional canDisable; + + /** + * email subject + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subject") + private JsonNullable subject; + + /** + * the editor markup used to generate the body of the template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("markup") + private Optional markup; + + /** + * the template body before variable interpolation + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("body") + private Optional body; + + /** + * list of variables that are available for use in the template body + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("available_variables") + private Optional> availableVariables; + + /** + * list of variables that must be contained in the template body + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("required_variables") + private Optional> requiredVariables; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("from_email_name") + private Optional fromEmailName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reply_to_email_name") + private Optional replyToEmailName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("delivered_by_clerk") + private Optional deliveredByClerk; + + /** + * Unix timestamp of last update. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private Optional updatedAt; + + /** + * Unix timestamp of creation. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private Optional createdAt; + + @JsonCreator + public Template( + @JsonProperty("id") Optional id, + @JsonProperty("object") Optional object, + @JsonProperty("instance_id") JsonNullable instanceId, + @JsonProperty("resource_type") Optional resourceType, + @JsonProperty("template_type") Optional templateType, + @JsonProperty("name") Optional name, + @JsonProperty("slug") Optional slug, + @JsonProperty("position") Optional position, + @JsonProperty("can_revert") Optional canRevert, + @JsonProperty("can_delete") Optional canDelete, + @JsonProperty("can_disable") Optional canDisable, + @JsonProperty("subject") JsonNullable subject, + @JsonProperty("markup") Optional markup, + @JsonProperty("body") Optional body, + @JsonProperty("available_variables") Optional> availableVariables, + @JsonProperty("required_variables") Optional> requiredVariables, + @JsonProperty("from_email_name") Optional fromEmailName, + @JsonProperty("reply_to_email_name") Optional replyToEmailName, + @JsonProperty("delivered_by_clerk") Optional deliveredByClerk, + @JsonProperty("updated_at") Optional updatedAt, + @JsonProperty("created_at") Optional createdAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(instanceId, "instanceId"); + Utils.checkNotNull(resourceType, "resourceType"); + Utils.checkNotNull(templateType, "templateType"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(position, "position"); + Utils.checkNotNull(canRevert, "canRevert"); + Utils.checkNotNull(canDelete, "canDelete"); + Utils.checkNotNull(canDisable, "canDisable"); + Utils.checkNotNull(subject, "subject"); + Utils.checkNotNull(markup, "markup"); + Utils.checkNotNull(body, "body"); + Utils.checkNotNull(availableVariables, "availableVariables"); + Utils.checkNotNull(requiredVariables, "requiredVariables"); + Utils.checkNotNull(fromEmailName, "fromEmailName"); + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(createdAt, "createdAt"); + this.id = id; + this.object = object; + this.instanceId = instanceId; + this.resourceType = resourceType; + this.templateType = templateType; + this.name = name; + this.slug = slug; + this.position = position; + this.canRevert = canRevert; + this.canDelete = canDelete; + this.canDisable = canDisable; + this.subject = subject; + this.markup = markup; + this.body = body; + this.availableVariables = availableVariables; + this.requiredVariables = requiredVariables; + this.fromEmailName = fromEmailName; + this.replyToEmailName = replyToEmailName; + this.deliveredByClerk = deliveredByClerk; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + } + + public Template() { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + /** + * the id of the instance the template belongs to + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable instanceId() { + return (JsonNullable) instanceId; + } + + /** + * whether this is a system (default) or user overridden) template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional resourceType() { + return (Optional) resourceType; + } + + /** + * whether this is an email or SMS template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional templateType() { + return (Optional) templateType; + } + + /** + * user-friendly name of the template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; + } + + /** + * machine-friendly name of the template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional slug() { + return (Optional) slug; + } + + /** + * position with the listing of templates + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional position() { + return (Optional) position; + } + + /** + * whether this template can be reverted to the corresponding system default + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional canRevert() { + return (Optional) canRevert; + } + + /** + * whether this template can be deleted + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional canDelete() { + return (Optional) canDelete; + } + + /** + * whether this template can be disabled, true only for notification SMS templates + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional canDisable() { + return (Optional) canDisable; + } + + /** + * email subject + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable subject() { + return (JsonNullable) subject; + } + + /** + * the editor markup used to generate the body of the template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional markup() { + return (Optional) markup; + } + + /** + * the template body before variable interpolation + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional body() { + return (Optional) body; + } + + /** + * list of variables that are available for use in the template body + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> availableVariables() { + return (Optional>) availableVariables; + } + + /** + * list of variables that must be contained in the template body + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> requiredVariables() { + return (Optional>) requiredVariables; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional fromEmailName() { + return (Optional) fromEmailName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional replyToEmailName() { + return (Optional) replyToEmailName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deliveredByClerk() { + return (Optional) deliveredByClerk; + } + + /** + * Unix timestamp of last update. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; + } + + /** + * Unix timestamp of creation. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Template withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Template withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Template withObject(TemplateObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Template withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + /** + * the id of the instance the template belongs to + */ + public Template withInstanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = JsonNullable.of(instanceId); + return this; + } + + /** + * the id of the instance the template belongs to + */ + public Template withInstanceId(JsonNullable instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + /** + * whether this is a system (default) or user overridden) template + */ + public Template withResourceType(String resourceType) { + Utils.checkNotNull(resourceType, "resourceType"); + this.resourceType = Optional.ofNullable(resourceType); + return this; + } + + /** + * whether this is a system (default) or user overridden) template + */ + public Template withResourceType(Optional resourceType) { + Utils.checkNotNull(resourceType, "resourceType"); + this.resourceType = resourceType; + return this; + } + + /** + * whether this is an email or SMS template + */ + public Template withTemplateType(String templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = Optional.ofNullable(templateType); + return this; + } + + /** + * whether this is an email or SMS template + */ + public Template withTemplateType(Optional templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * user-friendly name of the template + */ + public Template withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * user-friendly name of the template + */ + public Template withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * machine-friendly name of the template + */ + public Template withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + /** + * machine-friendly name of the template + */ + public Template withSlug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + /** + * position with the listing of templates + */ + public Template withPosition(long position) { + Utils.checkNotNull(position, "position"); + this.position = Optional.ofNullable(position); + return this; + } + + /** + * position with the listing of templates + */ + public Template withPosition(Optional position) { + Utils.checkNotNull(position, "position"); + this.position = position; + return this; + } + + /** + * whether this template can be reverted to the corresponding system default + */ + public Template withCanRevert(boolean canRevert) { + Utils.checkNotNull(canRevert, "canRevert"); + this.canRevert = Optional.ofNullable(canRevert); + return this; + } + + /** + * whether this template can be reverted to the corresponding system default + */ + public Template withCanRevert(Optional canRevert) { + Utils.checkNotNull(canRevert, "canRevert"); + this.canRevert = canRevert; + return this; + } + + /** + * whether this template can be deleted + */ + public Template withCanDelete(boolean canDelete) { + Utils.checkNotNull(canDelete, "canDelete"); + this.canDelete = Optional.ofNullable(canDelete); + return this; + } + + /** + * whether this template can be deleted + */ + public Template withCanDelete(Optional canDelete) { + Utils.checkNotNull(canDelete, "canDelete"); + this.canDelete = canDelete; + return this; + } + + /** + * whether this template can be disabled, true only for notification SMS templates + */ + public Template withCanDisable(boolean canDisable) { + Utils.checkNotNull(canDisable, "canDisable"); + this.canDisable = Optional.ofNullable(canDisable); + return this; + } + + /** + * whether this template can be disabled, true only for notification SMS templates + */ + public Template withCanDisable(Optional canDisable) { + Utils.checkNotNull(canDisable, "canDisable"); + this.canDisable = canDisable; + return this; + } + + /** + * email subject + */ + public Template withSubject(String subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = JsonNullable.of(subject); + return this; + } + + /** + * email subject + */ + public Template withSubject(JsonNullable subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = subject; + return this; + } + + /** + * the editor markup used to generate the body of the template + */ + public Template withMarkup(String markup) { + Utils.checkNotNull(markup, "markup"); + this.markup = Optional.ofNullable(markup); + return this; + } + + /** + * the editor markup used to generate the body of the template + */ + public Template withMarkup(Optional markup) { + Utils.checkNotNull(markup, "markup"); + this.markup = markup; + return this; + } + + /** + * the template body before variable interpolation + */ + public Template withBody(String body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + /** + * the template body before variable interpolation + */ + public Template withBody(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + /** + * list of variables that are available for use in the template body + */ + public Template withAvailableVariables(java.util.List availableVariables) { + Utils.checkNotNull(availableVariables, "availableVariables"); + this.availableVariables = Optional.ofNullable(availableVariables); + return this; + } + + /** + * list of variables that are available for use in the template body + */ + public Template withAvailableVariables(Optional> availableVariables) { + Utils.checkNotNull(availableVariables, "availableVariables"); + this.availableVariables = availableVariables; + return this; + } + + /** + * list of variables that must be contained in the template body + */ + public Template withRequiredVariables(java.util.List requiredVariables) { + Utils.checkNotNull(requiredVariables, "requiredVariables"); + this.requiredVariables = Optional.ofNullable(requiredVariables); + return this; + } + + /** + * list of variables that must be contained in the template body + */ + public Template withRequiredVariables(Optional> requiredVariables) { + Utils.checkNotNull(requiredVariables, "requiredVariables"); + this.requiredVariables = requiredVariables; + return this; + } + + public Template withFromEmailName(String fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = Optional.ofNullable(fromEmailName); + return this; + } + + public Template withFromEmailName(Optional fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = fromEmailName; + return this; + } + + public Template withReplyToEmailName(String replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = Optional.ofNullable(replyToEmailName); + return this; + } + + public Template withReplyToEmailName(Optional replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = replyToEmailName; + return this; + } + + public Template withDeliveredByClerk(boolean deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = Optional.ofNullable(deliveredByClerk); + return this; + } + + public Template withDeliveredByClerk(Optional deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = deliveredByClerk; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Template withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Template withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Template withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Template withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Template other = (Template) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.instanceId, other.instanceId) && + java.util.Objects.deepEquals(this.resourceType, other.resourceType) && + java.util.Objects.deepEquals(this.templateType, other.templateType) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.position, other.position) && + java.util.Objects.deepEquals(this.canRevert, other.canRevert) && + java.util.Objects.deepEquals(this.canDelete, other.canDelete) && + java.util.Objects.deepEquals(this.canDisable, other.canDisable) && + java.util.Objects.deepEquals(this.subject, other.subject) && + java.util.Objects.deepEquals(this.markup, other.markup) && + java.util.Objects.deepEquals(this.body, other.body) && + java.util.Objects.deepEquals(this.availableVariables, other.availableVariables) && + java.util.Objects.deepEquals(this.requiredVariables, other.requiredVariables) && + java.util.Objects.deepEquals(this.fromEmailName, other.fromEmailName) && + java.util.Objects.deepEquals(this.replyToEmailName, other.replyToEmailName) && + java.util.Objects.deepEquals(this.deliveredByClerk, other.deliveredByClerk) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + instanceId, + resourceType, + templateType, + name, + slug, + position, + canRevert, + canDelete, + canDisable, + subject, + markup, + body, + availableVariables, + requiredVariables, + fromEmailName, + replyToEmailName, + deliveredByClerk, + updatedAt, + createdAt); + } + + @Override + public String toString() { + return Utils.toString(Template.class, + "id", id, + "object", object, + "instanceId", instanceId, + "resourceType", resourceType, + "templateType", templateType, + "name", name, + "slug", slug, + "position", position, + "canRevert", canRevert, + "canDelete", canDelete, + "canDisable", canDisable, + "subject", subject, + "markup", markup, + "body", body, + "availableVariables", availableVariables, + "requiredVariables", requiredVariables, + "fromEmailName", fromEmailName, + "replyToEmailName", replyToEmailName, + "deliveredByClerk", deliveredByClerk, + "updatedAt", updatedAt, + "createdAt", createdAt); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional object = Optional.empty(); + + private JsonNullable instanceId = JsonNullable.undefined(); + + private Optional resourceType = Optional.empty(); + + private Optional templateType = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional position = Optional.empty(); + + private Optional canRevert = Optional.empty(); + + private Optional canDelete = Optional.empty(); + + private Optional canDisable = Optional.empty(); + + private JsonNullable subject = JsonNullable.undefined(); + + private Optional markup = Optional.empty(); + + private Optional body = Optional.empty(); + + private Optional> availableVariables = Optional.empty(); + + private Optional> requiredVariables = Optional.empty(); + + private Optional fromEmailName = Optional.empty(); + + private Optional replyToEmailName = Optional.empty(); + + private Optional deliveredByClerk = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(TemplateObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + /** + * the id of the instance the template belongs to + */ + public Builder instanceId(String instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = JsonNullable.of(instanceId); + return this; + } + + /** + * the id of the instance the template belongs to + */ + public Builder instanceId(JsonNullable instanceId) { + Utils.checkNotNull(instanceId, "instanceId"); + this.instanceId = instanceId; + return this; + } + + /** + * whether this is a system (default) or user overridden) template + */ + public Builder resourceType(String resourceType) { + Utils.checkNotNull(resourceType, "resourceType"); + this.resourceType = Optional.ofNullable(resourceType); + return this; + } + + /** + * whether this is a system (default) or user overridden) template + */ + public Builder resourceType(Optional resourceType) { + Utils.checkNotNull(resourceType, "resourceType"); + this.resourceType = resourceType; + return this; + } + + /** + * whether this is an email or SMS template + */ + public Builder templateType(String templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = Optional.ofNullable(templateType); + return this; + } + + /** + * whether this is an email or SMS template + */ + public Builder templateType(Optional templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * user-friendly name of the template + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * user-friendly name of the template + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * machine-friendly name of the template + */ + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + /** + * machine-friendly name of the template + */ + public Builder slug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + /** + * position with the listing of templates + */ + public Builder position(long position) { + Utils.checkNotNull(position, "position"); + this.position = Optional.ofNullable(position); + return this; + } + + /** + * position with the listing of templates + */ + public Builder position(Optional position) { + Utils.checkNotNull(position, "position"); + this.position = position; + return this; + } + + /** + * whether this template can be reverted to the corresponding system default + */ + public Builder canRevert(boolean canRevert) { + Utils.checkNotNull(canRevert, "canRevert"); + this.canRevert = Optional.ofNullable(canRevert); + return this; + } + + /** + * whether this template can be reverted to the corresponding system default + */ + public Builder canRevert(Optional canRevert) { + Utils.checkNotNull(canRevert, "canRevert"); + this.canRevert = canRevert; + return this; + } + + /** + * whether this template can be deleted + */ + public Builder canDelete(boolean canDelete) { + Utils.checkNotNull(canDelete, "canDelete"); + this.canDelete = Optional.ofNullable(canDelete); + return this; + } + + /** + * whether this template can be deleted + */ + public Builder canDelete(Optional canDelete) { + Utils.checkNotNull(canDelete, "canDelete"); + this.canDelete = canDelete; + return this; + } + + /** + * whether this template can be disabled, true only for notification SMS templates + */ + public Builder canDisable(boolean canDisable) { + Utils.checkNotNull(canDisable, "canDisable"); + this.canDisable = Optional.ofNullable(canDisable); + return this; + } + + /** + * whether this template can be disabled, true only for notification SMS templates + */ + public Builder canDisable(Optional canDisable) { + Utils.checkNotNull(canDisable, "canDisable"); + this.canDisable = canDisable; + return this; + } + + /** + * email subject + */ + public Builder subject(String subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = JsonNullable.of(subject); + return this; + } + + /** + * email subject + */ + public Builder subject(JsonNullable subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = subject; + return this; + } + + /** + * the editor markup used to generate the body of the template + */ + public Builder markup(String markup) { + Utils.checkNotNull(markup, "markup"); + this.markup = Optional.ofNullable(markup); + return this; + } + + /** + * the editor markup used to generate the body of the template + */ + public Builder markup(Optional markup) { + Utils.checkNotNull(markup, "markup"); + this.markup = markup; + return this; + } + + /** + * the template body before variable interpolation + */ + public Builder body(String body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + /** + * the template body before variable interpolation + */ + public Builder body(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + /** + * list of variables that are available for use in the template body + */ + public Builder availableVariables(java.util.List availableVariables) { + Utils.checkNotNull(availableVariables, "availableVariables"); + this.availableVariables = Optional.ofNullable(availableVariables); + return this; + } + + /** + * list of variables that are available for use in the template body + */ + public Builder availableVariables(Optional> availableVariables) { + Utils.checkNotNull(availableVariables, "availableVariables"); + this.availableVariables = availableVariables; + return this; + } + + /** + * list of variables that must be contained in the template body + */ + public Builder requiredVariables(java.util.List requiredVariables) { + Utils.checkNotNull(requiredVariables, "requiredVariables"); + this.requiredVariables = Optional.ofNullable(requiredVariables); + return this; + } + + /** + * list of variables that must be contained in the template body + */ + public Builder requiredVariables(Optional> requiredVariables) { + Utils.checkNotNull(requiredVariables, "requiredVariables"); + this.requiredVariables = requiredVariables; + return this; + } + + public Builder fromEmailName(String fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = Optional.ofNullable(fromEmailName); + return this; + } + + public Builder fromEmailName(Optional fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = fromEmailName; + return this; + } + + public Builder replyToEmailName(String replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = Optional.ofNullable(replyToEmailName); + return this; + } + + public Builder replyToEmailName(Optional replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = replyToEmailName; + return this; + } + + public Builder deliveredByClerk(boolean deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = Optional.ofNullable(deliveredByClerk); + return this; + } + + public Builder deliveredByClerk(Optional deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = deliveredByClerk; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public Template build() { + return new Template( + id, + object, + instanceId, + resourceType, + templateType, + name, + slug, + position, + canRevert, + canDelete, + canDisable, + subject, + markup, + body, + availableVariables, + requiredVariables, + fromEmailName, + replyToEmailName, + deliveredByClerk, + updatedAt, + createdAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/TemplateObject.java b/src/main/java/com/clerk/backend_api/models/components/TemplateObject.java new file mode 100644 index 0000000..48daa67 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/TemplateObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * TemplateObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum TemplateObject { + TEMPLATE("template"); + + @JsonValue + private final String value; + + private TemplateObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/TestingToken.java b/src/main/java/com/clerk/backend_api/models/components/TestingToken.java new file mode 100644 index 0000000..8a70ff1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/TestingToken.java @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class TestingToken { + + @JsonProperty("object") + private TestingTokenObject object; + + /** + * The actual token. This value is meant to be passed in the `__clerk_testing_token` query parameter with requests to the Frontend API. + */ + @JsonProperty("token") + private String token; + + /** + * Unix timestamp of the token's expiration time. + * + */ + @JsonProperty("expires_at") + private long expiresAt; + + @JsonCreator + public TestingToken( + @JsonProperty("object") TestingTokenObject object, + @JsonProperty("token") String token, + @JsonProperty("expires_at") long expiresAt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(token, "token"); + Utils.checkNotNull(expiresAt, "expiresAt"); + this.object = object; + this.token = token; + this.expiresAt = expiresAt; + } + + @JsonIgnore + public TestingTokenObject object() { + return object; + } + + /** + * The actual token. This value is meant to be passed in the `__clerk_testing_token` query parameter with requests to the Frontend API. + */ + @JsonIgnore + public String token() { + return token; + } + + /** + * Unix timestamp of the token's expiration time. + * + */ + @JsonIgnore + public long expiresAt() { + return expiresAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public TestingToken withObject(TestingTokenObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + /** + * The actual token. This value is meant to be passed in the `__clerk_testing_token` query parameter with requests to the Frontend API. + */ + public TestingToken withToken(String token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + /** + * Unix timestamp of the token's expiration time. + * + */ + public TestingToken withExpiresAt(long expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestingToken other = (TestingToken) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.token, other.token) && + java.util.Objects.deepEquals(this.expiresAt, other.expiresAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + token, + expiresAt); + } + + @Override + public String toString() { + return Utils.toString(TestingToken.class, + "object", object, + "token", token, + "expiresAt", expiresAt); + } + + public final static class Builder { + + private TestingTokenObject object; + + private String token; + + private Long expiresAt; + + private Builder() { + // force use of static builder() method + } + + public Builder object(TestingTokenObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + /** + * The actual token. This value is meant to be passed in the `__clerk_testing_token` query parameter with requests to the Frontend API. + */ + public Builder token(String token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + /** + * Unix timestamp of the token's expiration time. + * + */ + public Builder expiresAt(long expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + public TestingToken build() { + return new TestingToken( + object, + token, + expiresAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/TestingTokenObject.java b/src/main/java/com/clerk/backend_api/models/components/TestingTokenObject.java new file mode 100644 index 0000000..2640848 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/TestingTokenObject.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum TestingTokenObject { + TESTING_TOKEN("testing_token"); + + @JsonValue + private final String value; + + private TestingTokenObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Ticket.java b/src/main/java/com/clerk/backend_api/models/components/Ticket.java new file mode 100644 index 0000000..ef86564 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Ticket.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Ticket { + + @JsonProperty("status") + private TicketVerificationStatus status; + + @JsonProperty("strategy") + private TicketVerificationStrategy strategy; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attempts") + private JsonNullable attempts; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expire_at") + private JsonNullable expireAt; + + @JsonCreator + public Ticket( + @JsonProperty("status") TicketVerificationStatus status, + @JsonProperty("strategy") TicketVerificationStrategy strategy, + @JsonProperty("attempts") JsonNullable attempts, + @JsonProperty("expire_at") JsonNullable expireAt) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(attempts, "attempts"); + Utils.checkNotNull(expireAt, "expireAt"); + this.status = status; + this.strategy = strategy; + this.attempts = attempts; + this.expireAt = expireAt; + } + + public Ticket( + TicketVerificationStatus status, + TicketVerificationStrategy strategy) { + this(status, strategy, JsonNullable.undefined(), JsonNullable.undefined()); + } + + @JsonIgnore + public TicketVerificationStatus status() { + return status; + } + + @JsonIgnore + public TicketVerificationStrategy strategy() { + return strategy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attempts() { + return (JsonNullable) attempts; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable expireAt() { + return (JsonNullable) expireAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Ticket withStatus(TicketVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Ticket withStrategy(TicketVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Ticket withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Ticket withAttempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Ticket withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Ticket withExpireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Ticket other = (Ticket) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.attempts, other.attempts) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + attempts, + expireAt); + } + + @Override + public String toString() { + return Utils.toString(Ticket.class, + "status", status, + "strategy", strategy, + "attempts", attempts, + "expireAt", expireAt); + } + + public final static class Builder { + + private TicketVerificationStatus status; + + private TicketVerificationStrategy strategy; + + private JsonNullable attempts = JsonNullable.undefined(); + + private JsonNullable expireAt = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder status(TicketVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(TicketVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Builder attempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Builder expireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Ticket build() { + return new Ticket( + status, + strategy, + attempts, + expireAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/TicketVerificationStatus.java b/src/main/java/com/clerk/backend_api/models/components/TicketVerificationStatus.java new file mode 100644 index 0000000..2b827f7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/TicketVerificationStatus.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum TicketVerificationStatus { + UNVERIFIED("unverified"), + VERIFIED("verified"), + EXPIRED("expired"); + + @JsonValue + private final String value; + + private TicketVerificationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/TicketVerificationStrategy.java b/src/main/java/com/clerk/backend_api/models/components/TicketVerificationStrategy.java new file mode 100644 index 0000000..8c8f169 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/TicketVerificationStrategy.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum TicketVerificationStrategy { + TICKET("ticket"); + + @JsonValue + private final String value; + + private TicketVerificationStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/TotalCount.java b/src/main/java/com/clerk/backend_api/models/components/TotalCount.java new file mode 100644 index 0000000..e0358ea --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/TotalCount.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class TotalCount { + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonProperty("object") + private TotalCountObject object; + + @JsonProperty("total_count") + private long totalCount; + + @JsonCreator + public TotalCount( + @JsonProperty("object") TotalCountObject object, + @JsonProperty("total_count") long totalCount) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(totalCount, "totalCount"); + this.object = object; + this.totalCount = totalCount; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonIgnore + public TotalCountObject object() { + return object; + } + + @JsonIgnore + public long totalCount() { + return totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public TotalCount withObject(TotalCountObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public TotalCount withTotalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TotalCount other = (TotalCount) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(TotalCount.class, + "object", object, + "totalCount", totalCount); + } + + public final static class Builder { + + private TotalCountObject object; + + private Long totalCount; + + private Builder() { + // force use of static builder() method + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(TotalCountObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder totalCount(long totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public TotalCount build() { + return new TotalCount( + object, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/TotalCountObject.java b/src/main/java/com/clerk/backend_api/models/components/TotalCountObject.java new file mode 100644 index 0000000..c7445e2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/TotalCountObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * TotalCountObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum TotalCountObject { + TOTAL_COUNT("total_count"); + + @JsonValue + private final String value; + + private TotalCountObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Type.java b/src/main/java/com/clerk/backend_api/models/components/Type.java new file mode 100644 index 0000000..1189245 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Type.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum Type { + OAUTH_GOOGLE("oauth_google"), + OAUTH_MOCK("oauth_mock"), + SAML("saml"); + + @JsonValue + private final String value; + + private Type(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/UnsafeMetadata.java b/src/main/java/com/clerk/backend_api/models/components/UnsafeMetadata.java new file mode 100644 index 0000000..2d5496e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/UnsafeMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UnsafeMetadata { + + @JsonCreator + public UnsafeMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UnsafeMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UnsafeMetadata build() { + return new UnsafeMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/User.java b/src/main/java/com/clerk/backend_api/models/components/User.java new file mode 100644 index 0000000..5f0304a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/User.java @@ -0,0 +1,1997 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class User { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_id") + private JsonNullable externalId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary_email_address_id") + private JsonNullable primaryEmailAddressId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary_phone_number_id") + private JsonNullable primaryPhoneNumberId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary_web3_wallet_id") + private JsonNullable primaryWeb3WalletId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("username") + private JsonNullable username; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private JsonNullable firstName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private JsonNullable lastName; + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("profile_image_url") + @Deprecated + private Optional profileImageUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("image_url") + private Optional imageUrl; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("has_image") + private Optional hasImage; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private JsonNullable privateMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unsafe_metadata") + private Optional unsafeMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_addresses") + private Optional> emailAddresses; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone_numbers") + private Optional> phoneNumbers; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("web3_wallets") + private Optional> web3Wallets; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("passkeys") + private Optional> passkeys; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("password_enabled") + private Optional passwordEnabled; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("two_factor_enabled") + private Optional twoFactorEnabled; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totp_enabled") + private Optional totpEnabled; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("backup_code_enabled") + private Optional backupCodeEnabled; + + /** + * Unix timestamp of when MFA was last enabled for this user. It should be noted that this field is not nullified if MFA is disabled. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("mfa_enabled_at") + private JsonNullable mfaEnabledAt; + + /** + * Unix timestamp of when MFA was last disabled for this user. It should be noted that this field is not nullified if MFA is enabled again. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("mfa_disabled_at") + private JsonNullable mfaDisabledAt; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_accounts") + private Optional> externalAccounts; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("saml_accounts") + private Optional> samlAccounts; + + /** + * Unix timestamp of last sign-in. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_sign_in_at") + private JsonNullable lastSignInAt; + + /** + * Flag to denote whether user is banned or not. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("banned") + private Optional banned; + + /** + * Flag to denote whether user is currently locked, i.e. restricted from signing in or not. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("locked") + private Optional locked; + + /** + * The number of seconds remaining until the lockout period expires for a locked user. A null value for a locked user indicates that lockout never expires. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lockout_expires_in_seconds") + private JsonNullable lockoutExpiresInSeconds; + + /** + * The number of verification attempts remaining until the user is locked. Null if account lockout is not enabled. Note: if a user is locked explicitly via the Backend API, they may still have verification attempts remaining. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("verification_attempts_remaining") + private JsonNullable verificationAttemptsRemaining; + + /** + * Unix timestamp of last update. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private Optional updatedAt; + + /** + * Unix timestamp of creation. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private Optional createdAt; + + /** + * If enabled, user can delete themselves via FAPI. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("delete_self_enabled") + private Optional deleteSelfEnabled; + + /** + * If enabled, user can create organizations via FAPI. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("create_organization_enabled") + private Optional createOrganizationEnabled; + + /** + * Unix timestamp of the latest session activity, with day precision. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_active_at") + private JsonNullable lastActiveAt; + + @JsonCreator + public User( + @JsonProperty("id") Optional id, + @JsonProperty("object") Optional object, + @JsonProperty("external_id") JsonNullable externalId, + @JsonProperty("primary_email_address_id") JsonNullable primaryEmailAddressId, + @JsonProperty("primary_phone_number_id") JsonNullable primaryPhoneNumberId, + @JsonProperty("primary_web3_wallet_id") JsonNullable primaryWeb3WalletId, + @JsonProperty("username") JsonNullable username, + @JsonProperty("first_name") JsonNullable firstName, + @JsonProperty("last_name") JsonNullable lastName, + @JsonProperty("profile_image_url") Optional profileImageUrl, + @JsonProperty("image_url") Optional imageUrl, + @JsonProperty("has_image") Optional hasImage, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") JsonNullable privateMetadata, + @JsonProperty("unsafe_metadata") Optional unsafeMetadata, + @JsonProperty("email_addresses") Optional> emailAddresses, + @JsonProperty("phone_numbers") Optional> phoneNumbers, + @JsonProperty("web3_wallets") Optional> web3Wallets, + @JsonProperty("passkeys") Optional> passkeys, + @JsonProperty("password_enabled") Optional passwordEnabled, + @JsonProperty("two_factor_enabled") Optional twoFactorEnabled, + @JsonProperty("totp_enabled") Optional totpEnabled, + @JsonProperty("backup_code_enabled") Optional backupCodeEnabled, + @JsonProperty("mfa_enabled_at") JsonNullable mfaEnabledAt, + @JsonProperty("mfa_disabled_at") JsonNullable mfaDisabledAt, + @JsonProperty("external_accounts") Optional> externalAccounts, + @JsonProperty("saml_accounts") Optional> samlAccounts, + @JsonProperty("last_sign_in_at") JsonNullable lastSignInAt, + @JsonProperty("banned") Optional banned, + @JsonProperty("locked") Optional locked, + @JsonProperty("lockout_expires_in_seconds") JsonNullable lockoutExpiresInSeconds, + @JsonProperty("verification_attempts_remaining") JsonNullable verificationAttemptsRemaining, + @JsonProperty("updated_at") Optional updatedAt, + @JsonProperty("created_at") Optional createdAt, + @JsonProperty("delete_self_enabled") Optional deleteSelfEnabled, + @JsonProperty("create_organization_enabled") Optional createOrganizationEnabled, + @JsonProperty("last_active_at") JsonNullable lastActiveAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(externalId, "externalId"); + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + Utils.checkNotNull(username, "username"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + Utils.checkNotNull(imageUrl, "imageUrl"); + Utils.checkNotNull(hasImage, "hasImage"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + Utils.checkNotNull(emailAddresses, "emailAddresses"); + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + Utils.checkNotNull(web3Wallets, "web3Wallets"); + Utils.checkNotNull(passkeys, "passkeys"); + Utils.checkNotNull(passwordEnabled, "passwordEnabled"); + Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled"); + Utils.checkNotNull(totpEnabled, "totpEnabled"); + Utils.checkNotNull(backupCodeEnabled, "backupCodeEnabled"); + Utils.checkNotNull(mfaEnabledAt, "mfaEnabledAt"); + Utils.checkNotNull(mfaDisabledAt, "mfaDisabledAt"); + Utils.checkNotNull(externalAccounts, "externalAccounts"); + Utils.checkNotNull(samlAccounts, "samlAccounts"); + Utils.checkNotNull(lastSignInAt, "lastSignInAt"); + Utils.checkNotNull(banned, "banned"); + Utils.checkNotNull(locked, "locked"); + Utils.checkNotNull(lockoutExpiresInSeconds, "lockoutExpiresInSeconds"); + Utils.checkNotNull(verificationAttemptsRemaining, "verificationAttemptsRemaining"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + Utils.checkNotNull(lastActiveAt, "lastActiveAt"); + this.id = id; + this.object = object; + this.externalId = externalId; + this.primaryEmailAddressId = primaryEmailAddressId; + this.primaryPhoneNumberId = primaryPhoneNumberId; + this.primaryWeb3WalletId = primaryWeb3WalletId; + this.username = username; + this.firstName = firstName; + this.lastName = lastName; + this.profileImageUrl = profileImageUrl; + this.imageUrl = imageUrl; + this.hasImage = hasImage; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.unsafeMetadata = unsafeMetadata; + this.emailAddresses = emailAddresses; + this.phoneNumbers = phoneNumbers; + this.web3Wallets = web3Wallets; + this.passkeys = passkeys; + this.passwordEnabled = passwordEnabled; + this.twoFactorEnabled = twoFactorEnabled; + this.totpEnabled = totpEnabled; + this.backupCodeEnabled = backupCodeEnabled; + this.mfaEnabledAt = mfaEnabledAt; + this.mfaDisabledAt = mfaDisabledAt; + this.externalAccounts = externalAccounts; + this.samlAccounts = samlAccounts; + this.lastSignInAt = lastSignInAt; + this.banned = banned; + this.locked = locked; + this.lockoutExpiresInSeconds = lockoutExpiresInSeconds; + this.verificationAttemptsRemaining = verificationAttemptsRemaining; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + this.deleteSelfEnabled = deleteSelfEnabled; + this.createOrganizationEnabled = createOrganizationEnabled; + this.lastActiveAt = lastActiveAt; + } + + public User() { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable externalId() { + return (JsonNullable) externalId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable primaryEmailAddressId() { + return (JsonNullable) primaryEmailAddressId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable primaryPhoneNumberId() { + return (JsonNullable) primaryPhoneNumberId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable primaryWeb3WalletId() { + return (JsonNullable) primaryWeb3WalletId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable username() { + return (JsonNullable) username; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable firstName() { + return (JsonNullable) firstName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastName() { + return (JsonNullable) lastName; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional profileImageUrl() { + return (Optional) profileImageUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional imageUrl() { + return (Optional) imageUrl; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional hasImage() { + return (Optional) hasImage; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable privateMetadata() { + return (JsonNullable) privateMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unsafeMetadata() { + return (Optional) unsafeMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> emailAddresses() { + return (Optional>) emailAddresses; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> phoneNumbers() { + return (Optional>) phoneNumbers; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> web3Wallets() { + return (Optional>) web3Wallets; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> passkeys() { + return (Optional>) passkeys; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional passwordEnabled() { + return (Optional) passwordEnabled; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional twoFactorEnabled() { + return (Optional) twoFactorEnabled; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional totpEnabled() { + return (Optional) totpEnabled; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional backupCodeEnabled() { + return (Optional) backupCodeEnabled; + } + + /** + * Unix timestamp of when MFA was last enabled for this user. It should be noted that this field is not nullified if MFA is disabled. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable mfaEnabledAt() { + return (JsonNullable) mfaEnabledAt; + } + + /** + * Unix timestamp of when MFA was last disabled for this user. It should be noted that this field is not nullified if MFA is enabled again. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable mfaDisabledAt() { + return (JsonNullable) mfaDisabledAt; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> externalAccounts() { + return (Optional>) externalAccounts; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> samlAccounts() { + return (Optional>) samlAccounts; + } + + /** + * Unix timestamp of last sign-in. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastSignInAt() { + return (JsonNullable) lastSignInAt; + } + + /** + * Flag to denote whether user is banned or not. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional banned() { + return (Optional) banned; + } + + /** + * Flag to denote whether user is currently locked, i.e. restricted from signing in or not. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional locked() { + return (Optional) locked; + } + + /** + * The number of seconds remaining until the lockout period expires for a locked user. A null value for a locked user indicates that lockout never expires. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lockoutExpiresInSeconds() { + return (JsonNullable) lockoutExpiresInSeconds; + } + + /** + * The number of verification attempts remaining until the user is locked. Null if account lockout is not enabled. Note: if a user is locked explicitly via the Backend API, they may still have verification attempts remaining. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable verificationAttemptsRemaining() { + return (JsonNullable) verificationAttemptsRemaining; + } + + /** + * Unix timestamp of last update. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updatedAt() { + return (Optional) updatedAt; + } + + /** + * Unix timestamp of creation. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + /** + * If enabled, user can delete themselves via FAPI. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deleteSelfEnabled() { + return (Optional) deleteSelfEnabled; + } + + /** + * If enabled, user can create organizations via FAPI. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createOrganizationEnabled() { + return (Optional) createOrganizationEnabled; + } + + /** + * Unix timestamp of the latest session activity, with day precision. + * + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastActiveAt() { + return (JsonNullable) lastActiveAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public User withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public User withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public User withObject(UserObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public User withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public User withExternalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + public User withExternalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + public User withPrimaryEmailAddressId(String primaryEmailAddressId) { + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + this.primaryEmailAddressId = JsonNullable.of(primaryEmailAddressId); + return this; + } + + public User withPrimaryEmailAddressId(JsonNullable primaryEmailAddressId) { + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + this.primaryEmailAddressId = primaryEmailAddressId; + return this; + } + + public User withPrimaryPhoneNumberId(String primaryPhoneNumberId) { + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + this.primaryPhoneNumberId = JsonNullable.of(primaryPhoneNumberId); + return this; + } + + public User withPrimaryPhoneNumberId(JsonNullable primaryPhoneNumberId) { + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + this.primaryPhoneNumberId = primaryPhoneNumberId; + return this; + } + + public User withPrimaryWeb3WalletId(String primaryWeb3WalletId) { + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + this.primaryWeb3WalletId = JsonNullable.of(primaryWeb3WalletId); + return this; + } + + public User withPrimaryWeb3WalletId(JsonNullable primaryWeb3WalletId) { + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + this.primaryWeb3WalletId = primaryWeb3WalletId; + return this; + } + + public User withUsername(String username) { + Utils.checkNotNull(username, "username"); + this.username = JsonNullable.of(username); + return this; + } + + public User withUsername(JsonNullable username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + public User withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + public User withFirstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public User withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + public User withLastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public User withProfileImageUrl(String profileImageUrl) { + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + this.profileImageUrl = Optional.ofNullable(profileImageUrl); + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public User withProfileImageUrl(Optional profileImageUrl) { + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + this.profileImageUrl = profileImageUrl; + return this; + } + + public User withImageUrl(String imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = Optional.ofNullable(imageUrl); + return this; + } + + public User withImageUrl(Optional imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = imageUrl; + return this; + } + + public User withHasImage(boolean hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = Optional.ofNullable(hasImage); + return this; + } + + public User withHasImage(Optional hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = hasImage; + return this; + } + + public User withPublicMetadata(PublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public User withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public User withPrivateMetadata(PrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = JsonNullable.of(privateMetadata); + return this; + } + + public User withPrivateMetadata(JsonNullable privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public User withUnsafeMetadata(UnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + public User withUnsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + public User withEmailAddresses(java.util.List emailAddresses) { + Utils.checkNotNull(emailAddresses, "emailAddresses"); + this.emailAddresses = Optional.ofNullable(emailAddresses); + return this; + } + + public User withEmailAddresses(Optional> emailAddresses) { + Utils.checkNotNull(emailAddresses, "emailAddresses"); + this.emailAddresses = emailAddresses; + return this; + } + + public User withPhoneNumbers(java.util.List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + public User withPhoneNumbers(Optional> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + public User withWeb3Wallets(java.util.List web3Wallets) { + Utils.checkNotNull(web3Wallets, "web3Wallets"); + this.web3Wallets = Optional.ofNullable(web3Wallets); + return this; + } + + public User withWeb3Wallets(Optional> web3Wallets) { + Utils.checkNotNull(web3Wallets, "web3Wallets"); + this.web3Wallets = web3Wallets; + return this; + } + + public User withPasskeys(java.util.List passkeys) { + Utils.checkNotNull(passkeys, "passkeys"); + this.passkeys = Optional.ofNullable(passkeys); + return this; + } + + public User withPasskeys(Optional> passkeys) { + Utils.checkNotNull(passkeys, "passkeys"); + this.passkeys = passkeys; + return this; + } + + public User withPasswordEnabled(boolean passwordEnabled) { + Utils.checkNotNull(passwordEnabled, "passwordEnabled"); + this.passwordEnabled = Optional.ofNullable(passwordEnabled); + return this; + } + + public User withPasswordEnabled(Optional passwordEnabled) { + Utils.checkNotNull(passwordEnabled, "passwordEnabled"); + this.passwordEnabled = passwordEnabled; + return this; + } + + public User withTwoFactorEnabled(boolean twoFactorEnabled) { + Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled"); + this.twoFactorEnabled = Optional.ofNullable(twoFactorEnabled); + return this; + } + + public User withTwoFactorEnabled(Optional twoFactorEnabled) { + Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled"); + this.twoFactorEnabled = twoFactorEnabled; + return this; + } + + public User withTotpEnabled(boolean totpEnabled) { + Utils.checkNotNull(totpEnabled, "totpEnabled"); + this.totpEnabled = Optional.ofNullable(totpEnabled); + return this; + } + + public User withTotpEnabled(Optional totpEnabled) { + Utils.checkNotNull(totpEnabled, "totpEnabled"); + this.totpEnabled = totpEnabled; + return this; + } + + public User withBackupCodeEnabled(boolean backupCodeEnabled) { + Utils.checkNotNull(backupCodeEnabled, "backupCodeEnabled"); + this.backupCodeEnabled = Optional.ofNullable(backupCodeEnabled); + return this; + } + + public User withBackupCodeEnabled(Optional backupCodeEnabled) { + Utils.checkNotNull(backupCodeEnabled, "backupCodeEnabled"); + this.backupCodeEnabled = backupCodeEnabled; + return this; + } + + /** + * Unix timestamp of when MFA was last enabled for this user. It should be noted that this field is not nullified if MFA is disabled. + * + */ + public User withMfaEnabledAt(long mfaEnabledAt) { + Utils.checkNotNull(mfaEnabledAt, "mfaEnabledAt"); + this.mfaEnabledAt = JsonNullable.of(mfaEnabledAt); + return this; + } + + /** + * Unix timestamp of when MFA was last enabled for this user. It should be noted that this field is not nullified if MFA is disabled. + * + */ + public User withMfaEnabledAt(JsonNullable mfaEnabledAt) { + Utils.checkNotNull(mfaEnabledAt, "mfaEnabledAt"); + this.mfaEnabledAt = mfaEnabledAt; + return this; + } + + /** + * Unix timestamp of when MFA was last disabled for this user. It should be noted that this field is not nullified if MFA is enabled again. + * + */ + public User withMfaDisabledAt(long mfaDisabledAt) { + Utils.checkNotNull(mfaDisabledAt, "mfaDisabledAt"); + this.mfaDisabledAt = JsonNullable.of(mfaDisabledAt); + return this; + } + + /** + * Unix timestamp of when MFA was last disabled for this user. It should be noted that this field is not nullified if MFA is enabled again. + * + */ + public User withMfaDisabledAt(JsonNullable mfaDisabledAt) { + Utils.checkNotNull(mfaDisabledAt, "mfaDisabledAt"); + this.mfaDisabledAt = mfaDisabledAt; + return this; + } + + public User withExternalAccounts(java.util.List externalAccounts) { + Utils.checkNotNull(externalAccounts, "externalAccounts"); + this.externalAccounts = Optional.ofNullable(externalAccounts); + return this; + } + + public User withExternalAccounts(Optional> externalAccounts) { + Utils.checkNotNull(externalAccounts, "externalAccounts"); + this.externalAccounts = externalAccounts; + return this; + } + + public User withSamlAccounts(java.util.List samlAccounts) { + Utils.checkNotNull(samlAccounts, "samlAccounts"); + this.samlAccounts = Optional.ofNullable(samlAccounts); + return this; + } + + public User withSamlAccounts(Optional> samlAccounts) { + Utils.checkNotNull(samlAccounts, "samlAccounts"); + this.samlAccounts = samlAccounts; + return this; + } + + /** + * Unix timestamp of last sign-in. + * + */ + public User withLastSignInAt(long lastSignInAt) { + Utils.checkNotNull(lastSignInAt, "lastSignInAt"); + this.lastSignInAt = JsonNullable.of(lastSignInAt); + return this; + } + + /** + * Unix timestamp of last sign-in. + * + */ + public User withLastSignInAt(JsonNullable lastSignInAt) { + Utils.checkNotNull(lastSignInAt, "lastSignInAt"); + this.lastSignInAt = lastSignInAt; + return this; + } + + /** + * Flag to denote whether user is banned or not. + * + */ + public User withBanned(boolean banned) { + Utils.checkNotNull(banned, "banned"); + this.banned = Optional.ofNullable(banned); + return this; + } + + /** + * Flag to denote whether user is banned or not. + * + */ + public User withBanned(Optional banned) { + Utils.checkNotNull(banned, "banned"); + this.banned = banned; + return this; + } + + /** + * Flag to denote whether user is currently locked, i.e. restricted from signing in or not. + * + */ + public User withLocked(boolean locked) { + Utils.checkNotNull(locked, "locked"); + this.locked = Optional.ofNullable(locked); + return this; + } + + /** + * Flag to denote whether user is currently locked, i.e. restricted from signing in or not. + * + */ + public User withLocked(Optional locked) { + Utils.checkNotNull(locked, "locked"); + this.locked = locked; + return this; + } + + /** + * The number of seconds remaining until the lockout period expires for a locked user. A null value for a locked user indicates that lockout never expires. + * + */ + public User withLockoutExpiresInSeconds(long lockoutExpiresInSeconds) { + Utils.checkNotNull(lockoutExpiresInSeconds, "lockoutExpiresInSeconds"); + this.lockoutExpiresInSeconds = JsonNullable.of(lockoutExpiresInSeconds); + return this; + } + + /** + * The number of seconds remaining until the lockout period expires for a locked user. A null value for a locked user indicates that lockout never expires. + * + */ + public User withLockoutExpiresInSeconds(JsonNullable lockoutExpiresInSeconds) { + Utils.checkNotNull(lockoutExpiresInSeconds, "lockoutExpiresInSeconds"); + this.lockoutExpiresInSeconds = lockoutExpiresInSeconds; + return this; + } + + /** + * The number of verification attempts remaining until the user is locked. Null if account lockout is not enabled. Note: if a user is locked explicitly via the Backend API, they may still have verification attempts remaining. + * + */ + public User withVerificationAttemptsRemaining(long verificationAttemptsRemaining) { + Utils.checkNotNull(verificationAttemptsRemaining, "verificationAttemptsRemaining"); + this.verificationAttemptsRemaining = JsonNullable.of(verificationAttemptsRemaining); + return this; + } + + /** + * The number of verification attempts remaining until the user is locked. Null if account lockout is not enabled. Note: if a user is locked explicitly via the Backend API, they may still have verification attempts remaining. + * + */ + public User withVerificationAttemptsRemaining(JsonNullable verificationAttemptsRemaining) { + Utils.checkNotNull(verificationAttemptsRemaining, "verificationAttemptsRemaining"); + this.verificationAttemptsRemaining = verificationAttemptsRemaining; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public User withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public User withUpdatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public User withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public User withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * If enabled, user can delete themselves via FAPI. + * + */ + public User withDeleteSelfEnabled(boolean deleteSelfEnabled) { + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + this.deleteSelfEnabled = Optional.ofNullable(deleteSelfEnabled); + return this; + } + + /** + * If enabled, user can delete themselves via FAPI. + * + */ + public User withDeleteSelfEnabled(Optional deleteSelfEnabled) { + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + this.deleteSelfEnabled = deleteSelfEnabled; + return this; + } + + /** + * If enabled, user can create organizations via FAPI. + * + */ + public User withCreateOrganizationEnabled(boolean createOrganizationEnabled) { + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + this.createOrganizationEnabled = Optional.ofNullable(createOrganizationEnabled); + return this; + } + + /** + * If enabled, user can create organizations via FAPI. + * + */ + public User withCreateOrganizationEnabled(Optional createOrganizationEnabled) { + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + this.createOrganizationEnabled = createOrganizationEnabled; + return this; + } + + /** + * Unix timestamp of the latest session activity, with day precision. + * + */ + public User withLastActiveAt(long lastActiveAt) { + Utils.checkNotNull(lastActiveAt, "lastActiveAt"); + this.lastActiveAt = JsonNullable.of(lastActiveAt); + return this; + } + + /** + * Unix timestamp of the latest session activity, with day precision. + * + */ + public User withLastActiveAt(JsonNullable lastActiveAt) { + Utils.checkNotNull(lastActiveAt, "lastActiveAt"); + this.lastActiveAt = lastActiveAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User other = (User) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.externalId, other.externalId) && + java.util.Objects.deepEquals(this.primaryEmailAddressId, other.primaryEmailAddressId) && + java.util.Objects.deepEquals(this.primaryPhoneNumberId, other.primaryPhoneNumberId) && + java.util.Objects.deepEquals(this.primaryWeb3WalletId, other.primaryWeb3WalletId) && + java.util.Objects.deepEquals(this.username, other.username) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName) && + java.util.Objects.deepEquals(this.profileImageUrl, other.profileImageUrl) && + java.util.Objects.deepEquals(this.imageUrl, other.imageUrl) && + java.util.Objects.deepEquals(this.hasImage, other.hasImage) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.unsafeMetadata, other.unsafeMetadata) && + java.util.Objects.deepEquals(this.emailAddresses, other.emailAddresses) && + java.util.Objects.deepEquals(this.phoneNumbers, other.phoneNumbers) && + java.util.Objects.deepEquals(this.web3Wallets, other.web3Wallets) && + java.util.Objects.deepEquals(this.passkeys, other.passkeys) && + java.util.Objects.deepEquals(this.passwordEnabled, other.passwordEnabled) && + java.util.Objects.deepEquals(this.twoFactorEnabled, other.twoFactorEnabled) && + java.util.Objects.deepEquals(this.totpEnabled, other.totpEnabled) && + java.util.Objects.deepEquals(this.backupCodeEnabled, other.backupCodeEnabled) && + java.util.Objects.deepEquals(this.mfaEnabledAt, other.mfaEnabledAt) && + java.util.Objects.deepEquals(this.mfaDisabledAt, other.mfaDisabledAt) && + java.util.Objects.deepEquals(this.externalAccounts, other.externalAccounts) && + java.util.Objects.deepEquals(this.samlAccounts, other.samlAccounts) && + java.util.Objects.deepEquals(this.lastSignInAt, other.lastSignInAt) && + java.util.Objects.deepEquals(this.banned, other.banned) && + java.util.Objects.deepEquals(this.locked, other.locked) && + java.util.Objects.deepEquals(this.lockoutExpiresInSeconds, other.lockoutExpiresInSeconds) && + java.util.Objects.deepEquals(this.verificationAttemptsRemaining, other.verificationAttemptsRemaining) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.deleteSelfEnabled, other.deleteSelfEnabled) && + java.util.Objects.deepEquals(this.createOrganizationEnabled, other.createOrganizationEnabled) && + java.util.Objects.deepEquals(this.lastActiveAt, other.lastActiveAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + externalId, + primaryEmailAddressId, + primaryPhoneNumberId, + primaryWeb3WalletId, + username, + firstName, + lastName, + profileImageUrl, + imageUrl, + hasImage, + publicMetadata, + privateMetadata, + unsafeMetadata, + emailAddresses, + phoneNumbers, + web3Wallets, + passkeys, + passwordEnabled, + twoFactorEnabled, + totpEnabled, + backupCodeEnabled, + mfaEnabledAt, + mfaDisabledAt, + externalAccounts, + samlAccounts, + lastSignInAt, + banned, + locked, + lockoutExpiresInSeconds, + verificationAttemptsRemaining, + updatedAt, + createdAt, + deleteSelfEnabled, + createOrganizationEnabled, + lastActiveAt); + } + + @Override + public String toString() { + return Utils.toString(User.class, + "id", id, + "object", object, + "externalId", externalId, + "primaryEmailAddressId", primaryEmailAddressId, + "primaryPhoneNumberId", primaryPhoneNumberId, + "primaryWeb3WalletId", primaryWeb3WalletId, + "username", username, + "firstName", firstName, + "lastName", lastName, + "profileImageUrl", profileImageUrl, + "imageUrl", imageUrl, + "hasImage", hasImage, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "unsafeMetadata", unsafeMetadata, + "emailAddresses", emailAddresses, + "phoneNumbers", phoneNumbers, + "web3Wallets", web3Wallets, + "passkeys", passkeys, + "passwordEnabled", passwordEnabled, + "twoFactorEnabled", twoFactorEnabled, + "totpEnabled", totpEnabled, + "backupCodeEnabled", backupCodeEnabled, + "mfaEnabledAt", mfaEnabledAt, + "mfaDisabledAt", mfaDisabledAt, + "externalAccounts", externalAccounts, + "samlAccounts", samlAccounts, + "lastSignInAt", lastSignInAt, + "banned", banned, + "locked", locked, + "lockoutExpiresInSeconds", lockoutExpiresInSeconds, + "verificationAttemptsRemaining", verificationAttemptsRemaining, + "updatedAt", updatedAt, + "createdAt", createdAt, + "deleteSelfEnabled", deleteSelfEnabled, + "createOrganizationEnabled", createOrganizationEnabled, + "lastActiveAt", lastActiveAt); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional object = Optional.empty(); + + private JsonNullable externalId = JsonNullable.undefined(); + + private JsonNullable primaryEmailAddressId = JsonNullable.undefined(); + + private JsonNullable primaryPhoneNumberId = JsonNullable.undefined(); + + private JsonNullable primaryWeb3WalletId = JsonNullable.undefined(); + + private JsonNullable username = JsonNullable.undefined(); + + private JsonNullable firstName = JsonNullable.undefined(); + + private JsonNullable lastName = JsonNullable.undefined(); + + @Deprecated + private Optional profileImageUrl = Optional.empty(); + + private Optional imageUrl = Optional.empty(); + + private Optional hasImage = Optional.empty(); + + private Optional publicMetadata = Optional.empty(); + + private JsonNullable privateMetadata = JsonNullable.undefined(); + + private Optional unsafeMetadata = Optional.empty(); + + private Optional> emailAddresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional> web3Wallets = Optional.empty(); + + private Optional> passkeys = Optional.empty(); + + private Optional passwordEnabled = Optional.empty(); + + private Optional twoFactorEnabled = Optional.empty(); + + private Optional totpEnabled = Optional.empty(); + + private Optional backupCodeEnabled = Optional.empty(); + + private JsonNullable mfaEnabledAt = JsonNullable.undefined(); + + private JsonNullable mfaDisabledAt = JsonNullable.undefined(); + + private Optional> externalAccounts = Optional.empty(); + + private Optional> samlAccounts = Optional.empty(); + + private JsonNullable lastSignInAt = JsonNullable.undefined(); + + private Optional banned = Optional.empty(); + + private Optional locked = Optional.empty(); + + private JsonNullable lockoutExpiresInSeconds = JsonNullable.undefined(); + + private JsonNullable verificationAttemptsRemaining = JsonNullable.undefined(); + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional deleteSelfEnabled = Optional.empty(); + + private Optional createOrganizationEnabled = Optional.empty(); + + private JsonNullable lastActiveAt = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(UserObject object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder externalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + public Builder externalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + public Builder primaryEmailAddressId(String primaryEmailAddressId) { + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + this.primaryEmailAddressId = JsonNullable.of(primaryEmailAddressId); + return this; + } + + public Builder primaryEmailAddressId(JsonNullable primaryEmailAddressId) { + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + this.primaryEmailAddressId = primaryEmailAddressId; + return this; + } + + public Builder primaryPhoneNumberId(String primaryPhoneNumberId) { + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + this.primaryPhoneNumberId = JsonNullable.of(primaryPhoneNumberId); + return this; + } + + public Builder primaryPhoneNumberId(JsonNullable primaryPhoneNumberId) { + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + this.primaryPhoneNumberId = primaryPhoneNumberId; + return this; + } + + public Builder primaryWeb3WalletId(String primaryWeb3WalletId) { + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + this.primaryWeb3WalletId = JsonNullable.of(primaryWeb3WalletId); + return this; + } + + public Builder primaryWeb3WalletId(JsonNullable primaryWeb3WalletId) { + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + this.primaryWeb3WalletId = primaryWeb3WalletId; + return this; + } + + public Builder username(String username) { + Utils.checkNotNull(username, "username"); + this.username = JsonNullable.of(username); + return this; + } + + public Builder username(JsonNullable username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + public Builder firstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + public Builder lastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder profileImageUrl(String profileImageUrl) { + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + this.profileImageUrl = Optional.ofNullable(profileImageUrl); + return this; + } + + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder profileImageUrl(Optional profileImageUrl) { + Utils.checkNotNull(profileImageUrl, "profileImageUrl"); + this.profileImageUrl = profileImageUrl; + return this; + } + + public Builder imageUrl(String imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = Optional.ofNullable(imageUrl); + return this; + } + + public Builder imageUrl(Optional imageUrl) { + Utils.checkNotNull(imageUrl, "imageUrl"); + this.imageUrl = imageUrl; + return this; + } + + public Builder hasImage(boolean hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = Optional.ofNullable(hasImage); + return this; + } + + public Builder hasImage(Optional hasImage) { + Utils.checkNotNull(hasImage, "hasImage"); + this.hasImage = hasImage; + return this; + } + + public Builder publicMetadata(PublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder privateMetadata(PrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = JsonNullable.of(privateMetadata); + return this; + } + + public Builder privateMetadata(JsonNullable privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public Builder unsafeMetadata(UnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + public Builder unsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + public Builder emailAddresses(java.util.List emailAddresses) { + Utils.checkNotNull(emailAddresses, "emailAddresses"); + this.emailAddresses = Optional.ofNullable(emailAddresses); + return this; + } + + public Builder emailAddresses(Optional> emailAddresses) { + Utils.checkNotNull(emailAddresses, "emailAddresses"); + this.emailAddresses = emailAddresses; + return this; + } + + public Builder phoneNumbers(java.util.List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + public Builder phoneNumbers(Optional> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + public Builder web3Wallets(java.util.List web3Wallets) { + Utils.checkNotNull(web3Wallets, "web3Wallets"); + this.web3Wallets = Optional.ofNullable(web3Wallets); + return this; + } + + public Builder web3Wallets(Optional> web3Wallets) { + Utils.checkNotNull(web3Wallets, "web3Wallets"); + this.web3Wallets = web3Wallets; + return this; + } + + public Builder passkeys(java.util.List passkeys) { + Utils.checkNotNull(passkeys, "passkeys"); + this.passkeys = Optional.ofNullable(passkeys); + return this; + } + + public Builder passkeys(Optional> passkeys) { + Utils.checkNotNull(passkeys, "passkeys"); + this.passkeys = passkeys; + return this; + } + + public Builder passwordEnabled(boolean passwordEnabled) { + Utils.checkNotNull(passwordEnabled, "passwordEnabled"); + this.passwordEnabled = Optional.ofNullable(passwordEnabled); + return this; + } + + public Builder passwordEnabled(Optional passwordEnabled) { + Utils.checkNotNull(passwordEnabled, "passwordEnabled"); + this.passwordEnabled = passwordEnabled; + return this; + } + + public Builder twoFactorEnabled(boolean twoFactorEnabled) { + Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled"); + this.twoFactorEnabled = Optional.ofNullable(twoFactorEnabled); + return this; + } + + public Builder twoFactorEnabled(Optional twoFactorEnabled) { + Utils.checkNotNull(twoFactorEnabled, "twoFactorEnabled"); + this.twoFactorEnabled = twoFactorEnabled; + return this; + } + + public Builder totpEnabled(boolean totpEnabled) { + Utils.checkNotNull(totpEnabled, "totpEnabled"); + this.totpEnabled = Optional.ofNullable(totpEnabled); + return this; + } + + public Builder totpEnabled(Optional totpEnabled) { + Utils.checkNotNull(totpEnabled, "totpEnabled"); + this.totpEnabled = totpEnabled; + return this; + } + + public Builder backupCodeEnabled(boolean backupCodeEnabled) { + Utils.checkNotNull(backupCodeEnabled, "backupCodeEnabled"); + this.backupCodeEnabled = Optional.ofNullable(backupCodeEnabled); + return this; + } + + public Builder backupCodeEnabled(Optional backupCodeEnabled) { + Utils.checkNotNull(backupCodeEnabled, "backupCodeEnabled"); + this.backupCodeEnabled = backupCodeEnabled; + return this; + } + + /** + * Unix timestamp of when MFA was last enabled for this user. It should be noted that this field is not nullified if MFA is disabled. + * + */ + public Builder mfaEnabledAt(long mfaEnabledAt) { + Utils.checkNotNull(mfaEnabledAt, "mfaEnabledAt"); + this.mfaEnabledAt = JsonNullable.of(mfaEnabledAt); + return this; + } + + /** + * Unix timestamp of when MFA was last enabled for this user. It should be noted that this field is not nullified if MFA is disabled. + * + */ + public Builder mfaEnabledAt(JsonNullable mfaEnabledAt) { + Utils.checkNotNull(mfaEnabledAt, "mfaEnabledAt"); + this.mfaEnabledAt = mfaEnabledAt; + return this; + } + + /** + * Unix timestamp of when MFA was last disabled for this user. It should be noted that this field is not nullified if MFA is enabled again. + * + */ + public Builder mfaDisabledAt(long mfaDisabledAt) { + Utils.checkNotNull(mfaDisabledAt, "mfaDisabledAt"); + this.mfaDisabledAt = JsonNullable.of(mfaDisabledAt); + return this; + } + + /** + * Unix timestamp of when MFA was last disabled for this user. It should be noted that this field is not nullified if MFA is enabled again. + * + */ + public Builder mfaDisabledAt(JsonNullable mfaDisabledAt) { + Utils.checkNotNull(mfaDisabledAt, "mfaDisabledAt"); + this.mfaDisabledAt = mfaDisabledAt; + return this; + } + + public Builder externalAccounts(java.util.List externalAccounts) { + Utils.checkNotNull(externalAccounts, "externalAccounts"); + this.externalAccounts = Optional.ofNullable(externalAccounts); + return this; + } + + public Builder externalAccounts(Optional> externalAccounts) { + Utils.checkNotNull(externalAccounts, "externalAccounts"); + this.externalAccounts = externalAccounts; + return this; + } + + public Builder samlAccounts(java.util.List samlAccounts) { + Utils.checkNotNull(samlAccounts, "samlAccounts"); + this.samlAccounts = Optional.ofNullable(samlAccounts); + return this; + } + + public Builder samlAccounts(Optional> samlAccounts) { + Utils.checkNotNull(samlAccounts, "samlAccounts"); + this.samlAccounts = samlAccounts; + return this; + } + + /** + * Unix timestamp of last sign-in. + * + */ + public Builder lastSignInAt(long lastSignInAt) { + Utils.checkNotNull(lastSignInAt, "lastSignInAt"); + this.lastSignInAt = JsonNullable.of(lastSignInAt); + return this; + } + + /** + * Unix timestamp of last sign-in. + * + */ + public Builder lastSignInAt(JsonNullable lastSignInAt) { + Utils.checkNotNull(lastSignInAt, "lastSignInAt"); + this.lastSignInAt = lastSignInAt; + return this; + } + + /** + * Flag to denote whether user is banned or not. + * + */ + public Builder banned(boolean banned) { + Utils.checkNotNull(banned, "banned"); + this.banned = Optional.ofNullable(banned); + return this; + } + + /** + * Flag to denote whether user is banned or not. + * + */ + public Builder banned(Optional banned) { + Utils.checkNotNull(banned, "banned"); + this.banned = banned; + return this; + } + + /** + * Flag to denote whether user is currently locked, i.e. restricted from signing in or not. + * + */ + public Builder locked(boolean locked) { + Utils.checkNotNull(locked, "locked"); + this.locked = Optional.ofNullable(locked); + return this; + } + + /** + * Flag to denote whether user is currently locked, i.e. restricted from signing in or not. + * + */ + public Builder locked(Optional locked) { + Utils.checkNotNull(locked, "locked"); + this.locked = locked; + return this; + } + + /** + * The number of seconds remaining until the lockout period expires for a locked user. A null value for a locked user indicates that lockout never expires. + * + */ + public Builder lockoutExpiresInSeconds(long lockoutExpiresInSeconds) { + Utils.checkNotNull(lockoutExpiresInSeconds, "lockoutExpiresInSeconds"); + this.lockoutExpiresInSeconds = JsonNullable.of(lockoutExpiresInSeconds); + return this; + } + + /** + * The number of seconds remaining until the lockout period expires for a locked user. A null value for a locked user indicates that lockout never expires. + * + */ + public Builder lockoutExpiresInSeconds(JsonNullable lockoutExpiresInSeconds) { + Utils.checkNotNull(lockoutExpiresInSeconds, "lockoutExpiresInSeconds"); + this.lockoutExpiresInSeconds = lockoutExpiresInSeconds; + return this; + } + + /** + * The number of verification attempts remaining until the user is locked. Null if account lockout is not enabled. Note: if a user is locked explicitly via the Backend API, they may still have verification attempts remaining. + * + */ + public Builder verificationAttemptsRemaining(long verificationAttemptsRemaining) { + Utils.checkNotNull(verificationAttemptsRemaining, "verificationAttemptsRemaining"); + this.verificationAttemptsRemaining = JsonNullable.of(verificationAttemptsRemaining); + return this; + } + + /** + * The number of verification attempts remaining until the user is locked. Null if account lockout is not enabled. Note: if a user is locked explicitly via the Backend API, they may still have verification attempts remaining. + * + */ + public Builder verificationAttemptsRemaining(JsonNullable verificationAttemptsRemaining) { + Utils.checkNotNull(verificationAttemptsRemaining, "verificationAttemptsRemaining"); + this.verificationAttemptsRemaining = verificationAttemptsRemaining; + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = Optional.ofNullable(updatedAt); + return this; + } + + /** + * Unix timestamp of last update. + * + */ + public Builder updatedAt(Optional updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * Unix timestamp of creation. + * + */ + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * If enabled, user can delete themselves via FAPI. + * + */ + public Builder deleteSelfEnabled(boolean deleteSelfEnabled) { + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + this.deleteSelfEnabled = Optional.ofNullable(deleteSelfEnabled); + return this; + } + + /** + * If enabled, user can delete themselves via FAPI. + * + */ + public Builder deleteSelfEnabled(Optional deleteSelfEnabled) { + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + this.deleteSelfEnabled = deleteSelfEnabled; + return this; + } + + /** + * If enabled, user can create organizations via FAPI. + * + */ + public Builder createOrganizationEnabled(boolean createOrganizationEnabled) { + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + this.createOrganizationEnabled = Optional.ofNullable(createOrganizationEnabled); + return this; + } + + /** + * If enabled, user can create organizations via FAPI. + * + */ + public Builder createOrganizationEnabled(Optional createOrganizationEnabled) { + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + this.createOrganizationEnabled = createOrganizationEnabled; + return this; + } + + /** + * Unix timestamp of the latest session activity, with day precision. + * + */ + public Builder lastActiveAt(long lastActiveAt) { + Utils.checkNotNull(lastActiveAt, "lastActiveAt"); + this.lastActiveAt = JsonNullable.of(lastActiveAt); + return this; + } + + /** + * Unix timestamp of the latest session activity, with day precision. + * + */ + public Builder lastActiveAt(JsonNullable lastActiveAt) { + Utils.checkNotNull(lastActiveAt, "lastActiveAt"); + this.lastActiveAt = lastActiveAt; + return this; + } + + public User build() { + return new User( + id, + object, + externalId, + primaryEmailAddressId, + primaryPhoneNumberId, + primaryWeb3WalletId, + username, + firstName, + lastName, + profileImageUrl, + imageUrl, + hasImage, + publicMetadata, + privateMetadata, + unsafeMetadata, + emailAddresses, + phoneNumbers, + web3Wallets, + passkeys, + passwordEnabled, + twoFactorEnabled, + totpEnabled, + backupCodeEnabled, + mfaEnabledAt, + mfaDisabledAt, + externalAccounts, + samlAccounts, + lastSignInAt, + banned, + locked, + lockoutExpiresInSeconds, + verificationAttemptsRemaining, + updatedAt, + createdAt, + deleteSelfEnabled, + createOrganizationEnabled, + lastActiveAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/UserObject.java b/src/main/java/com/clerk/backend_api/models/components/UserObject.java new file mode 100644 index 0000000..bd5f748 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/UserObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * UserObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum UserObject { + USER("user"); + + @JsonValue + private final String value; + + private UserObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Verification.java b/src/main/java/com/clerk/backend_api/models/components/Verification.java new file mode 100644 index 0000000..4cbf076 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Verification.java @@ -0,0 +1,107 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.time.OffsetDateTime; +import java.time.LocalDate; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.clerk.backend_api.utils.TypedObject; +import com.clerk.backend_api.utils.Utils.JsonShape; + + +@JsonDeserialize(using = Verification._Deserializer.class) +public class Verification { + + @com.fasterxml.jackson.annotation.JsonValue + private TypedObject value; + + private Verification(TypedObject value) { + this.value = value; + } + + public static Verification of(Otp value) { + Utils.checkNotNull(value, "value"); + return new Verification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static Verification of(Admin value) { + Utils.checkNotNull(value, "value"); + return new Verification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static Verification of(Oauth value) { + Utils.checkNotNull(value, "value"); + return new Verification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code Otp}
  • + *
  • {@code Admin}
  • + *
  • {@code Oauth}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Verification other = (Verification) o; + return java.util.Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends com.clerk.backend_api.utils.OneOfDeserializer { + + public _Deserializer() { + super(Verification.class, + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT), + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT), + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(Verification.class, + "value", value); + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/components/VerificationAdmin.java b/src/main/java/com/clerk/backend_api/models/components/VerificationAdmin.java new file mode 100644 index 0000000..00dc230 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/VerificationAdmin.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class VerificationAdmin { + + @JsonProperty("status") + private AdminVerificationPhoneNumberStatus status; + + @JsonProperty("strategy") + private AdminVerificationStrategy strategy; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attempts") + private JsonNullable attempts; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expire_at") + private JsonNullable expireAt; + + @JsonCreator + public VerificationAdmin( + @JsonProperty("status") AdminVerificationPhoneNumberStatus status, + @JsonProperty("strategy") AdminVerificationStrategy strategy, + @JsonProperty("attempts") JsonNullable attempts, + @JsonProperty("expire_at") JsonNullable expireAt) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(attempts, "attempts"); + Utils.checkNotNull(expireAt, "expireAt"); + this.status = status; + this.strategy = strategy; + this.attempts = attempts; + this.expireAt = expireAt; + } + + public VerificationAdmin( + AdminVerificationPhoneNumberStatus status, + AdminVerificationStrategy strategy) { + this(status, strategy, JsonNullable.undefined(), JsonNullable.undefined()); + } + + @JsonIgnore + public AdminVerificationPhoneNumberStatus status() { + return status; + } + + @JsonIgnore + public AdminVerificationStrategy strategy() { + return strategy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attempts() { + return (JsonNullable) attempts; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable expireAt() { + return (JsonNullable) expireAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public VerificationAdmin withStatus(AdminVerificationPhoneNumberStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public VerificationAdmin withStrategy(AdminVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public VerificationAdmin withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public VerificationAdmin withAttempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public VerificationAdmin withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public VerificationAdmin withExpireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerificationAdmin other = (VerificationAdmin) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.attempts, other.attempts) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + attempts, + expireAt); + } + + @Override + public String toString() { + return Utils.toString(VerificationAdmin.class, + "status", status, + "strategy", strategy, + "attempts", attempts, + "expireAt", expireAt); + } + + public final static class Builder { + + private AdminVerificationPhoneNumberStatus status; + + private AdminVerificationStrategy strategy; + + private JsonNullable attempts = JsonNullable.undefined(); + + private JsonNullable expireAt = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder status(AdminVerificationPhoneNumberStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(AdminVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Builder attempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Builder expireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public VerificationAdmin build() { + return new VerificationAdmin( + status, + strategy, + attempts, + expireAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/VerificationError.java b/src/main/java/com/clerk/backend_api/models/components/VerificationError.java new file mode 100644 index 0000000..afb66ff --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/VerificationError.java @@ -0,0 +1,93 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.time.OffsetDateTime; +import java.time.LocalDate; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.clerk.backend_api.utils.TypedObject; +import com.clerk.backend_api.utils.Utils.JsonShape; + + +@JsonDeserialize(using = VerificationError._Deserializer.class) +public class VerificationError { + + @com.fasterxml.jackson.annotation.JsonValue + private TypedObject value; + + private VerificationError(TypedObject value) { + this.value = value; + } + + public static VerificationError of(SAMLErrorClerkError value) { + Utils.checkNotNull(value, "value"); + return new VerificationError(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code SAMLErrorClerkError}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerificationError other = (VerificationError) o; + return java.util.Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends com.clerk.backend_api.utils.OneOfDeserializer { + + public _Deserializer() { + super(VerificationError.class, + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(VerificationError.class, + "value", value); + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/components/VerificationNonce.java b/src/main/java/com/clerk/backend_api/models/components/VerificationNonce.java new file mode 100644 index 0000000..93ba259 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/VerificationNonce.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum VerificationNonce { + NONCE("nonce"); + + @JsonValue + private final String value; + + private VerificationNonce(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/VerificationOTP.java b/src/main/java/com/clerk/backend_api/models/components/VerificationOTP.java new file mode 100644 index 0000000..f7fe1eb --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/VerificationOTP.java @@ -0,0 +1,177 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class VerificationOTP { + + @JsonProperty("status") + private OTPVerificationStatus status; + + @JsonProperty("strategy") + private OTPVerificationStrategy strategy; + + @JsonProperty("attempts") + private long attempts; + + @JsonProperty("expire_at") + private long expireAt; + + @JsonCreator + public VerificationOTP( + @JsonProperty("status") OTPVerificationStatus status, + @JsonProperty("strategy") OTPVerificationStrategy strategy, + @JsonProperty("attempts") long attempts, + @JsonProperty("expire_at") long expireAt) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(attempts, "attempts"); + Utils.checkNotNull(expireAt, "expireAt"); + this.status = status; + this.strategy = strategy; + this.attempts = attempts; + this.expireAt = expireAt; + } + + @JsonIgnore + public OTPVerificationStatus status() { + return status; + } + + @JsonIgnore + public OTPVerificationStrategy strategy() { + return strategy; + } + + @JsonIgnore + public long attempts() { + return attempts; + } + + @JsonIgnore + public long expireAt() { + return expireAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public VerificationOTP withStatus(OTPVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public VerificationOTP withStrategy(OTPVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public VerificationOTP withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public VerificationOTP withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerificationOTP other = (VerificationOTP) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.attempts, other.attempts) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + attempts, + expireAt); + } + + @Override + public String toString() { + return Utils.toString(VerificationOTP.class, + "status", status, + "strategy", strategy, + "attempts", attempts, + "expireAt", expireAt); + } + + public final static class Builder { + + private OTPVerificationStatus status; + + private OTPVerificationStrategy strategy; + + private Long attempts; + + private Long expireAt; + + private Builder() { + // force use of static builder() method + } + + public Builder status(OTPVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(OTPVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public VerificationOTP build() { + return new VerificationOTP( + status, + strategy, + attempts, + expireAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/VerificationStatus.java b/src/main/java/com/clerk/backend_api/models/components/VerificationStatus.java new file mode 100644 index 0000000..3115c61 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/VerificationStatus.java @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum VerificationStatus { + UNVERIFIED("unverified"), + VERIFIED("verified"), + FAILED("failed"), + EXPIRED("expired"); + + @JsonValue + private final String value; + + private VerificationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/VerificationStrategy.java b/src/main/java/com/clerk/backend_api/models/components/VerificationStrategy.java new file mode 100644 index 0000000..71742c2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/VerificationStrategy.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum VerificationStrategy { + ADMIN("admin"); + + @JsonValue + private final String value; + + private VerificationStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Verifications.java b/src/main/java/com/clerk/backend_api/models/components/Verifications.java new file mode 100644 index 0000000..317e5f2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Verifications.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Verifications { + + @JsonCreator + public Verifications() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(Verifications.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public Verifications build() { + return new Verifications( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Web3Signature.java b/src/main/java/com/clerk/backend_api/models/components/Web3Signature.java new file mode 100644 index 0000000..8d11abf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Web3Signature.java @@ -0,0 +1,244 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Web3Signature { + + @JsonProperty("status") + private Web3SignatureVerificationStatus status; + + @JsonProperty("strategy") + private Web3SignatureVerificationStrategy strategy; + + @JsonProperty("nonce") + private Nonce nonce; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attempts") + private JsonNullable attempts; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expire_at") + private JsonNullable expireAt; + + @JsonCreator + public Web3Signature( + @JsonProperty("status") Web3SignatureVerificationStatus status, + @JsonProperty("strategy") Web3SignatureVerificationStrategy strategy, + @JsonProperty("nonce") Nonce nonce, + @JsonProperty("attempts") JsonNullable attempts, + @JsonProperty("expire_at") JsonNullable expireAt) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(nonce, "nonce"); + Utils.checkNotNull(attempts, "attempts"); + Utils.checkNotNull(expireAt, "expireAt"); + this.status = status; + this.strategy = strategy; + this.nonce = nonce; + this.attempts = attempts; + this.expireAt = expireAt; + } + + public Web3Signature( + Web3SignatureVerificationStatus status, + Web3SignatureVerificationStrategy strategy, + Nonce nonce) { + this(status, strategy, nonce, JsonNullable.undefined(), JsonNullable.undefined()); + } + + @JsonIgnore + public Web3SignatureVerificationStatus status() { + return status; + } + + @JsonIgnore + public Web3SignatureVerificationStrategy strategy() { + return strategy; + } + + @JsonIgnore + public Nonce nonce() { + return nonce; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attempts() { + return (JsonNullable) attempts; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable expireAt() { + return (JsonNullable) expireAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Web3Signature withStatus(Web3SignatureVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Web3Signature withStrategy(Web3SignatureVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Web3Signature withNonce(Nonce nonce) { + Utils.checkNotNull(nonce, "nonce"); + this.nonce = nonce; + return this; + } + + public Web3Signature withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Web3Signature withAttempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Web3Signature withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Web3Signature withExpireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3Signature other = (Web3Signature) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.nonce, other.nonce) && + java.util.Objects.deepEquals(this.attempts, other.attempts) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + nonce, + attempts, + expireAt); + } + + @Override + public String toString() { + return Utils.toString(Web3Signature.class, + "status", status, + "strategy", strategy, + "nonce", nonce, + "attempts", attempts, + "expireAt", expireAt); + } + + public final static class Builder { + + private Web3SignatureVerificationStatus status; + + private Web3SignatureVerificationStrategy strategy; + + private Nonce nonce; + + private JsonNullable attempts = JsonNullable.undefined(); + + private JsonNullable expireAt = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder status(Web3SignatureVerificationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(Web3SignatureVerificationStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder nonce(Nonce nonce) { + Utils.checkNotNull(nonce, "nonce"); + this.nonce = nonce; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Builder attempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Builder expireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Web3Signature build() { + return new Web3Signature( + status, + strategy, + nonce, + attempts, + expireAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Web3SignatureVerificationStatus.java b/src/main/java/com/clerk/backend_api/models/components/Web3SignatureVerificationStatus.java new file mode 100644 index 0000000..2e9b90e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Web3SignatureVerificationStatus.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum Web3SignatureVerificationStatus { + VERIFIED("verified"); + + @JsonValue + private final String value; + + private Web3SignatureVerificationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Web3SignatureVerificationStrategy.java b/src/main/java/com/clerk/backend_api/models/components/Web3SignatureVerificationStrategy.java new file mode 100644 index 0000000..0b778cd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Web3SignatureVerificationStrategy.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum Web3SignatureVerificationStrategy { + WEB3_METAMASK_SIGNATURE("web3_metamask_signature"); + + @JsonValue + private final String value; + + private Web3SignatureVerificationStrategy(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Web3Wallet.java b/src/main/java/com/clerk/backend_api/models/components/Web3Wallet.java new file mode 100644 index 0000000..40e33f8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Web3Wallet.java @@ -0,0 +1,322 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class Web3Wallet { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonProperty("object") + private Web3WalletObject object; + + @JsonProperty("web3_wallet") + private String web3Wallet; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("verification") + private Optional verification; + + /** + * Unix timestamp of creation + * + */ + @JsonProperty("created_at") + private long createdAt; + + /** + * Unix timestamp of creation + * + */ + @JsonProperty("updated_at") + private long updatedAt; + + @JsonCreator + public Web3Wallet( + @JsonProperty("id") Optional id, + @JsonProperty("object") Web3WalletObject object, + @JsonProperty("web3_wallet") String web3Wallet, + @JsonProperty("verification") Optional verification, + @JsonProperty("created_at") long createdAt, + @JsonProperty("updated_at") long updatedAt) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(web3Wallet, "web3Wallet"); + Utils.checkNotNull(verification, "verification"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + this.id = id; + this.object = object; + this.web3Wallet = web3Wallet; + this.verification = verification; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public Web3Wallet( + Web3WalletObject object, + String web3Wallet, + long createdAt, + long updatedAt) { + this(Optional.empty(), object, web3Wallet, Optional.empty(), createdAt, updatedAt); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional id() { + return (Optional) id; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + @JsonIgnore + public Web3WalletObject object() { + return object; + } + + @JsonIgnore + public String web3Wallet() { + return web3Wallet; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional verification() { + return (Optional) verification; + } + + /** + * Unix timestamp of creation + * + */ + @JsonIgnore + public long createdAt() { + return createdAt; + } + + /** + * Unix timestamp of creation + * + */ + @JsonIgnore + public long updatedAt() { + return updatedAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Web3Wallet withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Web3Wallet withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Web3Wallet withObject(Web3WalletObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Web3Wallet withWeb3Wallet(String web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + public Web3Wallet withVerification(Web3WalletVerification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public Web3Wallet withVerification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Web3Wallet withCreatedAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Web3Wallet withUpdatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3Wallet other = (Web3Wallet) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.web3Wallet, other.web3Wallet) && + java.util.Objects.deepEquals(this.verification, other.verification) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt) && + java.util.Objects.deepEquals(this.updatedAt, other.updatedAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + object, + web3Wallet, + verification, + createdAt, + updatedAt); + } + + @Override + public String toString() { + return Utils.toString(Web3Wallet.class, + "id", id, + "object", object, + "web3Wallet", web3Wallet, + "verification", verification, + "createdAt", createdAt, + "updatedAt", updatedAt); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Web3WalletObject object; + + private String web3Wallet; + + private Optional verification = Optional.empty(); + + private Long createdAt; + + private Long updatedAt; + + private Builder() { + // force use of static builder() method + } + + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * String representing the object's type. Objects of the same type share the same value. + * + */ + public Builder object(Web3WalletObject object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder web3Wallet(String web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + public Builder verification(Web3WalletVerification verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = Optional.ofNullable(verification); + return this; + } + + public Builder verification(Optional verification) { + Utils.checkNotNull(verification, "verification"); + this.verification = verification; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder createdAt(long createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp of creation + * + */ + public Builder updatedAt(long updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + public Web3Wallet build() { + return new Web3Wallet( + id, + object, + web3Wallet, + verification, + createdAt, + updatedAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/components/Web3WalletObject.java b/src/main/java/com/clerk/backend_api/models/components/Web3WalletObject.java new file mode 100644 index 0000000..726315c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Web3WalletObject.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * Web3WalletObject - String representing the object's type. Objects of the same type share the same value. + * + */ +public enum Web3WalletObject { + WEB3_WALLET("web3_wallet"); + + @JsonValue + private final String value; + + private Web3WalletObject(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Web3WalletVerification.java b/src/main/java/com/clerk/backend_api/models/components/Web3WalletVerification.java new file mode 100644 index 0000000..c999829 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Web3WalletVerification.java @@ -0,0 +1,100 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.time.OffsetDateTime; +import java.time.LocalDate; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.clerk.backend_api.utils.TypedObject; +import com.clerk.backend_api.utils.Utils.JsonShape; + + +@JsonDeserialize(using = Web3WalletVerification._Deserializer.class) +public class Web3WalletVerification { + + @com.fasterxml.jackson.annotation.JsonValue + private TypedObject value; + + private Web3WalletVerification(TypedObject value) { + this.value = value; + } + + public static Web3WalletVerification of(Web3Signature value) { + Utils.checkNotNull(value, "value"); + return new Web3WalletVerification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static Web3WalletVerification of(Web3WalletVerificationAdmin value) { + Utils.checkNotNull(value, "value"); + return new Web3WalletVerification(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code Web3Signature}
  • + *
  • {@code Web3WalletVerificationAdmin}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3WalletVerification other = (Web3WalletVerification) o; + return java.util.Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends com.clerk.backend_api.utils.OneOfDeserializer { + + public _Deserializer() { + super(Web3WalletVerification.class, + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT), + Utils.TypeReferenceWithShape.of(new TypeReference() {}, Utils.JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(Web3WalletVerification.class, + "value", value); + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/components/Web3WalletVerificationAdmin.java b/src/main/java/com/clerk/backend_api/models/components/Web3WalletVerificationAdmin.java new file mode 100644 index 0000000..4af8803 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Web3WalletVerificationAdmin.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Web3WalletVerificationAdmin { + + @JsonProperty("status") + private AdminVerificationWeb3WalletStatus status; + + @JsonProperty("strategy") + private AdminVerificationWeb3WalletStrategy strategy; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attempts") + private JsonNullable attempts; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expire_at") + private JsonNullable expireAt; + + @JsonCreator + public Web3WalletVerificationAdmin( + @JsonProperty("status") AdminVerificationWeb3WalletStatus status, + @JsonProperty("strategy") AdminVerificationWeb3WalletStrategy strategy, + @JsonProperty("attempts") JsonNullable attempts, + @JsonProperty("expire_at") JsonNullable expireAt) { + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(strategy, "strategy"); + Utils.checkNotNull(attempts, "attempts"); + Utils.checkNotNull(expireAt, "expireAt"); + this.status = status; + this.strategy = strategy; + this.attempts = attempts; + this.expireAt = expireAt; + } + + public Web3WalletVerificationAdmin( + AdminVerificationWeb3WalletStatus status, + AdminVerificationWeb3WalletStrategy strategy) { + this(status, strategy, JsonNullable.undefined(), JsonNullable.undefined()); + } + + @JsonIgnore + public AdminVerificationWeb3WalletStatus status() { + return status; + } + + @JsonIgnore + public AdminVerificationWeb3WalletStrategy strategy() { + return strategy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attempts() { + return (JsonNullable) attempts; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable expireAt() { + return (JsonNullable) expireAt; + } + + public final static Builder builder() { + return new Builder(); + } + + public Web3WalletVerificationAdmin withStatus(AdminVerificationWeb3WalletStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Web3WalletVerificationAdmin withStrategy(AdminVerificationWeb3WalletStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Web3WalletVerificationAdmin withAttempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Web3WalletVerificationAdmin withAttempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Web3WalletVerificationAdmin withExpireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Web3WalletVerificationAdmin withExpireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3WalletVerificationAdmin other = (Web3WalletVerificationAdmin) o; + return + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.strategy, other.strategy) && + java.util.Objects.deepEquals(this.attempts, other.attempts) && + java.util.Objects.deepEquals(this.expireAt, other.expireAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status, + strategy, + attempts, + expireAt); + } + + @Override + public String toString() { + return Utils.toString(Web3WalletVerificationAdmin.class, + "status", status, + "strategy", strategy, + "attempts", attempts, + "expireAt", expireAt); + } + + public final static class Builder { + + private AdminVerificationWeb3WalletStatus status; + + private AdminVerificationWeb3WalletStrategy strategy; + + private JsonNullable attempts = JsonNullable.undefined(); + + private JsonNullable expireAt = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder status(AdminVerificationWeb3WalletStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Builder strategy(AdminVerificationWeb3WalletStrategy strategy) { + Utils.checkNotNull(strategy, "strategy"); + this.strategy = strategy; + return this; + } + + public Builder attempts(long attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = JsonNullable.of(attempts); + return this; + } + + public Builder attempts(JsonNullable attempts) { + Utils.checkNotNull(attempts, "attempts"); + this.attempts = attempts; + return this; + } + + public Builder expireAt(long expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = JsonNullable.of(expireAt); + return this; + } + + public Builder expireAt(JsonNullable expireAt) { + Utils.checkNotNull(expireAt, "expireAt"); + this.expireAt = expireAt; + return this; + } + + public Web3WalletVerificationAdmin build() { + return new Web3WalletVerificationAdmin( + status, + strategy, + attempts, + expireAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/errors/AuthException.java b/src/main/java/com/clerk/backend_api/models/errors/AuthException.java new file mode 100644 index 0000000..412da8b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/errors/AuthException.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.errors; + +import java.util.Optional; + +/** + * An exception associated with Authentication or Authorization. + */ +@SuppressWarnings("serial") +public class AuthException extends RuntimeException { + + private final Optional statusCode; + + private AuthException(Optional statusCode, String message) { + super(message); + this.statusCode = statusCode; + } + + public AuthException(int statusCode, String message) { + this(Optional.of(statusCode), message); + } + + public AuthException(String message) { + this(Optional.empty(), message); + } + + public Optional statusCode() { + return statusCode; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/errors/ClerkErrors.java b/src/main/java/com/clerk/backend_api/models/errors/ClerkErrors.java new file mode 100644 index 0000000..00ffca6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/errors/ClerkErrors.java @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.errors; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +/** + * ClerkErrors - Request was not successful + */ +public class ClerkErrors extends RuntimeException { + + @JsonProperty("errors") + private java.util.List errors; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("meta") + private Optional meta; + + @JsonCreator + public ClerkErrors( + @JsonProperty("errors") java.util.List errors, + @JsonProperty("meta") Optional meta) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(meta, "meta"); + this.errors = errors; + this.meta = meta; + } + + public ClerkErrors( + java.util.List errors) { + this(errors, Optional.empty()); + } + + public java.util.List errors(){ + return errors; + } + + public Optional meta(){ + return meta; + } + + public final static Builder builder() { + return new Builder(); + } + + public ClerkErrors withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + public ClerkErrors withMeta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + public ClerkErrors withMeta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClerkErrors other = (ClerkErrors) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.meta, other.meta); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + meta); + } + + @Override + public String toString() { + return Utils.toString(ClerkErrors.class, + "errors", errors, + "meta", meta); + } + + public final static class Builder { + + private java.util.List errors; + + private Optional meta = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + public Builder meta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + public Builder meta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + public ClerkErrors build() { + return new ClerkErrors( + errors, + meta); + } + } +} diff --git a/src/main/java/com/clerk/backend_api/models/errors/Meta.java b/src/main/java/com/clerk/backend_api/models/errors/Meta.java new file mode 100644 index 0000000..b09e48b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/errors/Meta.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.errors; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class Meta { + + @JsonCreator + public Meta() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(Meta.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public Meta build() { + return new Meta( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/errors/SDKError.java b/src/main/java/com/clerk/backend_api/models/errors/SDKError.java new file mode 100644 index 0000000..350e9b4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/errors/SDKError.java @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.errors; + +import java.net.http.HttpResponse; +import java.io.InputStream; +import com.clerk.backend_api.utils.Utils; + +/** + * Thrown by a service call when an error response occurs. Contains details about the response. + */ +@SuppressWarnings("serial") +public class SDKError extends Exception { + + private final HttpResponse rawResponse; + private final int code; + private final String message; + private final byte[] body; + + public SDKError( + HttpResponse rawResponse, + int code, + String message, + byte[] body) { + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(body, "body"); + this.rawResponse = rawResponse; + this.code = code; + this.message = message; + this.body = body; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SDKError other = (SDKError) o; + return + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.body, other.body); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + rawResponse, + code, + message, + body); + } + + @Override + public String toString() { + return Utils.toString(SDKError.class, + "rawResponse", rawResponse, + "code", code, + "message", message, + "body", body); + } + + public HttpResponse rawResponse() { + return this.rawResponse; + } + + public int code() { + return this.code; + } + + public String message() { + return this.message; + } + + public byte[] body() { + return this.body; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/AddDomainRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/AddDomainRequestBody.java new file mode 100644 index 0000000..bc017e1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/AddDomainRequestBody.java @@ -0,0 +1,213 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class AddDomainRequestBody { + + /** + * The new domain name. Can contain the port for development instances. + */ + @JsonProperty("name") + private String name; + + /** + * Marks the new domain as satellite. Only `true` is accepted at the moment. + */ + @JsonProperty("is_satellite") + private boolean isSatellite; + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("proxy_url") + private Optional proxyUrl; + + @JsonCreator + public AddDomainRequestBody( + @JsonProperty("name") String name, + @JsonProperty("is_satellite") boolean isSatellite, + @JsonProperty("proxy_url") Optional proxyUrl) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(isSatellite, "isSatellite"); + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.name = name; + this.isSatellite = isSatellite; + this.proxyUrl = proxyUrl; + } + + public AddDomainRequestBody( + String name, + boolean isSatellite) { + this(name, isSatellite, Optional.empty()); + } + + /** + * The new domain name. Can contain the port for development instances. + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * Marks the new domain as satellite. Only `true` is accepted at the moment. + */ + @JsonIgnore + public boolean isSatellite() { + return isSatellite; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional proxyUrl() { + return (Optional) proxyUrl; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The new domain name. Can contain the port for development instances. + */ + public AddDomainRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Marks the new domain as satellite. Only `true` is accepted at the moment. + */ + public AddDomainRequestBody withIsSatellite(boolean isSatellite) { + Utils.checkNotNull(isSatellite, "isSatellite"); + this.isSatellite = isSatellite; + return this; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. + */ + public AddDomainRequestBody withProxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = Optional.ofNullable(proxyUrl); + return this; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. + */ + public AddDomainRequestBody withProxyUrl(Optional proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddDomainRequestBody other = (AddDomainRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.isSatellite, other.isSatellite) && + java.util.Objects.deepEquals(this.proxyUrl, other.proxyUrl); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + isSatellite, + proxyUrl); + } + + @Override + public String toString() { + return Utils.toString(AddDomainRequestBody.class, + "name", name, + "isSatellite", isSatellite, + "proxyUrl", proxyUrl); + } + + public final static class Builder { + + private String name; + + private Boolean isSatellite; + + private Optional proxyUrl = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The new domain name. Can contain the port for development instances. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Marks the new domain as satellite. Only `true` is accepted at the moment. + */ + public Builder isSatellite(boolean isSatellite) { + Utils.checkNotNull(isSatellite, "isSatellite"); + this.isSatellite = isSatellite; + return this; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. + */ + public Builder proxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = Optional.ofNullable(proxyUrl); + return this; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. Applicable only to production instances. + */ + public Builder proxyUrl(Optional proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + public AddDomainRequestBody build() { + return new AddDomainRequestBody( + name, + isSatellite, + proxyUrl); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/AddDomainRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/AddDomainRequestBuilder.java new file mode 100644 index 0000000..8504c89 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/AddDomainRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AddDomainRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallAddDomain sdk; + + public AddDomainRequestBuilder(SDKMethodInterfaces.MethodCallAddDomain sdk) { + this.sdk = sdk; + } + + public AddDomainRequestBuilder request(AddDomainRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public AddDomainRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AddDomainResponse call() throws Exception { + + return sdk.add( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/AddDomainResponse.java b/src/main/java/com/clerk/backend_api/models/operations/AddDomainResponse.java new file mode 100644 index 0000000..68833a0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/AddDomainResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class AddDomainResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A domain + */ + private Optional domain; + + @JsonCreator + public AddDomainResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional domain) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(domain, "domain"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.domain = domain; + } + + public AddDomainResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A domain + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional domain() { + return (Optional) domain; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public AddDomainResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AddDomainResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AddDomainResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A domain + */ + public AddDomainResponse withDomain(com.clerk.backend_api.models.components.Domain domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = Optional.ofNullable(domain); + return this; + } + + /** + * A domain + */ + public AddDomainResponse withDomain(Optional domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddDomainResponse other = (AddDomainResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.domain, other.domain); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + domain); + } + + @Override + public String toString() { + return Utils.toString(AddDomainResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "domain", domain); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional domain = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A domain + */ + public Builder domain(com.clerk.backend_api.models.components.Domain domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = Optional.ofNullable(domain); + return this; + } + + /** + * A domain + */ + public Builder domain(Optional domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + public AddDomainResponse build() { + return new AddDomainResponse( + contentType, + statusCode, + rawResponse, + domain); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/AttributeMapping.java b/src/main/java/com/clerk/backend_api/models/operations/AttributeMapping.java new file mode 100644 index 0000000..35b13ad --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/AttributeMapping.java @@ -0,0 +1,243 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * AttributeMapping - Define the attribute name mapping between Identity Provider and Clerk's user properties + */ + +public class AttributeMapping { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("user_id") + private Optional userId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_address") + private Optional emailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private Optional firstName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private Optional lastName; + + @JsonCreator + public AttributeMapping( + @JsonProperty("user_id") Optional userId, + @JsonProperty("email_address") Optional emailAddress, + @JsonProperty("first_name") Optional firstName, + @JsonProperty("last_name") Optional lastName) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + this.userId = userId; + this.emailAddress = emailAddress; + this.firstName = firstName; + this.lastName = lastName; + } + + public AttributeMapping() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional emailAddress() { + return (Optional) emailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional firstName() { + return (Optional) firstName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastName() { + return (Optional) lastName; + } + + public final static Builder builder() { + return new Builder(); + } + + public AttributeMapping withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public AttributeMapping withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public AttributeMapping withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + public AttributeMapping withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public AttributeMapping withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = Optional.ofNullable(firstName); + return this; + } + + public AttributeMapping withFirstName(Optional firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public AttributeMapping withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = Optional.ofNullable(lastName); + return this; + } + + public AttributeMapping withLastName(Optional lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttributeMapping other = (AttributeMapping) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + emailAddress, + firstName, + lastName); + } + + @Override + public String toString() { + return Utils.toString(AttributeMapping.class, + "userId", userId, + "emailAddress", emailAddress, + "firstName", firstName, + "lastName", lastName); + } + + public final static class Builder { + + private Optional userId = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = Optional.ofNullable(firstName); + return this; + } + + public Builder firstName(Optional firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = Optional.ofNullable(lastName); + return this; + } + + public Builder lastName(Optional lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + public AttributeMapping build() { + return new AttributeMapping( + userId, + emailAddress, + firstName, + lastName); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/BanUserRequest.java b/src/main/java/com/clerk/backend_api/models/operations/BanUserRequest.java new file mode 100644 index 0000000..71c2193 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/BanUserRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class BanUserRequest { + + /** + * The ID of the user to ban + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public BanUserRequest( + String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + /** + * The ID of the user to ban + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to ban + */ + public BanUserRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BanUserRequest other = (BanUserRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(BanUserRequest.class, + "userId", userId); + } + + public final static class Builder { + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to ban + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public BanUserRequest build() { + return new BanUserRequest( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/BanUserRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/BanUserRequestBuilder.java new file mode 100644 index 0000000..85871be --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/BanUserRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class BanUserRequestBuilder { + + private String userId; + private final SDKMethodInterfaces.MethodCallBanUser sdk; + + public BanUserRequestBuilder(SDKMethodInterfaces.MethodCallBanUser sdk) { + this.sdk = sdk; + } + + public BanUserRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public BanUserResponse call() throws Exception { + + return sdk.ban( + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/BanUserResponse.java b/src/main/java/com/clerk/backend_api/models/operations/BanUserResponse.java new file mode 100644 index 0000000..4fe1bb7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/BanUserResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class BanUserResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public BanUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public BanUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public BanUserResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public BanUserResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public BanUserResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public BanUserResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public BanUserResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BanUserResponse other = (BanUserResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(BanUserResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public BanUserResponse build() { + return new BanUserResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainRequestBody.java new file mode 100644 index 0000000..eaabf1d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainRequestBody.java @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ChangeProductionInstanceDomainRequestBody { + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("home_url") + private Optional homeUrl; + + @JsonCreator + public ChangeProductionInstanceDomainRequestBody( + @JsonProperty("home_url") Optional homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = homeUrl; + } + + public ChangeProductionInstanceDomainRequestBody() { + this(Optional.empty()); + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional homeUrl() { + return (Optional) homeUrl; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + public ChangeProductionInstanceDomainRequestBody withHomeUrl(String homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = Optional.ofNullable(homeUrl); + return this; + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + public ChangeProductionInstanceDomainRequestBody withHomeUrl(Optional homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = homeUrl; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeProductionInstanceDomainRequestBody other = (ChangeProductionInstanceDomainRequestBody) o; + return + java.util.Objects.deepEquals(this.homeUrl, other.homeUrl); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + homeUrl); + } + + @Override + public String toString() { + return Utils.toString(ChangeProductionInstanceDomainRequestBody.class, + "homeUrl", homeUrl); + } + + public final static class Builder { + + private Optional homeUrl = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + public Builder homeUrl(String homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = Optional.ofNullable(homeUrl); + return this; + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + public Builder homeUrl(Optional homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = homeUrl; + return this; + } + + public ChangeProductionInstanceDomainRequestBody build() { + return new ChangeProductionInstanceDomainRequestBody( + homeUrl); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainRequestBuilder.java new file mode 100644 index 0000000..8dbcaa0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ChangeProductionInstanceDomainRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallChangeProductionInstanceDomain sdk; + + public ChangeProductionInstanceDomainRequestBuilder(SDKMethodInterfaces.MethodCallChangeProductionInstanceDomain sdk) { + this.sdk = sdk; + } + + public ChangeProductionInstanceDomainRequestBuilder request(ChangeProductionInstanceDomainRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public ChangeProductionInstanceDomainRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ChangeProductionInstanceDomainResponse call() throws Exception { + + return sdk.changeProductionDomain( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainResponse.java new file mode 100644 index 0000000..a0c48ef --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ChangeProductionInstanceDomainResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; + +public class ChangeProductionInstanceDomainResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public ChangeProductionInstanceDomainResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ChangeProductionInstanceDomainResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ChangeProductionInstanceDomainResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ChangeProductionInstanceDomainResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeProductionInstanceDomainResponse other = (ChangeProductionInstanceDomainResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ChangeProductionInstanceDomainResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public ChangeProductionInstanceDomainResponse build() { + return new ChangeProductionInstanceDomainResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/Claims.java b/src/main/java/com/clerk/backend_api/models/operations/Claims.java new file mode 100644 index 0000000..bc56b73 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/Claims.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * Claims - JWT template claims in JSON format + */ + +public class Claims { + + @JsonCreator + public Claims() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(Claims.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public Claims build() { + return new Claims( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CodeType.java b/src/main/java/com/clerk/backend_api/models/operations/CodeType.java new file mode 100644 index 0000000..60c1a4d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CodeType.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum CodeType { + TOTP("totp"), + BACKUP_CODE("backup_code"); + + @JsonValue + private final String value; + + private CodeType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenRequestBody.java new file mode 100644 index 0000000..0efea63 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenRequestBody.java @@ -0,0 +1,309 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class CreateActorTokenRequestBody { + + /** + * The ID of the user that can use the newly created sign in token. + */ + @JsonProperty("user_id") + private String userId; + + /** + * The actor payload. It needs to include a sub property which should contain the ID of the actor. + * This whole payload will be also included in the JWT session token. + */ + @JsonProperty("actor") + private java.util.Map actor; + + /** + * Optional parameter to specify the life duration of the actor token in seconds. + * By default, the duration is 1 hour. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expires_in_seconds") + private Optional expiresInSeconds; + + /** + * The maximum duration that the session which will be created by the generated actor token should last. + * By default, the duration of a session created via an actor token, lasts 30 minutes. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("session_max_duration_in_seconds") + private Optional sessionMaxDurationInSeconds; + + @JsonCreator + public CreateActorTokenRequestBody( + @JsonProperty("user_id") String userId, + @JsonProperty("actor") java.util.Map actor, + @JsonProperty("expires_in_seconds") Optional expiresInSeconds, + @JsonProperty("session_max_duration_in_seconds") Optional sessionMaxDurationInSeconds) { + Utils.checkNotNull(userId, "userId"); + actor = Utils.emptyMapIfNull(actor); + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + Utils.checkNotNull(sessionMaxDurationInSeconds, "sessionMaxDurationInSeconds"); + this.userId = userId; + this.actor = actor; + this.expiresInSeconds = expiresInSeconds; + this.sessionMaxDurationInSeconds = sessionMaxDurationInSeconds; + } + + public CreateActorTokenRequestBody( + String userId, + java.util.Map actor) { + this(userId, actor, Optional.empty(), Optional.empty()); + } + + /** + * The ID of the user that can use the newly created sign in token. + */ + @JsonIgnore + public String userId() { + return userId; + } + + /** + * The actor payload. It needs to include a sub property which should contain the ID of the actor. + * This whole payload will be also included in the JWT session token. + */ + @JsonIgnore + public java.util.Map actor() { + return actor; + } + + /** + * Optional parameter to specify the life duration of the actor token in seconds. + * By default, the duration is 1 hour. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expiresInSeconds() { + return (Optional) expiresInSeconds; + } + + /** + * The maximum duration that the session which will be created by the generated actor token should last. + * By default, the duration of a session created via an actor token, lasts 30 minutes. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional sessionMaxDurationInSeconds() { + return (Optional) sessionMaxDurationInSeconds; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user that can use the newly created sign in token. + */ + public CreateActorTokenRequestBody withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The actor payload. It needs to include a sub property which should contain the ID of the actor. + * This whole payload will be also included in the JWT session token. + */ + public CreateActorTokenRequestBody withActor(java.util.Map actor) { + Utils.checkNotNull(actor, "actor"); + this.actor = actor; + return this; + } + + /** + * Optional parameter to specify the life duration of the actor token in seconds. + * By default, the duration is 1 hour. + */ + public CreateActorTokenRequestBody withExpiresInSeconds(long expiresInSeconds) { + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.expiresInSeconds = Optional.ofNullable(expiresInSeconds); + return this; + } + + /** + * Optional parameter to specify the life duration of the actor token in seconds. + * By default, the duration is 1 hour. + */ + public CreateActorTokenRequestBody withExpiresInSeconds(Optional expiresInSeconds) { + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.expiresInSeconds = expiresInSeconds; + return this; + } + + /** + * The maximum duration that the session which will be created by the generated actor token should last. + * By default, the duration of a session created via an actor token, lasts 30 minutes. + */ + public CreateActorTokenRequestBody withSessionMaxDurationInSeconds(long sessionMaxDurationInSeconds) { + Utils.checkNotNull(sessionMaxDurationInSeconds, "sessionMaxDurationInSeconds"); + this.sessionMaxDurationInSeconds = Optional.ofNullable(sessionMaxDurationInSeconds); + return this; + } + + /** + * The maximum duration that the session which will be created by the generated actor token should last. + * By default, the duration of a session created via an actor token, lasts 30 minutes. + */ + public CreateActorTokenRequestBody withSessionMaxDurationInSeconds(Optional sessionMaxDurationInSeconds) { + Utils.checkNotNull(sessionMaxDurationInSeconds, "sessionMaxDurationInSeconds"); + this.sessionMaxDurationInSeconds = sessionMaxDurationInSeconds; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateActorTokenRequestBody other = (CreateActorTokenRequestBody) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.actor, other.actor) && + java.util.Objects.deepEquals(this.expiresInSeconds, other.expiresInSeconds) && + java.util.Objects.deepEquals(this.sessionMaxDurationInSeconds, other.sessionMaxDurationInSeconds); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + actor, + expiresInSeconds, + sessionMaxDurationInSeconds); + } + + @Override + public String toString() { + return Utils.toString(CreateActorTokenRequestBody.class, + "userId", userId, + "actor", actor, + "expiresInSeconds", expiresInSeconds, + "sessionMaxDurationInSeconds", sessionMaxDurationInSeconds); + } + + public final static class Builder { + + private String userId; + + private java.util.Map actor; + + private Optional expiresInSeconds; + + private Optional sessionMaxDurationInSeconds; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user that can use the newly created sign in token. + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The actor payload. It needs to include a sub property which should contain the ID of the actor. + * This whole payload will be also included in the JWT session token. + */ + public Builder actor(java.util.Map actor) { + Utils.checkNotNull(actor, "actor"); + this.actor = actor; + return this; + } + + /** + * Optional parameter to specify the life duration of the actor token in seconds. + * By default, the duration is 1 hour. + */ + public Builder expiresInSeconds(long expiresInSeconds) { + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.expiresInSeconds = Optional.ofNullable(expiresInSeconds); + return this; + } + + /** + * Optional parameter to specify the life duration of the actor token in seconds. + * By default, the duration is 1 hour. + */ + public Builder expiresInSeconds(Optional expiresInSeconds) { + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.expiresInSeconds = expiresInSeconds; + return this; + } + + /** + * The maximum duration that the session which will be created by the generated actor token should last. + * By default, the duration of a session created via an actor token, lasts 30 minutes. + */ + public Builder sessionMaxDurationInSeconds(long sessionMaxDurationInSeconds) { + Utils.checkNotNull(sessionMaxDurationInSeconds, "sessionMaxDurationInSeconds"); + this.sessionMaxDurationInSeconds = Optional.ofNullable(sessionMaxDurationInSeconds); + return this; + } + + /** + * The maximum duration that the session which will be created by the generated actor token should last. + * By default, the duration of a session created via an actor token, lasts 30 minutes. + */ + public Builder sessionMaxDurationInSeconds(Optional sessionMaxDurationInSeconds) { + Utils.checkNotNull(sessionMaxDurationInSeconds, "sessionMaxDurationInSeconds"); + this.sessionMaxDurationInSeconds = sessionMaxDurationInSeconds; + return this; + } + + public CreateActorTokenRequestBody build() { + if (expiresInSeconds == null) { + expiresInSeconds = _SINGLETON_VALUE_ExpiresInSeconds.value(); + } + if (sessionMaxDurationInSeconds == null) { + sessionMaxDurationInSeconds = _SINGLETON_VALUE_SessionMaxDurationInSeconds.value(); + } + return new CreateActorTokenRequestBody( + userId, + actor, + expiresInSeconds, + sessionMaxDurationInSeconds); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_ExpiresInSeconds = + new LazySingletonValue<>( + "expires_in_seconds", + "3600", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_SessionMaxDurationInSeconds = + new LazySingletonValue<>( + "session_max_duration_in_seconds", + "1800", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenRequestBuilder.java new file mode 100644 index 0000000..6c9935f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateActorTokenRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateActorToken sdk; + + public CreateActorTokenRequestBuilder(SDKMethodInterfaces.MethodCallCreateActorToken sdk) { + this.sdk = sdk; + } + + public CreateActorTokenRequestBuilder request(CreateActorTokenRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateActorTokenRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateActorTokenResponse call() throws Exception { + + return sdk.createToken( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenResponse.java new file mode 100644 index 0000000..00693fe --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateActorTokenResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateActorTokenResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional actorToken; + + @JsonCreator + public CreateActorTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional actorToken) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(actorToken, "actorToken"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.actorToken = actorToken; + } + + public CreateActorTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional actorToken() { + return (Optional) actorToken; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateActorTokenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateActorTokenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateActorTokenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateActorTokenResponse withActorToken(com.clerk.backend_api.models.components.ActorToken actorToken) { + Utils.checkNotNull(actorToken, "actorToken"); + this.actorToken = Optional.ofNullable(actorToken); + return this; + } + + /** + * Success + */ + public CreateActorTokenResponse withActorToken(Optional actorToken) { + Utils.checkNotNull(actorToken, "actorToken"); + this.actorToken = actorToken; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateActorTokenResponse other = (CreateActorTokenResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.actorToken, other.actorToken); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + actorToken); + } + + @Override + public String toString() { + return Utils.toString(CreateActorTokenResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "actorToken", actorToken); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional actorToken = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder actorToken(com.clerk.backend_api.models.components.ActorToken actorToken) { + Utils.checkNotNull(actorToken, "actorToken"); + this.actorToken = Optional.ofNullable(actorToken); + return this; + } + + /** + * Success + */ + public Builder actorToken(Optional actorToken) { + Utils.checkNotNull(actorToken, "actorToken"); + this.actorToken = actorToken; + return this; + } + + public CreateActorTokenResponse build() { + return new CreateActorTokenResponse( + contentType, + statusCode, + rawResponse, + actorToken); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierRequestBody.java new file mode 100644 index 0000000..30733a5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierRequestBody.java @@ -0,0 +1,191 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class CreateAllowlistIdentifierRequestBody { + + /** + * The identifier to be added in the allow-list. + * This can be an email address, a phone number or a web3 wallet. + */ + @JsonProperty("identifier") + private String identifier; + + /** + * This flag denotes whether the given identifier will receive an invitation to join the application. + * Note that this only works for email address and phone number identifiers. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("notify") + private Optional notify_; + + @JsonCreator + public CreateAllowlistIdentifierRequestBody( + @JsonProperty("identifier") String identifier, + @JsonProperty("notify") Optional notify_) { + Utils.checkNotNull(identifier, "identifier"); + Utils.checkNotNull(notify_, "notify_"); + this.identifier = identifier; + this.notify_ = notify_; + } + + public CreateAllowlistIdentifierRequestBody( + String identifier) { + this(identifier, Optional.empty()); + } + + /** + * The identifier to be added in the allow-list. + * This can be an email address, a phone number or a web3 wallet. + */ + @JsonIgnore + public String identifier() { + return identifier; + } + + /** + * This flag denotes whether the given identifier will receive an invitation to join the application. + * Note that this only works for email address and phone number identifiers. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional notify_() { + return (Optional) notify_; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The identifier to be added in the allow-list. + * This can be an email address, a phone number or a web3 wallet. + */ + public CreateAllowlistIdentifierRequestBody withIdentifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + /** + * This flag denotes whether the given identifier will receive an invitation to join the application. + * Note that this only works for email address and phone number identifiers. + */ + public CreateAllowlistIdentifierRequestBody withNotify(boolean notify_) { + Utils.checkNotNull(notify_, "notify_"); + this.notify_ = Optional.ofNullable(notify_); + return this; + } + + /** + * This flag denotes whether the given identifier will receive an invitation to join the application. + * Note that this only works for email address and phone number identifiers. + */ + public CreateAllowlistIdentifierRequestBody withNotify(Optional notify_) { + Utils.checkNotNull(notify_, "notify_"); + this.notify_ = notify_; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAllowlistIdentifierRequestBody other = (CreateAllowlistIdentifierRequestBody) o; + return + java.util.Objects.deepEquals(this.identifier, other.identifier) && + java.util.Objects.deepEquals(this.notify_, other.notify_); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + identifier, + notify_); + } + + @Override + public String toString() { + return Utils.toString(CreateAllowlistIdentifierRequestBody.class, + "identifier", identifier, + "notify_", notify_); + } + + public final static class Builder { + + private String identifier; + + private Optional notify_; + + private Builder() { + // force use of static builder() method + } + + /** + * The identifier to be added in the allow-list. + * This can be an email address, a phone number or a web3 wallet. + */ + public Builder identifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + /** + * This flag denotes whether the given identifier will receive an invitation to join the application. + * Note that this only works for email address and phone number identifiers. + */ + public Builder notify_(boolean notify_) { + Utils.checkNotNull(notify_, "notify_"); + this.notify_ = Optional.ofNullable(notify_); + return this; + } + + /** + * This flag denotes whether the given identifier will receive an invitation to join the application. + * Note that this only works for email address and phone number identifiers. + */ + public Builder notify_(Optional notify_) { + Utils.checkNotNull(notify_, "notify_"); + this.notify_ = notify_; + return this; + } + + public CreateAllowlistIdentifierRequestBody build() { + if (notify_ == null) { + notify_ = _SINGLETON_VALUE_Notify.value(); + } + return new CreateAllowlistIdentifierRequestBody( + identifier, + notify_); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Notify = + new LazySingletonValue<>( + "notify", + "false", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierRequestBuilder.java new file mode 100644 index 0000000..b8faece --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateAllowlistIdentifierRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateAllowlistIdentifier sdk; + + public CreateAllowlistIdentifierRequestBuilder(SDKMethodInterfaces.MethodCallCreateAllowlistIdentifier sdk) { + this.sdk = sdk; + } + + public CreateAllowlistIdentifierRequestBuilder request(CreateAllowlistIdentifierRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateAllowlistIdentifierRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateAllowlistIdentifierResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierResponse.java new file mode 100644 index 0000000..6f550cd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateAllowlistIdentifierResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateAllowlistIdentifierResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional allowlistIdentifier; + + @JsonCreator + public CreateAllowlistIdentifierResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional allowlistIdentifier) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(allowlistIdentifier, "allowlistIdentifier"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.allowlistIdentifier = allowlistIdentifier; + } + + public CreateAllowlistIdentifierResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional allowlistIdentifier() { + return (Optional) allowlistIdentifier; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateAllowlistIdentifierResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateAllowlistIdentifierResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateAllowlistIdentifierResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateAllowlistIdentifierResponse withAllowlistIdentifier(com.clerk.backend_api.models.components.AllowlistIdentifier allowlistIdentifier) { + Utils.checkNotNull(allowlistIdentifier, "allowlistIdentifier"); + this.allowlistIdentifier = Optional.ofNullable(allowlistIdentifier); + return this; + } + + /** + * Success + */ + public CreateAllowlistIdentifierResponse withAllowlistIdentifier(Optional allowlistIdentifier) { + Utils.checkNotNull(allowlistIdentifier, "allowlistIdentifier"); + this.allowlistIdentifier = allowlistIdentifier; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAllowlistIdentifierResponse other = (CreateAllowlistIdentifierResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.allowlistIdentifier, other.allowlistIdentifier); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + allowlistIdentifier); + } + + @Override + public String toString() { + return Utils.toString(CreateAllowlistIdentifierResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "allowlistIdentifier", allowlistIdentifier); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional allowlistIdentifier = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder allowlistIdentifier(com.clerk.backend_api.models.components.AllowlistIdentifier allowlistIdentifier) { + Utils.checkNotNull(allowlistIdentifier, "allowlistIdentifier"); + this.allowlistIdentifier = Optional.ofNullable(allowlistIdentifier); + return this; + } + + /** + * Success + */ + public Builder allowlistIdentifier(Optional allowlistIdentifier) { + Utils.checkNotNull(allowlistIdentifier, "allowlistIdentifier"); + this.allowlistIdentifier = allowlistIdentifier; + return this; + } + + public CreateAllowlistIdentifierResponse build() { + return new CreateAllowlistIdentifierResponse( + contentType, + statusCode, + rawResponse, + allowlistIdentifier); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierRequestBody.java new file mode 100644 index 0000000..072894e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierRequestBody.java @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class CreateBlocklistIdentifierRequestBody { + + /** + * The identifier to be added in the block-list. + * This can be an email address, a phone number or a web3 wallet. + */ + @JsonProperty("identifier") + private String identifier; + + @JsonCreator + public CreateBlocklistIdentifierRequestBody( + @JsonProperty("identifier") String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + } + + /** + * The identifier to be added in the block-list. + * This can be an email address, a phone number or a web3 wallet. + */ + @JsonIgnore + public String identifier() { + return identifier; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The identifier to be added in the block-list. + * This can be an email address, a phone number or a web3 wallet. + */ + public CreateBlocklistIdentifierRequestBody withIdentifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBlocklistIdentifierRequestBody other = (CreateBlocklistIdentifierRequestBody) o; + return + java.util.Objects.deepEquals(this.identifier, other.identifier); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + identifier); + } + + @Override + public String toString() { + return Utils.toString(CreateBlocklistIdentifierRequestBody.class, + "identifier", identifier); + } + + public final static class Builder { + + private String identifier; + + private Builder() { + // force use of static builder() method + } + + /** + * The identifier to be added in the block-list. + * This can be an email address, a phone number or a web3 wallet. + */ + public Builder identifier(String identifier) { + Utils.checkNotNull(identifier, "identifier"); + this.identifier = identifier; + return this; + } + + public CreateBlocklistIdentifierRequestBody build() { + return new CreateBlocklistIdentifierRequestBody( + identifier); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierRequestBuilder.java new file mode 100644 index 0000000..6afae79 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateBlocklistIdentifierRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateBlocklistIdentifier sdk; + + public CreateBlocklistIdentifierRequestBuilder(SDKMethodInterfaces.MethodCallCreateBlocklistIdentifier sdk) { + this.sdk = sdk; + } + + public CreateBlocklistIdentifierRequestBuilder request(CreateBlocklistIdentifierRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateBlocklistIdentifierRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateBlocklistIdentifierResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierResponse.java new file mode 100644 index 0000000..74a810a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateBlocklistIdentifierResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateBlocklistIdentifierResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional blocklistIdentifier; + + @JsonCreator + public CreateBlocklistIdentifierResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional blocklistIdentifier) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(blocklistIdentifier, "blocklistIdentifier"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.blocklistIdentifier = blocklistIdentifier; + } + + public CreateBlocklistIdentifierResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional blocklistIdentifier() { + return (Optional) blocklistIdentifier; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateBlocklistIdentifierResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateBlocklistIdentifierResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateBlocklistIdentifierResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateBlocklistIdentifierResponse withBlocklistIdentifier(com.clerk.backend_api.models.components.BlocklistIdentifier blocklistIdentifier) { + Utils.checkNotNull(blocklistIdentifier, "blocklistIdentifier"); + this.blocklistIdentifier = Optional.ofNullable(blocklistIdentifier); + return this; + } + + /** + * Success + */ + public CreateBlocklistIdentifierResponse withBlocklistIdentifier(Optional blocklistIdentifier) { + Utils.checkNotNull(blocklistIdentifier, "blocklistIdentifier"); + this.blocklistIdentifier = blocklistIdentifier; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBlocklistIdentifierResponse other = (CreateBlocklistIdentifierResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.blocklistIdentifier, other.blocklistIdentifier); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + blocklistIdentifier); + } + + @Override + public String toString() { + return Utils.toString(CreateBlocklistIdentifierResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "blocklistIdentifier", blocklistIdentifier); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional blocklistIdentifier = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder blocklistIdentifier(com.clerk.backend_api.models.components.BlocklistIdentifier blocklistIdentifier) { + Utils.checkNotNull(blocklistIdentifier, "blocklistIdentifier"); + this.blocklistIdentifier = Optional.ofNullable(blocklistIdentifier); + return this; + } + + /** + * Success + */ + public Builder blocklistIdentifier(Optional blocklistIdentifier) { + Utils.checkNotNull(blocklistIdentifier, "blocklistIdentifier"); + this.blocklistIdentifier = blocklistIdentifier; + return this; + } + + public CreateBlocklistIdentifierResponse build() { + return new CreateBlocklistIdentifierResponse( + contentType, + statusCode, + rawResponse, + blocklistIdentifier); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressRequestBody.java new file mode 100644 index 0000000..160c034 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressRequestBody.java @@ -0,0 +1,319 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CreateEmailAddressRequestBody { + + /** + * The ID representing the user + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("user_id") + private Optional userId; + + /** + * The new email address. Must adhere to the RFC 5322 specification for email address format. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_address") + private Optional emailAddress; + + /** + * When created, the email address will be marked as verified. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("verified") + private JsonNullable verified; + + /** + * Create this email address as the primary email address for the user. + * Default: false, unless it is the first email address. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary") + private JsonNullable primary; + + @JsonCreator + public CreateEmailAddressRequestBody( + @JsonProperty("user_id") Optional userId, + @JsonProperty("email_address") Optional emailAddress, + @JsonProperty("verified") JsonNullable verified, + @JsonProperty("primary") JsonNullable primary) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(verified, "verified"); + Utils.checkNotNull(primary, "primary"); + this.userId = userId; + this.emailAddress = emailAddress; + this.verified = verified; + this.primary = primary; + } + + public CreateEmailAddressRequestBody() { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The ID representing the user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + /** + * The new email address. Must adhere to the RFC 5322 specification for email address format. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional emailAddress() { + return (Optional) emailAddress; + } + + /** + * When created, the email address will be marked as verified. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable verified() { + return (JsonNullable) verified; + } + + /** + * Create this email address as the primary email address for the user. + * Default: false, unless it is the first email address. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable primary() { + return (JsonNullable) primary; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID representing the user + */ + public CreateEmailAddressRequestBody withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * The ID representing the user + */ + public CreateEmailAddressRequestBody withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The new email address. Must adhere to the RFC 5322 specification for email address format. + */ + public CreateEmailAddressRequestBody withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * The new email address. Must adhere to the RFC 5322 specification for email address format. + */ + public CreateEmailAddressRequestBody withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * When created, the email address will be marked as verified. + */ + public CreateEmailAddressRequestBody withVerified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = JsonNullable.of(verified); + return this; + } + + /** + * When created, the email address will be marked as verified. + */ + public CreateEmailAddressRequestBody withVerified(JsonNullable verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + /** + * Create this email address as the primary email address for the user. + * Default: false, unless it is the first email address. + */ + public CreateEmailAddressRequestBody withPrimary(boolean primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = JsonNullable.of(primary); + return this; + } + + /** + * Create this email address as the primary email address for the user. + * Default: false, unless it is the first email address. + */ + public CreateEmailAddressRequestBody withPrimary(JsonNullable primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = primary; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEmailAddressRequestBody other = (CreateEmailAddressRequestBody) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.verified, other.verified) && + java.util.Objects.deepEquals(this.primary, other.primary); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + emailAddress, + verified, + primary); + } + + @Override + public String toString() { + return Utils.toString(CreateEmailAddressRequestBody.class, + "userId", userId, + "emailAddress", emailAddress, + "verified", verified, + "primary", primary); + } + + public final static class Builder { + + private Optional userId = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private JsonNullable verified = JsonNullable.undefined(); + + private JsonNullable primary = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID representing the user + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * The ID representing the user + */ + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The new email address. Must adhere to the RFC 5322 specification for email address format. + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * The new email address. Must adhere to the RFC 5322 specification for email address format. + */ + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * When created, the email address will be marked as verified. + */ + public Builder verified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = JsonNullable.of(verified); + return this; + } + + /** + * When created, the email address will be marked as verified. + */ + public Builder verified(JsonNullable verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + /** + * Create this email address as the primary email address for the user. + * Default: false, unless it is the first email address. + */ + public Builder primary(boolean primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = JsonNullable.of(primary); + return this; + } + + /** + * Create this email address as the primary email address for the user. + * Default: false, unless it is the first email address. + */ + public Builder primary(JsonNullable primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = primary; + return this; + } + + public CreateEmailAddressRequestBody build() { + return new CreateEmailAddressRequestBody( + userId, + emailAddress, + verified, + primary); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressRequestBuilder.java new file mode 100644 index 0000000..dd4f116 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateEmailAddressRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateEmailAddress sdk; + + public CreateEmailAddressRequestBuilder(SDKMethodInterfaces.MethodCallCreateEmailAddress sdk) { + this.sdk = sdk; + } + + public CreateEmailAddressRequestBuilder request(CreateEmailAddressRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateEmailAddressRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateEmailAddressResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressResponse.java new file mode 100644 index 0000000..f4ecc0e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateEmailAddressResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateEmailAddressResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional emailAddress; + + @JsonCreator + public CreateEmailAddressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional emailAddress) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(emailAddress, "emailAddress"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.emailAddress = emailAddress; + } + + public CreateEmailAddressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional emailAddress() { + return (Optional) emailAddress; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateEmailAddressResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateEmailAddressResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateEmailAddressResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateEmailAddressResponse withEmailAddress(com.clerk.backend_api.models.components.EmailAddress emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Success + */ + public CreateEmailAddressResponse withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEmailAddressResponse other = (CreateEmailAddressResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + emailAddress); + } + + @Override + public String toString() { + return Utils.toString(CreateEmailAddressResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "emailAddress", emailAddress); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional emailAddress = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder emailAddress(com.clerk.backend_api.models.components.EmailAddress emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Success + */ + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public CreateEmailAddressResponse build() { + return new CreateEmailAddressResponse( + contentType, + statusCode, + rawResponse, + emailAddress); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationPublicMetadata.java new file mode 100644 index 0000000..6d556a1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationPublicMetadata.java @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * CreateInvitationPublicMetadata - 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. + */ + +public class CreateInvitationPublicMetadata { + + @JsonCreator + public CreateInvitationPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(CreateInvitationPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public CreateInvitationPublicMetadata build() { + return new CreateInvitationPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationRequestBody.java new file mode 100644 index 0000000..55b522f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationRequestBody.java @@ -0,0 +1,401 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +/** + * CreateInvitationRequestBody - Required parameters + */ + +public class CreateInvitationRequestBody { + + /** + * The email address the invitation will be sent to + */ + @JsonProperty("email_address") + private String emailAddress; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("redirect_url") + private Optional redirectUrl; + + /** + * Optional flag which denotes whether an email invitation should be sent to the given email address. + * Defaults to true. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("notify") + private JsonNullable notify_; + + /** + * Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ignore_existing") + private JsonNullable ignoreExisting; + + @JsonCreator + public CreateInvitationRequestBody( + @JsonProperty("email_address") String emailAddress, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("redirect_url") Optional redirectUrl, + @JsonProperty("notify") JsonNullable notify_, + @JsonProperty("ignore_existing") JsonNullable ignoreExisting) { + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(redirectUrl, "redirectUrl"); + Utils.checkNotNull(notify_, "notify_"); + Utils.checkNotNull(ignoreExisting, "ignoreExisting"); + this.emailAddress = emailAddress; + this.publicMetadata = publicMetadata; + this.redirectUrl = redirectUrl; + this.notify_ = notify_; + this.ignoreExisting = ignoreExisting; + } + + public CreateInvitationRequestBody( + String emailAddress) { + this(emailAddress, Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The email address the invitation will be sent to + */ + @JsonIgnore + public String emailAddress() { + return emailAddress; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional redirectUrl() { + return (Optional) redirectUrl; + } + + /** + * Optional flag which denotes whether an email invitation should be sent to the given email address. + * Defaults to true. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable notify_() { + return (JsonNullable) notify_; + } + + /** + * Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable ignoreExisting() { + return (JsonNullable) ignoreExisting; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The email address the invitation will be sent to + */ + public CreateInvitationRequestBody withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * 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. + */ + public CreateInvitationRequestBody withPublicMetadata(CreateInvitationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * 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. + */ + public CreateInvitationRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * 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. + */ + public CreateInvitationRequestBody withRedirectUrl(String redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = Optional.ofNullable(redirectUrl); + return this; + } + + /** + * 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. + */ + public CreateInvitationRequestBody withRedirectUrl(Optional redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = redirectUrl; + return this; + } + + /** + * Optional flag which denotes whether an email invitation should be sent to the given email address. + * Defaults to true. + */ + public CreateInvitationRequestBody withNotify(boolean notify_) { + Utils.checkNotNull(notify_, "notify_"); + this.notify_ = JsonNullable.of(notify_); + return this; + } + + /** + * Optional flag which denotes whether an email invitation should be sent to the given email address. + * Defaults to true. + */ + public CreateInvitationRequestBody withNotify(JsonNullable notify_) { + Utils.checkNotNull(notify_, "notify_"); + this.notify_ = notify_; + return this; + } + + /** + * Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. + */ + public CreateInvitationRequestBody withIgnoreExisting(boolean ignoreExisting) { + Utils.checkNotNull(ignoreExisting, "ignoreExisting"); + this.ignoreExisting = JsonNullable.of(ignoreExisting); + return this; + } + + /** + * Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. + */ + public CreateInvitationRequestBody withIgnoreExisting(JsonNullable ignoreExisting) { + Utils.checkNotNull(ignoreExisting, "ignoreExisting"); + this.ignoreExisting = ignoreExisting; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInvitationRequestBody other = (CreateInvitationRequestBody) o; + return + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.redirectUrl, other.redirectUrl) && + java.util.Objects.deepEquals(this.notify_, other.notify_) && + java.util.Objects.deepEquals(this.ignoreExisting, other.ignoreExisting); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + emailAddress, + publicMetadata, + redirectUrl, + notify_, + ignoreExisting); + } + + @Override + public String toString() { + return Utils.toString(CreateInvitationRequestBody.class, + "emailAddress", emailAddress, + "publicMetadata", publicMetadata, + "redirectUrl", redirectUrl, + "notify_", notify_, + "ignoreExisting", ignoreExisting); + } + + public final static class Builder { + + private String emailAddress; + + private Optional publicMetadata = Optional.empty(); + + private Optional redirectUrl = Optional.empty(); + + private JsonNullable notify_; + + private JsonNullable ignoreExisting; + + private Builder() { + // force use of static builder() method + } + + /** + * The email address the invitation will be sent to + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * 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. + */ + public Builder publicMetadata(CreateInvitationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * 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. + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * 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. + */ + public Builder redirectUrl(String redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = Optional.ofNullable(redirectUrl); + return this; + } + + /** + * 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. + */ + public Builder redirectUrl(Optional redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = redirectUrl; + return this; + } + + /** + * Optional flag which denotes whether an email invitation should be sent to the given email address. + * Defaults to true. + */ + public Builder notify_(boolean notify_) { + Utils.checkNotNull(notify_, "notify_"); + this.notify_ = JsonNullable.of(notify_); + return this; + } + + /** + * Optional flag which denotes whether an email invitation should be sent to the given email address. + * Defaults to true. + */ + public Builder notify_(JsonNullable notify_) { + Utils.checkNotNull(notify_, "notify_"); + this.notify_ = notify_; + return this; + } + + /** + * Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. + */ + public Builder ignoreExisting(boolean ignoreExisting) { + Utils.checkNotNull(ignoreExisting, "ignoreExisting"); + this.ignoreExisting = JsonNullable.of(ignoreExisting); + return this; + } + + /** + * Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user. + */ + public Builder ignoreExisting(JsonNullable ignoreExisting) { + Utils.checkNotNull(ignoreExisting, "ignoreExisting"); + this.ignoreExisting = ignoreExisting; + return this; + } + + public CreateInvitationRequestBody build() { + if (notify_ == null) { + notify_ = _SINGLETON_VALUE_Notify.value(); + } + if (ignoreExisting == null) { + ignoreExisting = _SINGLETON_VALUE_IgnoreExisting.value(); + } + return new CreateInvitationRequestBody( + emailAddress, + publicMetadata, + redirectUrl, + notify_, + ignoreExisting); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Notify = + new LazySingletonValue<>( + "notify", + "true", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_IgnoreExisting = + new LazySingletonValue<>( + "ignore_existing", + "false", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationRequestBuilder.java new file mode 100644 index 0000000..f985a3f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateInvitationRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateInvitation sdk; + + public CreateInvitationRequestBuilder(SDKMethodInterfaces.MethodCallCreateInvitation sdk) { + this.sdk = sdk; + } + + public CreateInvitationRequestBuilder request(CreateInvitationRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateInvitationRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateInvitationResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationResponse.java new file mode 100644 index 0000000..cd1a240 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateInvitationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateInvitationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional invitation; + + @JsonCreator + public CreateInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional invitation) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(invitation, "invitation"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.invitation = invitation; + } + + public CreateInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional invitation() { + return (Optional) invitation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateInvitationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateInvitationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateInvitationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateInvitationResponse withInvitation(com.clerk.backend_api.models.components.Invitation invitation) { + Utils.checkNotNull(invitation, "invitation"); + this.invitation = Optional.ofNullable(invitation); + return this; + } + + /** + * Success + */ + public CreateInvitationResponse withInvitation(Optional invitation) { + Utils.checkNotNull(invitation, "invitation"); + this.invitation = invitation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInvitationResponse other = (CreateInvitationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.invitation, other.invitation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + invitation); + } + + @Override + public String toString() { + return Utils.toString(CreateInvitationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "invitation", invitation); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional invitation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder invitation(com.clerk.backend_api.models.components.Invitation invitation) { + Utils.checkNotNull(invitation, "invitation"); + this.invitation = Optional.ofNullable(invitation); + return this; + } + + /** + * Success + */ + public Builder invitation(Optional invitation) { + Utils.checkNotNull(invitation, "invitation"); + this.invitation = invitation; + return this; + } + + public CreateInvitationResponse build() { + return new CreateInvitationResponse( + contentType, + statusCode, + rawResponse, + invitation); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateRequestBody.java new file mode 100644 index 0000000..e297b77 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateRequestBody.java @@ -0,0 +1,496 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CreateJWTTemplateRequestBody { + + /** + * JWT template name + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + /** + * JWT template claims in JSON format + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("claims") + private Optional claims; + + /** + * JWT token lifetime + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lifetime") + private JsonNullable lifetime; + + /** + * JWT token allowed clock skew + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allowed_clock_skew") + private JsonNullable allowedClockSkew; + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_signing_key") + private Optional customSigningKey; + + /** + * The custom signing algorithm to use when minting JWTs + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signing_algorithm") + private JsonNullable signingAlgorithm; + + /** + * The custom signing private key to use when minting JWTs + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signing_key") + private JsonNullable signingKey; + + @JsonCreator + public CreateJWTTemplateRequestBody( + @JsonProperty("name") Optional name, + @JsonProperty("claims") Optional claims, + @JsonProperty("lifetime") JsonNullable lifetime, + @JsonProperty("allowed_clock_skew") JsonNullable allowedClockSkew, + @JsonProperty("custom_signing_key") Optional customSigningKey, + @JsonProperty("signing_algorithm") JsonNullable signingAlgorithm, + @JsonProperty("signing_key") JsonNullable signingKey) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(claims, "claims"); + Utils.checkNotNull(lifetime, "lifetime"); + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + Utils.checkNotNull(customSigningKey, "customSigningKey"); + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + Utils.checkNotNull(signingKey, "signingKey"); + this.name = name; + this.claims = claims; + this.lifetime = lifetime; + this.allowedClockSkew = allowedClockSkew; + this.customSigningKey = customSigningKey; + this.signingAlgorithm = signingAlgorithm; + this.signingKey = signingKey; + } + + public CreateJWTTemplateRequestBody() { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * JWT template name + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; + } + + /** + * JWT template claims in JSON format + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional claims() { + return (Optional) claims; + } + + /** + * JWT token lifetime + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lifetime() { + return (JsonNullable) lifetime; + } + + /** + * JWT token allowed clock skew + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable allowedClockSkew() { + return (JsonNullable) allowedClockSkew; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional customSigningKey() { + return (Optional) customSigningKey; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable signingAlgorithm() { + return (JsonNullable) signingAlgorithm; + } + + /** + * The custom signing private key to use when minting JWTs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable signingKey() { + return (JsonNullable) signingKey; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * JWT template name + */ + public CreateJWTTemplateRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * JWT template name + */ + public CreateJWTTemplateRequestBody withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * JWT template claims in JSON format + */ + public CreateJWTTemplateRequestBody withClaims(Claims claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = Optional.ofNullable(claims); + return this; + } + + /** + * JWT template claims in JSON format + */ + public CreateJWTTemplateRequestBody withClaims(Optional claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = claims; + return this; + } + + /** + * JWT token lifetime + */ + public CreateJWTTemplateRequestBody withLifetime(double lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = JsonNullable.of(lifetime); + return this; + } + + /** + * JWT token lifetime + */ + public CreateJWTTemplateRequestBody withLifetime(JsonNullable lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = lifetime; + return this; + } + + /** + * JWT token allowed clock skew + */ + public CreateJWTTemplateRequestBody withAllowedClockSkew(double allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = JsonNullable.of(allowedClockSkew); + return this; + } + + /** + * JWT token allowed clock skew + */ + public CreateJWTTemplateRequestBody withAllowedClockSkew(JsonNullable allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = allowedClockSkew; + return this; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + public CreateJWTTemplateRequestBody withCustomSigningKey(boolean customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = Optional.ofNullable(customSigningKey); + return this; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + public CreateJWTTemplateRequestBody withCustomSigningKey(Optional customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = customSigningKey; + return this; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + public CreateJWTTemplateRequestBody withSigningAlgorithm(String signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = JsonNullable.of(signingAlgorithm); + return this; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + public CreateJWTTemplateRequestBody withSigningAlgorithm(JsonNullable signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = signingAlgorithm; + return this; + } + + /** + * The custom signing private key to use when minting JWTs + */ + public CreateJWTTemplateRequestBody withSigningKey(String signingKey) { + Utils.checkNotNull(signingKey, "signingKey"); + this.signingKey = JsonNullable.of(signingKey); + return this; + } + + /** + * The custom signing private key to use when minting JWTs + */ + public CreateJWTTemplateRequestBody withSigningKey(JsonNullable signingKey) { + Utils.checkNotNull(signingKey, "signingKey"); + this.signingKey = signingKey; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJWTTemplateRequestBody other = (CreateJWTTemplateRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.claims, other.claims) && + java.util.Objects.deepEquals(this.lifetime, other.lifetime) && + java.util.Objects.deepEquals(this.allowedClockSkew, other.allowedClockSkew) && + java.util.Objects.deepEquals(this.customSigningKey, other.customSigningKey) && + java.util.Objects.deepEquals(this.signingAlgorithm, other.signingAlgorithm) && + java.util.Objects.deepEquals(this.signingKey, other.signingKey); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + claims, + lifetime, + allowedClockSkew, + customSigningKey, + signingAlgorithm, + signingKey); + } + + @Override + public String toString() { + return Utils.toString(CreateJWTTemplateRequestBody.class, + "name", name, + "claims", claims, + "lifetime", lifetime, + "allowedClockSkew", allowedClockSkew, + "customSigningKey", customSigningKey, + "signingAlgorithm", signingAlgorithm, + "signingKey", signingKey); + } + + public final static class Builder { + + private Optional name = Optional.empty(); + + private Optional claims = Optional.empty(); + + private JsonNullable lifetime = JsonNullable.undefined(); + + private JsonNullable allowedClockSkew = JsonNullable.undefined(); + + private Optional customSigningKey = Optional.empty(); + + private JsonNullable signingAlgorithm = JsonNullable.undefined(); + + private JsonNullable signingKey = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * JWT template name + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * JWT template name + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * JWT template claims in JSON format + */ + public Builder claims(Claims claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = Optional.ofNullable(claims); + return this; + } + + /** + * JWT template claims in JSON format + */ + public Builder claims(Optional claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = claims; + return this; + } + + /** + * JWT token lifetime + */ + public Builder lifetime(double lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = JsonNullable.of(lifetime); + return this; + } + + /** + * JWT token lifetime + */ + public Builder lifetime(JsonNullable lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = lifetime; + return this; + } + + /** + * JWT token allowed clock skew + */ + public Builder allowedClockSkew(double allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = JsonNullable.of(allowedClockSkew); + return this; + } + + /** + * JWT token allowed clock skew + */ + public Builder allowedClockSkew(JsonNullable allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = allowedClockSkew; + return this; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + public Builder customSigningKey(boolean customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = Optional.ofNullable(customSigningKey); + return this; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + public Builder customSigningKey(Optional customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = customSigningKey; + return this; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + public Builder signingAlgorithm(String signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = JsonNullable.of(signingAlgorithm); + return this; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + public Builder signingAlgorithm(JsonNullable signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = signingAlgorithm; + return this; + } + + /** + * The custom signing private key to use when minting JWTs + */ + public Builder signingKey(String signingKey) { + Utils.checkNotNull(signingKey, "signingKey"); + this.signingKey = JsonNullable.of(signingKey); + return this; + } + + /** + * The custom signing private key to use when minting JWTs + */ + public Builder signingKey(JsonNullable signingKey) { + Utils.checkNotNull(signingKey, "signingKey"); + this.signingKey = signingKey; + return this; + } + + public CreateJWTTemplateRequestBody build() { + return new CreateJWTTemplateRequestBody( + name, + claims, + lifetime, + allowedClockSkew, + customSigningKey, + signingAlgorithm, + signingKey); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateRequestBuilder.java new file mode 100644 index 0000000..40a9809 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateJWTTemplateRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateJWTTemplate sdk; + + public CreateJWTTemplateRequestBuilder(SDKMethodInterfaces.MethodCallCreateJWTTemplate sdk) { + this.sdk = sdk; + } + + public CreateJWTTemplateRequestBuilder request(CreateJWTTemplateRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateJWTTemplateRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateJWTTemplateResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateResponse.java new file mode 100644 index 0000000..b625130 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateJWTTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateJWTTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional jwtTemplate; + + @JsonCreator + public CreateJWTTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional jwtTemplate) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.jwtTemplate = jwtTemplate; + } + + public CreateJWTTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional jwtTemplate() { + return (Optional) jwtTemplate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateJWTTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateJWTTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateJWTTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateJWTTemplateResponse withJWTTemplate(com.clerk.backend_api.models.components.JWTTemplate jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = Optional.ofNullable(jwtTemplate); + return this; + } + + /** + * Success + */ + public CreateJWTTemplateResponse withJWTTemplate(Optional jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = jwtTemplate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJWTTemplateResponse other = (CreateJWTTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.jwtTemplate, other.jwtTemplate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + jwtTemplate); + } + + @Override + public String toString() { + return Utils.toString(CreateJWTTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "jwtTemplate", jwtTemplate); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional jwtTemplate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder jwtTemplate(com.clerk.backend_api.models.components.JWTTemplate jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = Optional.ofNullable(jwtTemplate); + return this; + } + + /** + * Success + */ + public Builder jwtTemplate(Optional jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = jwtTemplate; + return this; + } + + public CreateJWTTemplateResponse build() { + return new CreateJWTTemplateResponse( + contentType, + statusCode, + rawResponse, + jwtTemplate); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationRequestBody.java new file mode 100644 index 0000000..2caf5db --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationRequestBody.java @@ -0,0 +1,296 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class CreateOAuthApplicationRequestBody { + + /** + * The name of the new OAuth application + */ + @JsonProperty("name") + private String name; + + /** + * The callback URL of the new OAuth application + */ + @JsonProperty("callback_url") + private String callbackUrl; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("scopes") + private Optional scopes; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public") + private Optional public_; + + @JsonCreator + public CreateOAuthApplicationRequestBody( + @JsonProperty("name") String name, + @JsonProperty("callback_url") String callbackUrl, + @JsonProperty("scopes") Optional scopes, + @JsonProperty("public") Optional public_) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(callbackUrl, "callbackUrl"); + Utils.checkNotNull(scopes, "scopes"); + Utils.checkNotNull(public_, "public_"); + this.name = name; + this.callbackUrl = callbackUrl; + this.scopes = scopes; + this.public_ = public_; + } + + public CreateOAuthApplicationRequestBody( + String name, + String callbackUrl) { + this(name, callbackUrl, Optional.empty(), Optional.empty()); + } + + /** + * The name of the new OAuth application + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * The callback URL of the new OAuth application + */ + @JsonIgnore + public String callbackUrl() { + return callbackUrl; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional scopes() { + return (Optional) scopes; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional public_() { + return (Optional) public_; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The name of the new OAuth application + */ + public CreateOAuthApplicationRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The callback URL of the new OAuth application + */ + public CreateOAuthApplicationRequestBody withCallbackUrl(String callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = callbackUrl; + return this; + } + + /** + * 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. + */ + public CreateOAuthApplicationRequestBody withScopes(String scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * 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. + */ + public CreateOAuthApplicationRequestBody withScopes(Optional scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + /** + * 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. + */ + public CreateOAuthApplicationRequestBody withPublic(boolean public_) { + Utils.checkNotNull(public_, "public_"); + this.public_ = Optional.ofNullable(public_); + return this; + } + + /** + * 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. + */ + public CreateOAuthApplicationRequestBody withPublic(Optional public_) { + Utils.checkNotNull(public_, "public_"); + this.public_ = public_; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOAuthApplicationRequestBody other = (CreateOAuthApplicationRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.callbackUrl, other.callbackUrl) && + java.util.Objects.deepEquals(this.scopes, other.scopes) && + java.util.Objects.deepEquals(this.public_, other.public_); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + callbackUrl, + scopes, + public_); + } + + @Override + public String toString() { + return Utils.toString(CreateOAuthApplicationRequestBody.class, + "name", name, + "callbackUrl", callbackUrl, + "scopes", scopes, + "public_", public_); + } + + public final static class Builder { + + private String name; + + private String callbackUrl; + + private Optional scopes; + + private Optional public_ = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The name of the new OAuth application + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The callback URL of the new OAuth application + */ + public Builder callbackUrl(String callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = callbackUrl; + return this; + } + + /** + * 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. + */ + public Builder scopes(String scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * 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. + */ + public Builder scopes(Optional scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + /** + * 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. + */ + public Builder public_(boolean public_) { + Utils.checkNotNull(public_, "public_"); + this.public_ = Optional.ofNullable(public_); + return this; + } + + /** + * 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. + */ + public Builder public_(Optional public_) { + Utils.checkNotNull(public_, "public_"); + this.public_ = public_; + return this; + } + + public CreateOAuthApplicationRequestBody build() { + if (scopes == null) { + scopes = _SINGLETON_VALUE_Scopes.value(); + } + return new CreateOAuthApplicationRequestBody( + name, + callbackUrl, + scopes, + public_); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Scopes = + new LazySingletonValue<>( + "scopes", + "\"profile email\"", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationRequestBuilder.java new file mode 100644 index 0000000..78e04e3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateOAuthApplicationRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateOAuthApplication sdk; + + public CreateOAuthApplicationRequestBuilder(SDKMethodInterfaces.MethodCallCreateOAuthApplication sdk) { + this.sdk = sdk; + } + + public CreateOAuthApplicationRequestBuilder request(CreateOAuthApplicationRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateOAuthApplicationRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateOAuthApplicationResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationResponse.java new file mode 100644 index 0000000..6025d9a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOAuthApplicationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateOAuthApplicationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An OAuth application with client secret + */ + private Optional oAuthApplicationWithSecret; + + @JsonCreator + public CreateOAuthApplicationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional oAuthApplicationWithSecret) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.oAuthApplicationWithSecret = oAuthApplicationWithSecret; + } + + public CreateOAuthApplicationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An OAuth application with client secret + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional oAuthApplicationWithSecret() { + return (Optional) oAuthApplicationWithSecret; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateOAuthApplicationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateOAuthApplicationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateOAuthApplicationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An OAuth application with client secret + */ + public CreateOAuthApplicationResponse withOAuthApplicationWithSecret(com.clerk.backend_api.models.components.OAuthApplicationWithSecret oAuthApplicationWithSecret) { + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.oAuthApplicationWithSecret = Optional.ofNullable(oAuthApplicationWithSecret); + return this; + } + + /** + * An OAuth application with client secret + */ + public CreateOAuthApplicationResponse withOAuthApplicationWithSecret(Optional oAuthApplicationWithSecret) { + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.oAuthApplicationWithSecret = oAuthApplicationWithSecret; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOAuthApplicationResponse other = (CreateOAuthApplicationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.oAuthApplicationWithSecret, other.oAuthApplicationWithSecret); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + oAuthApplicationWithSecret); + } + + @Override + public String toString() { + return Utils.toString(CreateOAuthApplicationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "oAuthApplicationWithSecret", oAuthApplicationWithSecret); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional oAuthApplicationWithSecret = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An OAuth application with client secret + */ + public Builder oAuthApplicationWithSecret(com.clerk.backend_api.models.components.OAuthApplicationWithSecret oAuthApplicationWithSecret) { + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.oAuthApplicationWithSecret = Optional.ofNullable(oAuthApplicationWithSecret); + return this; + } + + /** + * An OAuth application with client secret + */ + public Builder oAuthApplicationWithSecret(Optional oAuthApplicationWithSecret) { + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.oAuthApplicationWithSecret = oAuthApplicationWithSecret; + return this; + } + + public CreateOAuthApplicationResponse build() { + return new CreateOAuthApplicationResponse( + contentType, + statusCode, + rawResponse, + oAuthApplicationWithSecret); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkPrivateMetadata.java new file mode 100644 index 0000000..92346c5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkPrivateMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * CreateOrganizationInvitationBulkPrivateMetadata - Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + +public class CreateOrganizationInvitationBulkPrivateMetadata { + + @JsonCreator + public CreateOrganizationInvitationBulkPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationBulkPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public CreateOrganizationInvitationBulkPrivateMetadata build() { + return new CreateOrganizationInvitationBulkPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkPublicMetadata.java new file mode 100644 index 0000000..3d2aaf4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkPublicMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * CreateOrganizationInvitationBulkPublicMetadata - Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + +public class CreateOrganizationInvitationBulkPublicMetadata { + + @JsonCreator + public CreateOrganizationInvitationBulkPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationBulkPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public CreateOrganizationInvitationBulkPublicMetadata build() { + return new CreateOrganizationInvitationBulkPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkRequest.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkRequest.java new file mode 100644 index 0000000..52674de --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class CreateOrganizationInvitationBulkRequest { + + /** + * The organization ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private java.util.List requestBody; + + @JsonCreator + public CreateOrganizationInvitationBulkRequest( + String organizationId, + java.util.List requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.requestBody = requestBody; + } + + /** + * The organization ID. + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + @JsonIgnore + public java.util.List requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The organization ID. + */ + public CreateOrganizationInvitationBulkRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public CreateOrganizationInvitationBulkRequest withRequestBody(java.util.List requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationInvitationBulkRequest other = (CreateOrganizationInvitationBulkRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationBulkRequest.class, + "organizationId", organizationId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private java.util.List requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The organization ID. + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public Builder requestBody(java.util.List requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public CreateOrganizationInvitationBulkRequest build() { + return new CreateOrganizationInvitationBulkRequest( + organizationId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkRequestBuilder.java new file mode 100644 index 0000000..d083d0f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateOrganizationInvitationBulkRequestBuilder { + + private String organizationId; + private java.util.List requestBody; + private final SDKMethodInterfaces.MethodCallCreateOrganizationInvitationBulk sdk; + + public CreateOrganizationInvitationBulkRequestBuilder(SDKMethodInterfaces.MethodCallCreateOrganizationInvitationBulk sdk) { + this.sdk = sdk; + } + + public CreateOrganizationInvitationBulkRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public CreateOrganizationInvitationBulkRequestBuilder requestBody(java.util.List requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public CreateOrganizationInvitationBulkResponse call() throws Exception { + + return sdk.createBulk( + organizationId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkResponse.java new file mode 100644 index 0000000..eed3ab7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationBulkResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateOrganizationInvitationBulkResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of organization invitations + */ + private Optional organizationInvitations; + + @JsonCreator + public CreateOrganizationInvitationBulkResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationInvitations) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationInvitations = organizationInvitations; + } + + public CreateOrganizationInvitationBulkResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of organization invitations + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationInvitations() { + return (Optional) organizationInvitations; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateOrganizationInvitationBulkResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateOrganizationInvitationBulkResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateOrganizationInvitationBulkResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization invitations + */ + public CreateOrganizationInvitationBulkResponse withOrganizationInvitations(com.clerk.backend_api.models.components.OrganizationInvitations organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = Optional.ofNullable(organizationInvitations); + return this; + } + + /** + * A list of organization invitations + */ + public CreateOrganizationInvitationBulkResponse withOrganizationInvitations(Optional organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = organizationInvitations; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationInvitationBulkResponse other = (CreateOrganizationInvitationBulkResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationInvitations, other.organizationInvitations); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationInvitations); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationBulkResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationInvitations", organizationInvitations); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationInvitations = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization invitations + */ + public Builder organizationInvitations(com.clerk.backend_api.models.components.OrganizationInvitations organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = Optional.ofNullable(organizationInvitations); + return this; + } + + /** + * A list of organization invitations + */ + public Builder organizationInvitations(Optional organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = organizationInvitations; + return this; + } + + public CreateOrganizationInvitationBulkResponse build() { + return new CreateOrganizationInvitationBulkResponse( + contentType, + statusCode, + rawResponse, + organizationInvitations); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationPrivateMetadata.java new file mode 100644 index 0000000..84f2e1c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationPrivateMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * CreateOrganizationInvitationPrivateMetadata - Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + +public class CreateOrganizationInvitationPrivateMetadata { + + @JsonCreator + public CreateOrganizationInvitationPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public CreateOrganizationInvitationPrivateMetadata build() { + return new CreateOrganizationInvitationPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationPublicMetadata.java new file mode 100644 index 0000000..5c6dc3d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationPublicMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * CreateOrganizationInvitationPublicMetadata - Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + +public class CreateOrganizationInvitationPublicMetadata { + + @JsonCreator + public CreateOrganizationInvitationPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public CreateOrganizationInvitationPublicMetadata build() { + return new CreateOrganizationInvitationPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequest.java new file mode 100644 index 0000000..5971ccd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class CreateOrganizationInvitationRequest { + + /** + * The ID of the organization for which to send the invitation + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private CreateOrganizationInvitationRequestBody requestBody; + + @JsonCreator + public CreateOrganizationInvitationRequest( + String organizationId, + CreateOrganizationInvitationRequestBody requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.requestBody = requestBody; + } + + /** + * The ID of the organization for which to send the invitation + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + @JsonIgnore + public CreateOrganizationInvitationRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization for which to send the invitation + */ + public CreateOrganizationInvitationRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public CreateOrganizationInvitationRequest withRequestBody(CreateOrganizationInvitationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationInvitationRequest other = (CreateOrganizationInvitationRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationRequest.class, + "organizationId", organizationId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private CreateOrganizationInvitationRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization for which to send the invitation + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public Builder requestBody(CreateOrganizationInvitationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public CreateOrganizationInvitationRequest build() { + return new CreateOrganizationInvitationRequest( + organizationId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequestBody.java new file mode 100644 index 0000000..f2b961b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequestBody.java @@ -0,0 +1,381 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class CreateOrganizationInvitationRequestBody { + + /** + * The email address of the new member that is going to be invited to the organization + */ + @JsonProperty("email_address") + private String emailAddress; + + /** + * The ID of the user that invites the new member to the organization. + * Must be an administrator in the organization. + */ + @JsonProperty("inviter_user_id") + private String inviterUserId; + + /** + * The role of the new member in the organization + */ + @JsonProperty("role") + private String role; + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("redirect_url") + private Optional redirectUrl; + + @JsonCreator + public CreateOrganizationInvitationRequestBody( + @JsonProperty("email_address") String emailAddress, + @JsonProperty("inviter_user_id") String inviterUserId, + @JsonProperty("role") String role, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("redirect_url") Optional redirectUrl) { + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(inviterUserId, "inviterUserId"); + Utils.checkNotNull(role, "role"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.emailAddress = emailAddress; + this.inviterUserId = inviterUserId; + this.role = role; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.redirectUrl = redirectUrl; + } + + public CreateOrganizationInvitationRequestBody( + String emailAddress, + String inviterUserId, + String role) { + this(emailAddress, inviterUserId, role, Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The email address of the new member that is going to be invited to the organization + */ + @JsonIgnore + public String emailAddress() { + return emailAddress; + } + + /** + * The ID of the user that invites the new member to the organization. + * Must be an administrator in the organization. + */ + @JsonIgnore + public String inviterUserId() { + return inviterUserId; + } + + /** + * The role of the new member in the organization + */ + @JsonIgnore + public String role() { + return role; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional redirectUrl() { + return (Optional) redirectUrl; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The email address of the new member that is going to be invited to the organization + */ + public CreateOrganizationInvitationRequestBody withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * The ID of the user that invites the new member to the organization. + * Must be an administrator in the organization. + */ + public CreateOrganizationInvitationRequestBody withInviterUserId(String inviterUserId) { + Utils.checkNotNull(inviterUserId, "inviterUserId"); + this.inviterUserId = inviterUserId; + return this; + } + + /** + * The role of the new member in the organization + */ + public CreateOrganizationInvitationRequestBody withRole(String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + public CreateOrganizationInvitationRequestBody withPublicMetadata(CreateOrganizationInvitationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + public CreateOrganizationInvitationRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + public CreateOrganizationInvitationRequestBody withPrivateMetadata(CreateOrganizationInvitationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + public CreateOrganizationInvitationRequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + public CreateOrganizationInvitationRequestBody withRedirectUrl(String redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = Optional.ofNullable(redirectUrl); + return this; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + public CreateOrganizationInvitationRequestBody withRedirectUrl(Optional redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = redirectUrl; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationInvitationRequestBody other = (CreateOrganizationInvitationRequestBody) o; + return + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.inviterUserId, other.inviterUserId) && + java.util.Objects.deepEquals(this.role, other.role) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.redirectUrl, other.redirectUrl); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + emailAddress, + inviterUserId, + role, + publicMetadata, + privateMetadata, + redirectUrl); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationRequestBody.class, + "emailAddress", emailAddress, + "inviterUserId", inviterUserId, + "role", role, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "redirectUrl", redirectUrl); + } + + public final static class Builder { + + private String emailAddress; + + private String inviterUserId; + + private String role; + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Optional redirectUrl = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The email address of the new member that is going to be invited to the organization + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * The ID of the user that invites the new member to the organization. + * Must be an administrator in the organization. + */ + public Builder inviterUserId(String inviterUserId) { + Utils.checkNotNull(inviterUserId, "inviterUserId"); + this.inviterUserId = inviterUserId; + return this; + } + + /** + * The role of the new member in the organization + */ + public Builder role(String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + public Builder publicMetadata(CreateOrganizationInvitationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + public Builder privateMetadata(CreateOrganizationInvitationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + public Builder redirectUrl(String redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = Optional.ofNullable(redirectUrl); + return this; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + public Builder redirectUrl(Optional redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = redirectUrl; + return this; + } + + public CreateOrganizationInvitationRequestBody build() { + return new CreateOrganizationInvitationRequestBody( + emailAddress, + inviterUserId, + role, + publicMetadata, + privateMetadata, + redirectUrl); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequestBuilder.java new file mode 100644 index 0000000..948aef6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateOrganizationInvitationRequestBuilder { + + private String organizationId; + private CreateOrganizationInvitationRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallCreateOrganizationInvitation sdk; + + public CreateOrganizationInvitationRequestBuilder(SDKMethodInterfaces.MethodCallCreateOrganizationInvitation sdk) { + this.sdk = sdk; + } + + public CreateOrganizationInvitationRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public CreateOrganizationInvitationRequestBuilder requestBody(CreateOrganizationInvitationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public CreateOrganizationInvitationResponse call() throws Exception { + + return sdk.create( + organizationId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationResponse.java new file mode 100644 index 0000000..6d955c1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationInvitationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateOrganizationInvitationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization invitation + */ + private Optional organizationInvitation; + + @JsonCreator + public CreateOrganizationInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationInvitation) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationInvitation = organizationInvitation; + } + + public CreateOrganizationInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization invitation + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationInvitation() { + return (Optional) organizationInvitation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateOrganizationInvitationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateOrganizationInvitationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateOrganizationInvitationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization invitation + */ + public CreateOrganizationInvitationResponse withOrganizationInvitation(com.clerk.backend_api.models.components.OrganizationInvitation organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = Optional.ofNullable(organizationInvitation); + return this; + } + + /** + * An organization invitation + */ + public CreateOrganizationInvitationResponse withOrganizationInvitation(Optional organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = organizationInvitation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationInvitationResponse other = (CreateOrganizationInvitationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationInvitation, other.organizationInvitation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationInvitation); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationInvitationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationInvitation", organizationInvitation); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationInvitation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization invitation + */ + public Builder organizationInvitation(com.clerk.backend_api.models.components.OrganizationInvitation organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = Optional.ofNullable(organizationInvitation); + return this; + } + + /** + * An organization invitation + */ + public Builder organizationInvitation(Optional organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = organizationInvitation; + return this; + } + + public CreateOrganizationInvitationResponse build() { + return new CreateOrganizationInvitationResponse( + contentType, + statusCode, + rawResponse, + organizationInvitation); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequest.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequest.java new file mode 100644 index 0000000..2f54380 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class CreateOrganizationMembershipRequest { + + /** + * The ID of the organization where the new membership will be created + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private CreateOrganizationMembershipRequestBody requestBody; + + @JsonCreator + public CreateOrganizationMembershipRequest( + String organizationId, + CreateOrganizationMembershipRequestBody requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.requestBody = requestBody; + } + + /** + * The ID of the organization where the new membership will be created + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + @JsonIgnore + public CreateOrganizationMembershipRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization where the new membership will be created + */ + public CreateOrganizationMembershipRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public CreateOrganizationMembershipRequest withRequestBody(CreateOrganizationMembershipRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationMembershipRequest other = (CreateOrganizationMembershipRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationMembershipRequest.class, + "organizationId", organizationId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private CreateOrganizationMembershipRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization where the new membership will be created + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public Builder requestBody(CreateOrganizationMembershipRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public CreateOrganizationMembershipRequest build() { + return new CreateOrganizationMembershipRequest( + organizationId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequestBody.java new file mode 100644 index 0000000..f7e7248 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequestBody.java @@ -0,0 +1,147 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class CreateOrganizationMembershipRequestBody { + + /** + * The ID of the user that will be added as a member in the organization. + * The user needs to exist in the same instance as the organization and must not be a member of the given organization already. + */ + @JsonProperty("user_id") + private String userId; + + /** + * The role that the new member will have in the organization. + */ + @JsonProperty("role") + private String role; + + @JsonCreator + public CreateOrganizationMembershipRequestBody( + @JsonProperty("user_id") String userId, + @JsonProperty("role") String role) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(role, "role"); + this.userId = userId; + this.role = role; + } + + /** + * The ID of the user that will be added as a member in the organization. + * The user needs to exist in the same instance as the organization and must not be a member of the given organization already. + */ + @JsonIgnore + public String userId() { + return userId; + } + + /** + * The role that the new member will have in the organization. + */ + @JsonIgnore + public String role() { + return role; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user that will be added as a member in the organization. + * The user needs to exist in the same instance as the organization and must not be a member of the given organization already. + */ + public CreateOrganizationMembershipRequestBody withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The role that the new member will have in the organization. + */ + public CreateOrganizationMembershipRequestBody withRole(String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationMembershipRequestBody other = (CreateOrganizationMembershipRequestBody) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.role, other.role); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + role); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationMembershipRequestBody.class, + "userId", userId, + "role", role); + } + + public final static class Builder { + + private String userId; + + private String role; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user that will be added as a member in the organization. + * The user needs to exist in the same instance as the organization and must not be a member of the given organization already. + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The role that the new member will have in the organization. + */ + public Builder role(String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public CreateOrganizationMembershipRequestBody build() { + return new CreateOrganizationMembershipRequestBody( + userId, + role); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequestBuilder.java new file mode 100644 index 0000000..25bc067 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateOrganizationMembershipRequestBuilder { + + private String organizationId; + private CreateOrganizationMembershipRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallCreateOrganizationMembership sdk; + + public CreateOrganizationMembershipRequestBuilder(SDKMethodInterfaces.MethodCallCreateOrganizationMembership sdk) { + this.sdk = sdk; + } + + public CreateOrganizationMembershipRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public CreateOrganizationMembershipRequestBuilder requestBody(CreateOrganizationMembershipRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public CreateOrganizationMembershipResponse call() throws Exception { + + return sdk.create( + organizationId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipResponse.java new file mode 100644 index 0000000..abbf1e0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationMembershipResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateOrganizationMembershipResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional organizationMembership; + + @JsonCreator + public CreateOrganizationMembershipResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationMembership) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationMembership = organizationMembership; + } + + public CreateOrganizationMembershipResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationMembership() { + return (Optional) organizationMembership; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateOrganizationMembershipResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateOrganizationMembershipResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateOrganizationMembershipResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateOrganizationMembershipResponse withOrganizationMembership(com.clerk.backend_api.models.components.OrganizationMembership organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = Optional.ofNullable(organizationMembership); + return this; + } + + /** + * Success + */ + public CreateOrganizationMembershipResponse withOrganizationMembership(Optional organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = organizationMembership; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationMembershipResponse other = (CreateOrganizationMembershipResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationMembership, other.organizationMembership); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationMembership); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationMembershipResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationMembership", organizationMembership); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationMembership = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder organizationMembership(com.clerk.backend_api.models.components.OrganizationMembership organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = Optional.ofNullable(organizationMembership); + return this; + } + + /** + * Success + */ + public Builder organizationMembership(Optional organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = organizationMembership; + return this; + } + + public CreateOrganizationMembershipResponse build() { + return new CreateOrganizationMembershipResponse( + contentType, + statusCode, + rawResponse, + organizationMembership); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationPrivateMetadata.java new file mode 100644 index 0000000..d9af17e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationPrivateMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * CreateOrganizationPrivateMetadata - Metadata saved on the organization, accessible only from the Backend API + */ + +public class CreateOrganizationPrivateMetadata { + + @JsonCreator + public CreateOrganizationPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public CreateOrganizationPrivateMetadata build() { + return new CreateOrganizationPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationPublicMetadata.java new file mode 100644 index 0000000..f62730b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationPublicMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * CreateOrganizationPublicMetadata - Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API + */ + +public class CreateOrganizationPublicMetadata { + + @JsonCreator + public CreateOrganizationPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public CreateOrganizationPublicMetadata build() { + return new CreateOrganizationPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationRequestBody.java new file mode 100644 index 0000000..f36f7c6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationRequestBody.java @@ -0,0 +1,408 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class CreateOrganizationRequestBody { + + /** + * The name of the new organization + */ + @JsonProperty("name") + private String name; + + /** + * The ID of the User who will become the administrator for the new organization + */ + @JsonProperty("created_by") + private String createdBy; + + /** + * Metadata saved on the organization, accessible only from the Backend API + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + /** + * Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * A slug for the new organization. + * Can contain only lowercase alphanumeric characters and the dash "-". + * Must be unique for the instance. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("slug") + private Optional slug; + + /** + * The maximum number of memberships allowed for this organization + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("max_allowed_memberships") + private Optional maxAllowedMemberships; + + @JsonCreator + public CreateOrganizationRequestBody( + @JsonProperty("name") String name, + @JsonProperty("created_by") String createdBy, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("slug") Optional slug, + @JsonProperty("max_allowed_memberships") Optional maxAllowedMemberships) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(createdBy, "createdBy"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.name = name; + this.createdBy = createdBy; + this.privateMetadata = privateMetadata; + this.publicMetadata = publicMetadata; + this.slug = slug; + this.maxAllowedMemberships = maxAllowedMemberships; + } + + public CreateOrganizationRequestBody( + String name, + String createdBy) { + this(name, createdBy, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The name of the new organization + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * The ID of the User who will become the administrator for the new organization + */ + @JsonIgnore + public String createdBy() { + return createdBy; + } + + /** + * Metadata saved on the organization, accessible only from the Backend API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + /** + * Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * A slug for the new organization. + * Can contain only lowercase alphanumeric characters and the dash "-". + * Must be unique for the instance. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional slug() { + return (Optional) slug; + } + + /** + * The maximum number of memberships allowed for this organization + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional maxAllowedMemberships() { + return (Optional) maxAllowedMemberships; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The name of the new organization + */ + public CreateOrganizationRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The ID of the User who will become the administrator for the new organization + */ + public CreateOrganizationRequestBody withCreatedBy(String createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = createdBy; + return this; + } + + /** + * Metadata saved on the organization, accessible only from the Backend API + */ + public CreateOrganizationRequestBody withPrivateMetadata(CreateOrganizationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization, accessible only from the Backend API + */ + public CreateOrganizationRequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API + */ + public CreateOrganizationRequestBody withPublicMetadata(CreateOrganizationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API + */ + public CreateOrganizationRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * A slug for the new organization. + * Can contain only lowercase alphanumeric characters and the dash "-". + * Must be unique for the instance. + */ + public CreateOrganizationRequestBody withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + /** + * A slug for the new organization. + * Can contain only lowercase alphanumeric characters and the dash "-". + * Must be unique for the instance. + */ + public CreateOrganizationRequestBody withSlug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + /** + * The maximum number of memberships allowed for this organization + */ + public CreateOrganizationRequestBody withMaxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = Optional.ofNullable(maxAllowedMemberships); + return this; + } + + /** + * The maximum number of memberships allowed for this organization + */ + public CreateOrganizationRequestBody withMaxAllowedMemberships(Optional maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationRequestBody other = (CreateOrganizationRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.createdBy, other.createdBy) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.maxAllowedMemberships, other.maxAllowedMemberships); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + createdBy, + privateMetadata, + publicMetadata, + slug, + maxAllowedMemberships); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationRequestBody.class, + "name", name, + "createdBy", createdBy, + "privateMetadata", privateMetadata, + "publicMetadata", publicMetadata, + "slug", slug, + "maxAllowedMemberships", maxAllowedMemberships); + } + + public final static class Builder { + + private String name; + + private String createdBy; + + private Optional privateMetadata = Optional.empty(); + + private Optional publicMetadata = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional maxAllowedMemberships = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The name of the new organization + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The ID of the User who will become the administrator for the new organization + */ + public Builder createdBy(String createdBy) { + Utils.checkNotNull(createdBy, "createdBy"); + this.createdBy = createdBy; + return this; + } + + /** + * Metadata saved on the organization, accessible only from the Backend API + */ + public Builder privateMetadata(CreateOrganizationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization, accessible only from the Backend API + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API + */ + public Builder publicMetadata(CreateOrganizationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * A slug for the new organization. + * Can contain only lowercase alphanumeric characters and the dash "-". + * Must be unique for the instance. + */ + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = Optional.ofNullable(slug); + return this; + } + + /** + * A slug for the new organization. + * Can contain only lowercase alphanumeric characters and the dash "-". + * Must be unique for the instance. + */ + public Builder slug(Optional slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + /** + * The maximum number of memberships allowed for this organization + */ + public Builder maxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = Optional.ofNullable(maxAllowedMemberships); + return this; + } + + /** + * The maximum number of memberships allowed for this organization + */ + public Builder maxAllowedMemberships(Optional maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public CreateOrganizationRequestBody build() { + return new CreateOrganizationRequestBody( + name, + createdBy, + privateMetadata, + publicMetadata, + slug, + maxAllowedMemberships); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationRequestBuilder.java new file mode 100644 index 0000000..466a5db --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateOrganizationRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateOrganization sdk; + + public CreateOrganizationRequestBuilder(SDKMethodInterfaces.MethodCallCreateOrganization sdk) { + this.sdk = sdk; + } + + public CreateOrganizationRequestBuilder request(CreateOrganizationRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateOrganizationRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateOrganizationResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationResponse.java new file mode 100644 index 0000000..1bcbd08 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateOrganizationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateOrganizationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization + */ + private Optional organization; + + @JsonCreator + public CreateOrganizationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organization) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organization, "organization"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organization = organization; + } + + public CreateOrganizationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organization() { + return (Optional) organization; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateOrganizationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateOrganizationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateOrganizationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public CreateOrganizationResponse withOrganization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public CreateOrganizationResponse withOrganization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationResponse other = (CreateOrganizationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organization, other.organization); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organization); + } + + @Override + public String toString() { + return Utils.toString(CreateOrganizationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organization", organization); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organization = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public Builder organization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public Builder organization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + public CreateOrganizationResponse build() { + return new CreateOrganizationResponse( + contentType, + statusCode, + rawResponse, + organization); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberRequestBody.java new file mode 100644 index 0000000..7e75e9a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberRequestBody.java @@ -0,0 +1,392 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CreatePhoneNumberRequestBody { + + /** + * The ID representing the user + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("user_id") + private Optional userId; + + /** + * The new phone number. Must adhere to the E.164 standard for phone number format. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone_number") + private Optional phoneNumber; + + /** + * When created, the phone number will be marked as verified. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("verified") + private JsonNullable verified; + + /** + * Create this phone number as the primary phone number for the user. + * Default: false, unless it is the first phone number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary") + private JsonNullable primary; + + /** + * Create this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reserved_for_second_factor") + private JsonNullable reservedForSecondFactor; + + @JsonCreator + public CreatePhoneNumberRequestBody( + @JsonProperty("user_id") Optional userId, + @JsonProperty("phone_number") Optional phoneNumber, + @JsonProperty("verified") JsonNullable verified, + @JsonProperty("primary") JsonNullable primary, + @JsonProperty("reserved_for_second_factor") JsonNullable reservedForSecondFactor) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + Utils.checkNotNull(verified, "verified"); + Utils.checkNotNull(primary, "primary"); + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.userId = userId; + this.phoneNumber = phoneNumber; + this.verified = verified; + this.primary = primary; + this.reservedForSecondFactor = reservedForSecondFactor; + } + + public CreatePhoneNumberRequestBody() { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The ID representing the user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + /** + * The new phone number. Must adhere to the E.164 standard for phone number format. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional phoneNumber() { + return (Optional) phoneNumber; + } + + /** + * When created, the phone number will be marked as verified. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable verified() { + return (JsonNullable) verified; + } + + /** + * Create this phone number as the primary phone number for the user. + * Default: false, unless it is the first phone number. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable primary() { + return (JsonNullable) primary; + } + + /** + * Create this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable reservedForSecondFactor() { + return (JsonNullable) reservedForSecondFactor; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID representing the user + */ + public CreatePhoneNumberRequestBody withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * The ID representing the user + */ + public CreatePhoneNumberRequestBody withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The new phone number. Must adhere to the E.164 standard for phone number format. + */ + public CreatePhoneNumberRequestBody withPhoneNumber(String phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * The new phone number. Must adhere to the E.164 standard for phone number format. + */ + public CreatePhoneNumberRequestBody withPhoneNumber(Optional phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + /** + * When created, the phone number will be marked as verified. + */ + public CreatePhoneNumberRequestBody withVerified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = JsonNullable.of(verified); + return this; + } + + /** + * When created, the phone number will be marked as verified. + */ + public CreatePhoneNumberRequestBody withVerified(JsonNullable verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + /** + * Create this phone number as the primary phone number for the user. + * Default: false, unless it is the first phone number. + */ + public CreatePhoneNumberRequestBody withPrimary(boolean primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = JsonNullable.of(primary); + return this; + } + + /** + * Create this phone number as the primary phone number for the user. + * Default: false, unless it is the first phone number. + */ + public CreatePhoneNumberRequestBody withPrimary(JsonNullable primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = primary; + return this; + } + + /** + * Create this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + public CreatePhoneNumberRequestBody withReservedForSecondFactor(boolean reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = JsonNullable.of(reservedForSecondFactor); + return this; + } + + /** + * Create this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + public CreatePhoneNumberRequestBody withReservedForSecondFactor(JsonNullable reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = reservedForSecondFactor; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePhoneNumberRequestBody other = (CreatePhoneNumberRequestBody) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber) && + java.util.Objects.deepEquals(this.verified, other.verified) && + java.util.Objects.deepEquals(this.primary, other.primary) && + java.util.Objects.deepEquals(this.reservedForSecondFactor, other.reservedForSecondFactor); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + phoneNumber, + verified, + primary, + reservedForSecondFactor); + } + + @Override + public String toString() { + return Utils.toString(CreatePhoneNumberRequestBody.class, + "userId", userId, + "phoneNumber", phoneNumber, + "verified", verified, + "primary", primary, + "reservedForSecondFactor", reservedForSecondFactor); + } + + public final static class Builder { + + private Optional userId = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private JsonNullable verified = JsonNullable.undefined(); + + private JsonNullable primary = JsonNullable.undefined(); + + private JsonNullable reservedForSecondFactor = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID representing the user + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * The ID representing the user + */ + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The new phone number. Must adhere to the E.164 standard for phone number format. + */ + public Builder phoneNumber(String phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * The new phone number. Must adhere to the E.164 standard for phone number format. + */ + public Builder phoneNumber(Optional phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + /** + * When created, the phone number will be marked as verified. + */ + public Builder verified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = JsonNullable.of(verified); + return this; + } + + /** + * When created, the phone number will be marked as verified. + */ + public Builder verified(JsonNullable verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + /** + * Create this phone number as the primary phone number for the user. + * Default: false, unless it is the first phone number. + */ + public Builder primary(boolean primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = JsonNullable.of(primary); + return this; + } + + /** + * Create this phone number as the primary phone number for the user. + * Default: false, unless it is the first phone number. + */ + public Builder primary(JsonNullable primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = primary; + return this; + } + + /** + * Create this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + public Builder reservedForSecondFactor(boolean reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = JsonNullable.of(reservedForSecondFactor); + return this; + } + + /** + * Create this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + public Builder reservedForSecondFactor(JsonNullable reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = reservedForSecondFactor; + return this; + } + + public CreatePhoneNumberRequestBody build() { + return new CreatePhoneNumberRequestBody( + userId, + phoneNumber, + verified, + primary, + reservedForSecondFactor); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberRequestBuilder.java new file mode 100644 index 0000000..b14a24c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreatePhoneNumberRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreatePhoneNumber sdk; + + public CreatePhoneNumberRequestBuilder(SDKMethodInterfaces.MethodCallCreatePhoneNumber sdk) { + this.sdk = sdk; + } + + public CreatePhoneNumberRequestBuilder request(CreatePhoneNumberRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreatePhoneNumberRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreatePhoneNumberResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberResponse.java new file mode 100644 index 0000000..d8c897b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreatePhoneNumberResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreatePhoneNumberResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional phoneNumber; + + @JsonCreator + public CreatePhoneNumberResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional phoneNumber) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.phoneNumber = phoneNumber; + } + + public CreatePhoneNumberResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional phoneNumber() { + return (Optional) phoneNumber; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreatePhoneNumberResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreatePhoneNumberResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePhoneNumberResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreatePhoneNumberResponse withPhoneNumber(com.clerk.backend_api.models.components.PhoneNumber phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Success + */ + public CreatePhoneNumberResponse withPhoneNumber(Optional phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePhoneNumberResponse other = (CreatePhoneNumberResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + phoneNumber); + } + + @Override + public String toString() { + return Utils.toString(CreatePhoneNumberResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "phoneNumber", phoneNumber); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional phoneNumber = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder phoneNumber(com.clerk.backend_api.models.components.PhoneNumber phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Success + */ + public Builder phoneNumber(Optional phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + public CreatePhoneNumberResponse build() { + return new CreatePhoneNumberResponse( + contentType, + statusCode, + rawResponse, + phoneNumber); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLRequestBody.java new file mode 100644 index 0000000..642883a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLRequestBody.java @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class CreateRedirectURLRequestBody { + + /** + * The full url value prefixed with `https://` or a custom scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"` + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("url") + private Optional url; + + @JsonCreator + public CreateRedirectURLRequestBody( + @JsonProperty("url") Optional url) { + Utils.checkNotNull(url, "url"); + this.url = url; + } + + public CreateRedirectURLRequestBody() { + this(Optional.empty()); + } + + /** + * The full url value prefixed with `https://` or a custom scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"` + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional url() { + return (Optional) url; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The full url value prefixed with `https://` or a custom scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"` + */ + public CreateRedirectURLRequestBody withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = Optional.ofNullable(url); + return this; + } + + /** + * The full url value prefixed with `https://` or a custom scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"` + */ + public CreateRedirectURLRequestBody withUrl(Optional url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateRedirectURLRequestBody other = (CreateRedirectURLRequestBody) o; + return + java.util.Objects.deepEquals(this.url, other.url); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + url); + } + + @Override + public String toString() { + return Utils.toString(CreateRedirectURLRequestBody.class, + "url", url); + } + + public final static class Builder { + + private Optional url = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The full url value prefixed with `https://` or a custom scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"` + */ + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = Optional.ofNullable(url); + return this; + } + + /** + * The full url value prefixed with `https://` or a custom scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"` + */ + public Builder url(Optional url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + public CreateRedirectURLRequestBody build() { + return new CreateRedirectURLRequestBody( + url); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLRequestBuilder.java new file mode 100644 index 0000000..7ee96d2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateRedirectURLRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateRedirectURL sdk; + + public CreateRedirectURLRequestBuilder(SDKMethodInterfaces.MethodCallCreateRedirectURL sdk) { + this.sdk = sdk; + } + + public CreateRedirectURLRequestBuilder request(CreateRedirectURLRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateRedirectURLRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateRedirectURLResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLResponse.java new file mode 100644 index 0000000..69c0760 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateRedirectURLResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateRedirectURLResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional redirectURL; + + @JsonCreator + public CreateRedirectURLResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional redirectURL) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(redirectURL, "redirectURL"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.redirectURL = redirectURL; + } + + public CreateRedirectURLResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional redirectURL() { + return (Optional) redirectURL; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateRedirectURLResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateRedirectURLResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateRedirectURLResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateRedirectURLResponse withRedirectURL(com.clerk.backend_api.models.components.RedirectURL redirectURL) { + Utils.checkNotNull(redirectURL, "redirectURL"); + this.redirectURL = Optional.ofNullable(redirectURL); + return this; + } + + /** + * Success + */ + public CreateRedirectURLResponse withRedirectURL(Optional redirectURL) { + Utils.checkNotNull(redirectURL, "redirectURL"); + this.redirectURL = redirectURL; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateRedirectURLResponse other = (CreateRedirectURLResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.redirectURL, other.redirectURL); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + redirectURL); + } + + @Override + public String toString() { + return Utils.toString(CreateRedirectURLResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "redirectURL", redirectURL); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional redirectURL = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder redirectURL(com.clerk.backend_api.models.components.RedirectURL redirectURL) { + Utils.checkNotNull(redirectURL, "redirectURL"); + this.redirectURL = Optional.ofNullable(redirectURL); + return this; + } + + /** + * Success + */ + public Builder redirectURL(Optional redirectURL) { + Utils.checkNotNull(redirectURL, "redirectURL"); + this.redirectURL = redirectURL; + return this; + } + + public CreateRedirectURLResponse build() { + return new CreateRedirectURLResponse( + contentType, + statusCode, + rawResponse, + redirectURL); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionRequestBody.java new file mode 100644 index 0000000..464da03 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionRequestBody.java @@ -0,0 +1,560 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CreateSAMLConnectionRequestBody { + + /** + * The name to use as a label for this SAML Connection + */ + @JsonProperty("name") + private String name; + + /** + * The domain of your organization. Sign in flows using an email with this domain, will use this SAML Connection. + */ + @JsonProperty("domain") + private String domain; + + /** + * The IdP provider of the connection. + */ + @JsonProperty("provider") + private Provider provider; + + /** + * The Entity ID as provided by the IdP + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_entity_id") + private JsonNullable idpEntityId; + + /** + * The Single-Sign On URL as provided by the IdP + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_sso_url") + private JsonNullable idpSsoUrl; + + /** + * The X.509 certificate as provided by the IdP + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_certificate") + private JsonNullable idpCertificate; + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_metadata_url") + private JsonNullable idpMetadataUrl; + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_metadata") + private JsonNullable idpMetadata; + + /** + * Define the attribute name mapping between Identity Provider and Clerk's user properties + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attribute_mapping") + private JsonNullable attributeMapping; + + @JsonCreator + public CreateSAMLConnectionRequestBody( + @JsonProperty("name") String name, + @JsonProperty("domain") String domain, + @JsonProperty("provider") Provider provider, + @JsonProperty("idp_entity_id") JsonNullable idpEntityId, + @JsonProperty("idp_sso_url") JsonNullable idpSsoUrl, + @JsonProperty("idp_certificate") JsonNullable idpCertificate, + @JsonProperty("idp_metadata_url") JsonNullable idpMetadataUrl, + @JsonProperty("idp_metadata") JsonNullable idpMetadata, + @JsonProperty("attribute_mapping") JsonNullable attributeMapping) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(domain, "domain"); + Utils.checkNotNull(provider, "provider"); + Utils.checkNotNull(idpEntityId, "idpEntityId"); + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + Utils.checkNotNull(idpCertificate, "idpCertificate"); + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + Utils.checkNotNull(idpMetadata, "idpMetadata"); + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.name = name; + this.domain = domain; + this.provider = provider; + this.idpEntityId = idpEntityId; + this.idpSsoUrl = idpSsoUrl; + this.idpCertificate = idpCertificate; + this.idpMetadataUrl = idpMetadataUrl; + this.idpMetadata = idpMetadata; + this.attributeMapping = attributeMapping; + } + + public CreateSAMLConnectionRequestBody( + String name, + String domain, + Provider provider) { + this(name, domain, provider, JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The name to use as a label for this SAML Connection + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * The domain of your organization. Sign in flows using an email with this domain, will use this SAML Connection. + */ + @JsonIgnore + public String domain() { + return domain; + } + + /** + * The IdP provider of the connection. + */ + @JsonIgnore + public Provider provider() { + return provider; + } + + /** + * The Entity ID as provided by the IdP + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpEntityId() { + return (JsonNullable) idpEntityId; + } + + /** + * The Single-Sign On URL as provided by the IdP + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpSsoUrl() { + return (JsonNullable) idpSsoUrl; + } + + /** + * The X.509 certificate as provided by the IdP + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpCertificate() { + return (JsonNullable) idpCertificate; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpMetadataUrl() { + return (JsonNullable) idpMetadataUrl; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpMetadata() { + return (JsonNullable) idpMetadata; + } + + /** + * Define the attribute name mapping between Identity Provider and Clerk's user properties + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attributeMapping() { + return (JsonNullable) attributeMapping; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The name to use as a label for this SAML Connection + */ + public CreateSAMLConnectionRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The domain of your organization. Sign in flows using an email with this domain, will use this SAML Connection. + */ + public CreateSAMLConnectionRequestBody withDomain(String domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + /** + * The IdP provider of the connection. + */ + public CreateSAMLConnectionRequestBody withProvider(Provider provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + /** + * The Entity ID as provided by the IdP + */ + public CreateSAMLConnectionRequestBody withIdpEntityId(String idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = JsonNullable.of(idpEntityId); + return this; + } + + /** + * The Entity ID as provided by the IdP + */ + public CreateSAMLConnectionRequestBody withIdpEntityId(JsonNullable idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = idpEntityId; + return this; + } + + /** + * The Single-Sign On URL as provided by the IdP + */ + public CreateSAMLConnectionRequestBody withIdpSsoUrl(String idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = JsonNullable.of(idpSsoUrl); + return this; + } + + /** + * The Single-Sign On URL as provided by the IdP + */ + public CreateSAMLConnectionRequestBody withIdpSsoUrl(JsonNullable idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = idpSsoUrl; + return this; + } + + /** + * The X.509 certificate as provided by the IdP + */ + public CreateSAMLConnectionRequestBody withIdpCertificate(String idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = JsonNullable.of(idpCertificate); + return this; + } + + /** + * The X.509 certificate as provided by the IdP + */ + public CreateSAMLConnectionRequestBody withIdpCertificate(JsonNullable idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = idpCertificate; + return this; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties + */ + public CreateSAMLConnectionRequestBody withIdpMetadataUrl(String idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = JsonNullable.of(idpMetadataUrl); + return this; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties + */ + public CreateSAMLConnectionRequestBody withIdpMetadataUrl(JsonNullable idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = idpMetadataUrl; + return this; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + public CreateSAMLConnectionRequestBody withIdpMetadata(String idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = JsonNullable.of(idpMetadata); + return this; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + public CreateSAMLConnectionRequestBody withIdpMetadata(JsonNullable idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = idpMetadata; + return this; + } + + /** + * Define the attribute name mapping between Identity Provider and Clerk's user properties + */ + public CreateSAMLConnectionRequestBody withAttributeMapping(AttributeMapping attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = JsonNullable.of(attributeMapping); + return this; + } + + /** + * Define the attribute name mapping between Identity Provider and Clerk's user properties + */ + public CreateSAMLConnectionRequestBody withAttributeMapping(JsonNullable attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = attributeMapping; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSAMLConnectionRequestBody other = (CreateSAMLConnectionRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.domain, other.domain) && + java.util.Objects.deepEquals(this.provider, other.provider) && + java.util.Objects.deepEquals(this.idpEntityId, other.idpEntityId) && + java.util.Objects.deepEquals(this.idpSsoUrl, other.idpSsoUrl) && + java.util.Objects.deepEquals(this.idpCertificate, other.idpCertificate) && + java.util.Objects.deepEquals(this.idpMetadataUrl, other.idpMetadataUrl) && + java.util.Objects.deepEquals(this.idpMetadata, other.idpMetadata) && + java.util.Objects.deepEquals(this.attributeMapping, other.attributeMapping); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + domain, + provider, + idpEntityId, + idpSsoUrl, + idpCertificate, + idpMetadataUrl, + idpMetadata, + attributeMapping); + } + + @Override + public String toString() { + return Utils.toString(CreateSAMLConnectionRequestBody.class, + "name", name, + "domain", domain, + "provider", provider, + "idpEntityId", idpEntityId, + "idpSsoUrl", idpSsoUrl, + "idpCertificate", idpCertificate, + "idpMetadataUrl", idpMetadataUrl, + "idpMetadata", idpMetadata, + "attributeMapping", attributeMapping); + } + + public final static class Builder { + + private String name; + + private String domain; + + private Provider provider; + + private JsonNullable idpEntityId = JsonNullable.undefined(); + + private JsonNullable idpSsoUrl = JsonNullable.undefined(); + + private JsonNullable idpCertificate = JsonNullable.undefined(); + + private JsonNullable idpMetadataUrl = JsonNullable.undefined(); + + private JsonNullable idpMetadata = JsonNullable.undefined(); + + private JsonNullable attributeMapping = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The name to use as a label for this SAML Connection + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The domain of your organization. Sign in flows using an email with this domain, will use this SAML Connection. + */ + public Builder domain(String domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + /** + * The IdP provider of the connection. + */ + public Builder provider(Provider provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + /** + * The Entity ID as provided by the IdP + */ + public Builder idpEntityId(String idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = JsonNullable.of(idpEntityId); + return this; + } + + /** + * The Entity ID as provided by the IdP + */ + public Builder idpEntityId(JsonNullable idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = idpEntityId; + return this; + } + + /** + * The Single-Sign On URL as provided by the IdP + */ + public Builder idpSsoUrl(String idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = JsonNullable.of(idpSsoUrl); + return this; + } + + /** + * The Single-Sign On URL as provided by the IdP + */ + public Builder idpSsoUrl(JsonNullable idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = idpSsoUrl; + return this; + } + + /** + * The X.509 certificate as provided by the IdP + */ + public Builder idpCertificate(String idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = JsonNullable.of(idpCertificate); + return this; + } + + /** + * The X.509 certificate as provided by the IdP + */ + public Builder idpCertificate(JsonNullable idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = idpCertificate; + return this; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties + */ + public Builder idpMetadataUrl(String idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = JsonNullable.of(idpMetadataUrl); + return this; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties + */ + public Builder idpMetadataUrl(JsonNullable idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = idpMetadataUrl; + return this; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + public Builder idpMetadata(String idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = JsonNullable.of(idpMetadata); + return this; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + public Builder idpMetadata(JsonNullable idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = idpMetadata; + return this; + } + + /** + * Define the attribute name mapping between Identity Provider and Clerk's user properties + */ + public Builder attributeMapping(AttributeMapping attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = JsonNullable.of(attributeMapping); + return this; + } + + /** + * Define the attribute name mapping between Identity Provider and Clerk's user properties + */ + public Builder attributeMapping(JsonNullable attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = attributeMapping; + return this; + } + + public CreateSAMLConnectionRequestBody build() { + return new CreateSAMLConnectionRequestBody( + name, + domain, + provider, + idpEntityId, + idpSsoUrl, + idpCertificate, + idpMetadataUrl, + idpMetadata, + attributeMapping); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionRequestBuilder.java new file mode 100644 index 0000000..d16859b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateSAMLConnectionRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateSAMLConnection sdk; + + public CreateSAMLConnectionRequestBuilder(SDKMethodInterfaces.MethodCallCreateSAMLConnection sdk) { + this.sdk = sdk; + } + + public CreateSAMLConnectionRequestBuilder request(CreateSAMLConnectionRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateSAMLConnectionRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateSAMLConnectionResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionResponse.java new file mode 100644 index 0000000..123df8a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSAMLConnectionResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateSAMLConnectionResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A SAML Connection + */ + private Optional samlConnection; + + @JsonCreator + public CreateSAMLConnectionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional samlConnection) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(samlConnection, "samlConnection"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.samlConnection = samlConnection; + } + + public CreateSAMLConnectionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A SAML Connection + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional samlConnection() { + return (Optional) samlConnection; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateSAMLConnectionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateSAMLConnectionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateSAMLConnectionResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A SAML Connection + */ + public CreateSAMLConnectionResponse withSAMLConnection(com.clerk.backend_api.models.components.SAMLConnection samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = Optional.ofNullable(samlConnection); + return this; + } + + /** + * A SAML Connection + */ + public CreateSAMLConnectionResponse withSAMLConnection(Optional samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = samlConnection; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSAMLConnectionResponse other = (CreateSAMLConnectionResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.samlConnection, other.samlConnection); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + samlConnection); + } + + @Override + public String toString() { + return Utils.toString(CreateSAMLConnectionResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "samlConnection", samlConnection); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional samlConnection = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A SAML Connection + */ + public Builder samlConnection(com.clerk.backend_api.models.components.SAMLConnection samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = Optional.ofNullable(samlConnection); + return this; + } + + /** + * A SAML Connection + */ + public Builder samlConnection(Optional samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = samlConnection; + return this; + } + + public CreateSAMLConnectionResponse build() { + return new CreateSAMLConnectionResponse( + contentType, + statusCode, + rawResponse, + samlConnection); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateRequest.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateRequest.java new file mode 100644 index 0000000..61d0549 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateRequest.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class CreateSessionTokenFromTemplateRequest { + + /** + * The ID of the session + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=session_id") + private String sessionId; + + /** + * The name of the JWT Template defined in your instance (e.g. `custom_hasura`). + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_name") + private String templateName; + + @JsonCreator + public CreateSessionTokenFromTemplateRequest( + String sessionId, + String templateName) { + Utils.checkNotNull(sessionId, "sessionId"); + Utils.checkNotNull(templateName, "templateName"); + this.sessionId = sessionId; + this.templateName = templateName; + } + + /** + * The ID of the session + */ + @JsonIgnore + public String sessionId() { + return sessionId; + } + + /** + * The name of the JWT Template defined in your instance (e.g. `custom_hasura`). + */ + @JsonIgnore + public String templateName() { + return templateName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the session + */ + public CreateSessionTokenFromTemplateRequest withSessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + /** + * The name of the JWT Template defined in your instance (e.g. `custom_hasura`). + */ + public CreateSessionTokenFromTemplateRequest withTemplateName(String templateName) { + Utils.checkNotNull(templateName, "templateName"); + this.templateName = templateName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSessionTokenFromTemplateRequest other = (CreateSessionTokenFromTemplateRequest) o; + return + java.util.Objects.deepEquals(this.sessionId, other.sessionId) && + java.util.Objects.deepEquals(this.templateName, other.templateName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + sessionId, + templateName); + } + + @Override + public String toString() { + return Utils.toString(CreateSessionTokenFromTemplateRequest.class, + "sessionId", sessionId, + "templateName", templateName); + } + + public final static class Builder { + + private String sessionId; + + private String templateName; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the session + */ + public Builder sessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + /** + * The name of the JWT Template defined in your instance (e.g. `custom_hasura`). + */ + public Builder templateName(String templateName) { + Utils.checkNotNull(templateName, "templateName"); + this.templateName = templateName; + return this; + } + + public CreateSessionTokenFromTemplateRequest build() { + return new CreateSessionTokenFromTemplateRequest( + sessionId, + templateName); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateRequestBuilder.java new file mode 100644 index 0000000..93320ae --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateSessionTokenFromTemplateRequestBuilder { + + private String sessionId; + private String templateName; + private final SDKMethodInterfaces.MethodCallCreateSessionTokenFromTemplate sdk; + + public CreateSessionTokenFromTemplateRequestBuilder(SDKMethodInterfaces.MethodCallCreateSessionTokenFromTemplate sdk) { + this.sdk = sdk; + } + + public CreateSessionTokenFromTemplateRequestBuilder sessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + public CreateSessionTokenFromTemplateRequestBuilder templateName(String templateName) { + Utils.checkNotNull(templateName, "templateName"); + this.templateName = templateName; + return this; + } + + public CreateSessionTokenFromTemplateResponse call() throws Exception { + + return sdk.createTokenFromTemplate( + sessionId, + templateName); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateResponse.java new file mode 100644 index 0000000..40f5b9b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateSessionTokenFromTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * OK + */ + private Optional object; + + @JsonCreator + public CreateSessionTokenFromTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public CreateSessionTokenFromTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * OK + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateSessionTokenFromTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateSessionTokenFromTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateSessionTokenFromTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * OK + */ + public CreateSessionTokenFromTemplateResponse withObject(CreateSessionTokenFromTemplateResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * OK + */ + public CreateSessionTokenFromTemplateResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSessionTokenFromTemplateResponse other = (CreateSessionTokenFromTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(CreateSessionTokenFromTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * OK + */ + public Builder object(CreateSessionTokenFromTemplateResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * OK + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public CreateSessionTokenFromTemplateResponse build() { + return new CreateSessionTokenFromTemplateResponse( + contentType, + statusCode, + rawResponse, + object); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateResponseBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateResponseBody.java new file mode 100644 index 0000000..b78ce96 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSessionTokenFromTemplateResponseBody.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * CreateSessionTokenFromTemplateResponseBody - OK + */ + +public class CreateSessionTokenFromTemplateResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("jwt") + private Optional jwt; + + @JsonCreator + public CreateSessionTokenFromTemplateResponseBody( + @JsonProperty("object") Optional object, + @JsonProperty("jwt") Optional jwt) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(jwt, "jwt"); + this.object = object; + this.jwt = jwt; + } + + public CreateSessionTokenFromTemplateResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional jwt() { + return (Optional) jwt; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreateSessionTokenFromTemplateResponseBody withObject(Object object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + public CreateSessionTokenFromTemplateResponseBody withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public CreateSessionTokenFromTemplateResponseBody withJwt(String jwt) { + Utils.checkNotNull(jwt, "jwt"); + this.jwt = Optional.ofNullable(jwt); + return this; + } + + public CreateSessionTokenFromTemplateResponseBody withJwt(Optional jwt) { + Utils.checkNotNull(jwt, "jwt"); + this.jwt = jwt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSessionTokenFromTemplateResponseBody other = (CreateSessionTokenFromTemplateResponseBody) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.jwt, other.jwt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + jwt); + } + + @Override + public String toString() { + return Utils.toString(CreateSessionTokenFromTemplateResponseBody.class, + "object", object, + "jwt", jwt); + } + + public final static class Builder { + + private Optional object = Optional.empty(); + + private Optional jwt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder object(Object object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Builder jwt(String jwt) { + Utils.checkNotNull(jwt, "jwt"); + this.jwt = Optional.ofNullable(jwt); + return this; + } + + public Builder jwt(Optional jwt) { + Utils.checkNotNull(jwt, "jwt"); + this.jwt = jwt; + return this; + } + + public CreateSessionTokenFromTemplateResponseBody build() { + return new CreateSessionTokenFromTemplateResponseBody( + object, + jwt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenRequestBody.java new file mode 100644 index 0000000..939d367 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenRequestBody.java @@ -0,0 +1,206 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class CreateSignInTokenRequestBody { + + /** + * The ID of the user that can use the newly created sign in token + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("user_id") + private Optional userId; + + /** + * Optional parameter to specify the life duration of the sign in token in seconds. + * By default, the duration is 30 days. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expires_in_seconds") + private Optional expiresInSeconds; + + @JsonCreator + public CreateSignInTokenRequestBody( + @JsonProperty("user_id") Optional userId, + @JsonProperty("expires_in_seconds") Optional expiresInSeconds) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.userId = userId; + this.expiresInSeconds = expiresInSeconds; + } + + public CreateSignInTokenRequestBody() { + this(Optional.empty(), Optional.empty()); + } + + /** + * The ID of the user that can use the newly created sign in token + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + /** + * Optional parameter to specify the life duration of the sign in token in seconds. + * By default, the duration is 30 days. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expiresInSeconds() { + return (Optional) expiresInSeconds; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user that can use the newly created sign in token + */ + public CreateSignInTokenRequestBody withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * The ID of the user that can use the newly created sign in token + */ + public CreateSignInTokenRequestBody withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * Optional parameter to specify the life duration of the sign in token in seconds. + * By default, the duration is 30 days. + */ + public CreateSignInTokenRequestBody withExpiresInSeconds(long expiresInSeconds) { + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.expiresInSeconds = Optional.ofNullable(expiresInSeconds); + return this; + } + + /** + * Optional parameter to specify the life duration of the sign in token in seconds. + * By default, the duration is 30 days. + */ + public CreateSignInTokenRequestBody withExpiresInSeconds(Optional expiresInSeconds) { + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.expiresInSeconds = expiresInSeconds; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSignInTokenRequestBody other = (CreateSignInTokenRequestBody) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.expiresInSeconds, other.expiresInSeconds); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + expiresInSeconds); + } + + @Override + public String toString() { + return Utils.toString(CreateSignInTokenRequestBody.class, + "userId", userId, + "expiresInSeconds", expiresInSeconds); + } + + public final static class Builder { + + private Optional userId = Optional.empty(); + + private Optional expiresInSeconds; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user that can use the newly created sign in token + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * The ID of the user that can use the newly created sign in token + */ + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * Optional parameter to specify the life duration of the sign in token in seconds. + * By default, the duration is 30 days. + */ + public Builder expiresInSeconds(long expiresInSeconds) { + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.expiresInSeconds = Optional.ofNullable(expiresInSeconds); + return this; + } + + /** + * Optional parameter to specify the life duration of the sign in token in seconds. + * By default, the duration is 30 days. + */ + public Builder expiresInSeconds(Optional expiresInSeconds) { + Utils.checkNotNull(expiresInSeconds, "expiresInSeconds"); + this.expiresInSeconds = expiresInSeconds; + return this; + } + + public CreateSignInTokenRequestBody build() { + if (expiresInSeconds == null) { + expiresInSeconds = _SINGLETON_VALUE_ExpiresInSeconds.value(); + } + return new CreateSignInTokenRequestBody( + userId, + expiresInSeconds); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_ExpiresInSeconds = + new LazySingletonValue<>( + "expires_in_seconds", + "2592000", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenRequestBuilder.java new file mode 100644 index 0000000..21fa5c9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateSignInTokenRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateSignInToken sdk; + + public CreateSignInTokenRequestBuilder(SDKMethodInterfaces.MethodCallCreateSignInToken sdk) { + this.sdk = sdk; + } + + public CreateSignInTokenRequestBuilder request(CreateSignInTokenRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateSignInTokenRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateSignInTokenResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenResponse.java new file mode 100644 index 0000000..07de2f9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSignInTokenResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateSignInTokenResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional signInToken; + + @JsonCreator + public CreateSignInTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional signInToken) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(signInToken, "signInToken"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.signInToken = signInToken; + } + + public CreateSignInTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional signInToken() { + return (Optional) signInToken; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateSignInTokenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateSignInTokenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateSignInTokenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateSignInTokenResponse withSignInToken(com.clerk.backend_api.models.components.SignInToken signInToken) { + Utils.checkNotNull(signInToken, "signInToken"); + this.signInToken = Optional.ofNullable(signInToken); + return this; + } + + /** + * Success + */ + public CreateSignInTokenResponse withSignInToken(Optional signInToken) { + Utils.checkNotNull(signInToken, "signInToken"); + this.signInToken = signInToken; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSignInTokenResponse other = (CreateSignInTokenResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.signInToken, other.signInToken); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + signInToken); + } + + @Override + public String toString() { + return Utils.toString(CreateSignInTokenResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "signInToken", signInToken); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional signInToken = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder signInToken(com.clerk.backend_api.models.components.SignInToken signInToken) { + Utils.checkNotNull(signInToken, "signInToken"); + this.signInToken = Optional.ofNullable(signInToken); + return this; + } + + /** + * Success + */ + public Builder signInToken(Optional signInToken) { + Utils.checkNotNull(signInToken, "signInToken"); + this.signInToken = signInToken; + return this; + } + + public CreateSignInTokenResponse build() { + return new CreateSignInTokenResponse( + contentType, + statusCode, + rawResponse, + signInToken); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSvixAppRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSvixAppRequestBuilder.java new file mode 100644 index 0000000..17b7644 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSvixAppRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateSvixAppRequestBuilder { + + private final SDKMethodInterfaces.MethodCallCreateSvixApp sdk; + + public CreateSvixAppRequestBuilder(SDKMethodInterfaces.MethodCallCreateSvixApp sdk) { + this.sdk = sdk; + } + + public CreateSvixAppResponse call() throws Exception { + + return sdk.createSvixAppDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateSvixAppResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateSvixAppResponse.java new file mode 100644 index 0000000..7b375a9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateSvixAppResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateSvixAppResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + private Optional svixURL; + + @JsonCreator + public CreateSvixAppResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional svixURL) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(svixURL, "svixURL"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.svixURL = svixURL; + } + + public CreateSvixAppResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional svixURL() { + return (Optional) svixURL; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateSvixAppResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateSvixAppResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateSvixAppResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + public CreateSvixAppResponse withSvixURL(com.clerk.backend_api.models.components.SvixURL svixURL) { + Utils.checkNotNull(svixURL, "svixURL"); + this.svixURL = Optional.ofNullable(svixURL); + return this; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + public CreateSvixAppResponse withSvixURL(Optional svixURL) { + Utils.checkNotNull(svixURL, "svixURL"); + this.svixURL = svixURL; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSvixAppResponse other = (CreateSvixAppResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.svixURL, other.svixURL); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + svixURL); + } + + @Override + public String toString() { + return Utils.toString(CreateSvixAppResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "svixURL", svixURL); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional svixURL = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + public Builder svixURL(com.clerk.backend_api.models.components.SvixURL svixURL) { + Utils.checkNotNull(svixURL, "svixURL"); + this.svixURL = Optional.ofNullable(svixURL); + return this; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + public Builder svixURL(Optional svixURL) { + Utils.checkNotNull(svixURL, "svixURL"); + this.svixURL = svixURL; + return this; + } + + public CreateSvixAppResponse build() { + return new CreateSvixAppResponse( + contentType, + statusCode, + rawResponse, + svixURL); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateTestingTokenRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateTestingTokenRequestBuilder.java new file mode 100644 index 0000000..02612fe --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateTestingTokenRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateTestingTokenRequestBuilder { + + private final SDKMethodInterfaces.MethodCallCreateTestingToken sdk; + + public CreateTestingTokenRequestBuilder(SDKMethodInterfaces.MethodCallCreateTestingToken sdk) { + this.sdk = sdk; + } + + public CreateTestingTokenResponse call() throws Exception { + + return sdk.createDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateTestingTokenResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateTestingTokenResponse.java new file mode 100644 index 0000000..26b72fe --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateTestingTokenResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateTestingTokenResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A Testing Token + */ + private Optional testingToken; + + @JsonCreator + public CreateTestingTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional testingToken) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(testingToken, "testingToken"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.testingToken = testingToken; + } + + public CreateTestingTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A Testing Token + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional testingToken() { + return (Optional) testingToken; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateTestingTokenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateTestingTokenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateTestingTokenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A Testing Token + */ + public CreateTestingTokenResponse withTestingToken(com.clerk.backend_api.models.components.TestingToken testingToken) { + Utils.checkNotNull(testingToken, "testingToken"); + this.testingToken = Optional.ofNullable(testingToken); + return this; + } + + /** + * A Testing Token + */ + public CreateTestingTokenResponse withTestingToken(Optional testingToken) { + Utils.checkNotNull(testingToken, "testingToken"); + this.testingToken = testingToken; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTestingTokenResponse other = (CreateTestingTokenResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.testingToken, other.testingToken); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + testingToken); + } + + @Override + public String toString() { + return Utils.toString(CreateTestingTokenResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "testingToken", testingToken); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional testingToken = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A Testing Token + */ + public Builder testingToken(com.clerk.backend_api.models.components.TestingToken testingToken) { + Utils.checkNotNull(testingToken, "testingToken"); + this.testingToken = Optional.ofNullable(testingToken); + return this; + } + + /** + * A Testing Token + */ + public Builder testingToken(Optional testingToken) { + Utils.checkNotNull(testingToken, "testingToken"); + this.testingToken = testingToken; + return this; + } + + public CreateTestingTokenResponse build() { + return new CreateTestingTokenResponse( + contentType, + statusCode, + rawResponse, + testingToken); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateUserRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/CreateUserRequestBody.java new file mode 100644 index 0000000..1a178c2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateUserRequestBody.java @@ -0,0 +1,2025 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CreateUserRequestBody { + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_id") + private JsonNullable externalId; + + /** + * The first name to assign to the user + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private JsonNullable firstName; + + /** + * The last name to assign to the user + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private JsonNullable lastName; + + /** + * Email addresses to add to the user. + * Must be unique across your instance. + * The first email address will be set as the user's primary email address. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_address") + private Optional> emailAddress; + + /** + * Phone numbers to add to the user. + * Must be unique across your instance. + * The first phone number will be set as the user's primary phone number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone_number") + private Optional> phoneNumber; + + /** + * Web3 wallets to add to the user. + * Must be unique across your instance. + * The first wallet will be set as the user's primary wallet. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("web3_wallet") + private Optional> web3Wallet; + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("username") + private JsonNullable username; + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("password") + private JsonNullable password; + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("password_digest") + private Optional passwordDigest; + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + * + * **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. + * + * The format is the following: + * `<hash>$<salt>` + * + * The value is expected to have 2 segments separated by the $ character and include the following information: + * _hash:_ The sha256 hash, a 64-length hex string. + * _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("password_hasher") + private Optional passwordHasher; + + /** + * When set to `true` all password checks are skipped. + * It is recommended to use this method only when migrating plaintext passwords to Clerk. + * Upon migration the user base should be prompted to pick stronger password. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("skip_password_checks") + private Optional skipPasswordChecks; + + /** + * When set to `true`, `password` is not required anymore when creating the user and can be omitted. + * This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + * Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("skip_password_requirement") + private Optional skipPasswordRequirement; + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totp_secret") + private Optional totpSecret; + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("backup_codes") + private Optional> backupCodes; + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unsafe_metadata") + private Optional unsafeMetadata; + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private Optional createdAt; + + @JsonCreator + public CreateUserRequestBody( + @JsonProperty("external_id") JsonNullable externalId, + @JsonProperty("first_name") JsonNullable firstName, + @JsonProperty("last_name") JsonNullable lastName, + @JsonProperty("email_address") Optional> emailAddress, + @JsonProperty("phone_number") Optional> phoneNumber, + @JsonProperty("web3_wallet") Optional> web3Wallet, + @JsonProperty("username") JsonNullable username, + @JsonProperty("password") JsonNullable password, + @JsonProperty("password_digest") Optional passwordDigest, + @JsonProperty("password_hasher") Optional passwordHasher, + @JsonProperty("skip_password_checks") Optional skipPasswordChecks, + @JsonProperty("skip_password_requirement") Optional skipPasswordRequirement, + @JsonProperty("totp_secret") Optional totpSecret, + @JsonProperty("backup_codes") Optional> backupCodes, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("unsafe_metadata") Optional unsafeMetadata, + @JsonProperty("created_at") Optional createdAt) { + Utils.checkNotNull(externalId, "externalId"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + Utils.checkNotNull(web3Wallet, "web3Wallet"); + Utils.checkNotNull(username, "username"); + Utils.checkNotNull(password, "password"); + Utils.checkNotNull(passwordDigest, "passwordDigest"); + Utils.checkNotNull(passwordHasher, "passwordHasher"); + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + Utils.checkNotNull(skipPasswordRequirement, "skipPasswordRequirement"); + Utils.checkNotNull(totpSecret, "totpSecret"); + Utils.checkNotNull(backupCodes, "backupCodes"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + Utils.checkNotNull(createdAt, "createdAt"); + this.externalId = externalId; + this.firstName = firstName; + this.lastName = lastName; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.web3Wallet = web3Wallet; + this.username = username; + this.password = password; + this.passwordDigest = passwordDigest; + this.passwordHasher = passwordHasher; + this.skipPasswordChecks = skipPasswordChecks; + this.skipPasswordRequirement = skipPasswordRequirement; + this.totpSecret = totpSecret; + this.backupCodes = backupCodes; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.unsafeMetadata = unsafeMetadata; + this.createdAt = createdAt; + } + + public CreateUserRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable externalId() { + return (JsonNullable) externalId; + } + + /** + * The first name to assign to the user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable firstName() { + return (JsonNullable) firstName; + } + + /** + * The last name to assign to the user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastName() { + return (JsonNullable) lastName; + } + + /** + * Email addresses to add to the user. + * Must be unique across your instance. + * The first email address will be set as the user's primary email address. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> emailAddress() { + return (Optional>) emailAddress; + } + + /** + * Phone numbers to add to the user. + * Must be unique across your instance. + * The first phone number will be set as the user's primary phone number. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> phoneNumber() { + return (Optional>) phoneNumber; + } + + /** + * Web3 wallets to add to the user. + * Must be unique across your instance. + * The first wallet will be set as the user's primary wallet. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> web3Wallet() { + return (Optional>) web3Wallet; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable username() { + return (JsonNullable) username; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable password() { + return (JsonNullable) password; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional passwordDigest() { + return (Optional) passwordDigest; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + * + * **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. + * + * The format is the following: + * `<hash>$<salt>` + * + * The value is expected to have 2 segments separated by the $ character and include the following information: + * _hash:_ The sha256 hash, a 64-length hex string. + * _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional passwordHasher() { + return (Optional) passwordHasher; + } + + /** + * When set to `true` all password checks are skipped. + * It is recommended to use this method only when migrating plaintext passwords to Clerk. + * Upon migration the user base should be prompted to pick stronger password. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional skipPasswordChecks() { + return (Optional) skipPasswordChecks; + } + + /** + * When set to `true`, `password` is not required anymore when creating the user and can be omitted. + * This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + * Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional skipPasswordRequirement() { + return (Optional) skipPasswordRequirement; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional totpSecret() { + return (Optional) totpSecret; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> backupCodes() { + return (Optional>) backupCodes; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unsafeMetadata() { + return (Optional) unsafeMetadata; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + public CreateUserRequestBody withExternalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + public CreateUserRequestBody withExternalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + /** + * The first name to assign to the user + */ + public CreateUserRequestBody withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + /** + * The first name to assign to the user + */ + public CreateUserRequestBody withFirstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + /** + * The last name to assign to the user + */ + public CreateUserRequestBody withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + /** + * The last name to assign to the user + */ + public CreateUserRequestBody withLastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * Email addresses to add to the user. + * Must be unique across your instance. + * The first email address will be set as the user's primary email address. + */ + public CreateUserRequestBody withEmailAddress(java.util.List emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Email addresses to add to the user. + * Must be unique across your instance. + * The first email address will be set as the user's primary email address. + */ + public CreateUserRequestBody withEmailAddress(Optional> emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Phone numbers to add to the user. + * Must be unique across your instance. + * The first phone number will be set as the user's primary phone number. + */ + public CreateUserRequestBody withPhoneNumber(java.util.List phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Phone numbers to add to the user. + * Must be unique across your instance. + * The first phone number will be set as the user's primary phone number. + */ + public CreateUserRequestBody withPhoneNumber(Optional> phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Web3 wallets to add to the user. + * Must be unique across your instance. + * The first wallet will be set as the user's primary wallet. + */ + public CreateUserRequestBody withWeb3Wallet(java.util.List web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = Optional.ofNullable(web3Wallet); + return this; + } + + /** + * Web3 wallets to add to the user. + * Must be unique across your instance. + * The first wallet will be set as the user's primary wallet. + */ + public CreateUserRequestBody withWeb3Wallet(Optional> web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + public CreateUserRequestBody withUsername(String username) { + Utils.checkNotNull(username, "username"); + this.username = JsonNullable.of(username); + return this; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + public CreateUserRequestBody withUsername(JsonNullable username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + public CreateUserRequestBody withPassword(String password) { + Utils.checkNotNull(password, "password"); + this.password = JsonNullable.of(password); + return this; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + public CreateUserRequestBody withPassword(JsonNullable password) { + Utils.checkNotNull(password, "password"); + this.password = password; + return this; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + public CreateUserRequestBody withPasswordDigest(String passwordDigest) { + Utils.checkNotNull(passwordDigest, "passwordDigest"); + this.passwordDigest = Optional.ofNullable(passwordDigest); + return this; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + public CreateUserRequestBody withPasswordDigest(Optional passwordDigest) { + Utils.checkNotNull(passwordDigest, "passwordDigest"); + this.passwordDigest = passwordDigest; + return this; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + * + * **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. + * + * The format is the following: + * `<hash>$<salt>` + * + * The value is expected to have 2 segments separated by the $ character and include the following information: + * _hash:_ The sha256 hash, a 64-length hex string. + * _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + */ + public CreateUserRequestBody withPasswordHasher(PasswordHasher passwordHasher) { + Utils.checkNotNull(passwordHasher, "passwordHasher"); + this.passwordHasher = Optional.ofNullable(passwordHasher); + return this; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + * + * **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. + * + * The format is the following: + * `<hash>$<salt>` + * + * The value is expected to have 2 segments separated by the $ character and include the following information: + * _hash:_ The sha256 hash, a 64-length hex string. + * _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + */ + public CreateUserRequestBody withPasswordHasher(Optional passwordHasher) { + Utils.checkNotNull(passwordHasher, "passwordHasher"); + this.passwordHasher = passwordHasher; + return this; + } + + /** + * When set to `true` all password checks are skipped. + * It is recommended to use this method only when migrating plaintext passwords to Clerk. + * Upon migration the user base should be prompted to pick stronger password. + */ + public CreateUserRequestBody withSkipPasswordChecks(boolean skipPasswordChecks) { + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + this.skipPasswordChecks = Optional.ofNullable(skipPasswordChecks); + return this; + } + + /** + * When set to `true` all password checks are skipped. + * It is recommended to use this method only when migrating plaintext passwords to Clerk. + * Upon migration the user base should be prompted to pick stronger password. + */ + public CreateUserRequestBody withSkipPasswordChecks(Optional skipPasswordChecks) { + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + this.skipPasswordChecks = skipPasswordChecks; + return this; + } + + /** + * When set to `true`, `password` is not required anymore when creating the user and can be omitted. + * This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + * Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + */ + public CreateUserRequestBody withSkipPasswordRequirement(boolean skipPasswordRequirement) { + Utils.checkNotNull(skipPasswordRequirement, "skipPasswordRequirement"); + this.skipPasswordRequirement = Optional.ofNullable(skipPasswordRequirement); + return this; + } + + /** + * When set to `true`, `password` is not required anymore when creating the user and can be omitted. + * This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + * Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + */ + public CreateUserRequestBody withSkipPasswordRequirement(Optional skipPasswordRequirement) { + Utils.checkNotNull(skipPasswordRequirement, "skipPasswordRequirement"); + this.skipPasswordRequirement = skipPasswordRequirement; + return this; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + public CreateUserRequestBody withTotpSecret(String totpSecret) { + Utils.checkNotNull(totpSecret, "totpSecret"); + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + public CreateUserRequestBody withTotpSecret(Optional totpSecret) { + Utils.checkNotNull(totpSecret, "totpSecret"); + this.totpSecret = totpSecret; + return this; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + public CreateUserRequestBody withBackupCodes(java.util.List backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = Optional.ofNullable(backupCodes); + return this; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + public CreateUserRequestBody withBackupCodes(Optional> backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = backupCodes; + return this; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + public CreateUserRequestBody withPublicMetadata(PublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + public CreateUserRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + public CreateUserRequestBody withPrivateMetadata(PrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + public CreateUserRequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public CreateUserRequestBody withUnsafeMetadata(UnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public CreateUserRequestBody withUnsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + public CreateUserRequestBody withCreatedAt(String createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + public CreateUserRequestBody withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUserRequestBody other = (CreateUserRequestBody) o; + return + java.util.Objects.deepEquals(this.externalId, other.externalId) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber) && + java.util.Objects.deepEquals(this.web3Wallet, other.web3Wallet) && + java.util.Objects.deepEquals(this.username, other.username) && + java.util.Objects.deepEquals(this.password, other.password) && + java.util.Objects.deepEquals(this.passwordDigest, other.passwordDigest) && + java.util.Objects.deepEquals(this.passwordHasher, other.passwordHasher) && + java.util.Objects.deepEquals(this.skipPasswordChecks, other.skipPasswordChecks) && + java.util.Objects.deepEquals(this.skipPasswordRequirement, other.skipPasswordRequirement) && + java.util.Objects.deepEquals(this.totpSecret, other.totpSecret) && + java.util.Objects.deepEquals(this.backupCodes, other.backupCodes) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.unsafeMetadata, other.unsafeMetadata) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + externalId, + firstName, + lastName, + emailAddress, + phoneNumber, + web3Wallet, + username, + password, + passwordDigest, + passwordHasher, + skipPasswordChecks, + skipPasswordRequirement, + totpSecret, + backupCodes, + publicMetadata, + privateMetadata, + unsafeMetadata, + createdAt); + } + + @Override + public String toString() { + return Utils.toString(CreateUserRequestBody.class, + "externalId", externalId, + "firstName", firstName, + "lastName", lastName, + "emailAddress", emailAddress, + "phoneNumber", phoneNumber, + "web3Wallet", web3Wallet, + "username", username, + "password", password, + "passwordDigest", passwordDigest, + "passwordHasher", passwordHasher, + "skipPasswordChecks", skipPasswordChecks, + "skipPasswordRequirement", skipPasswordRequirement, + "totpSecret", totpSecret, + "backupCodes", backupCodes, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "unsafeMetadata", unsafeMetadata, + "createdAt", createdAt); + } + + public final static class Builder { + + private JsonNullable externalId = JsonNullable.undefined(); + + private JsonNullable firstName = JsonNullable.undefined(); + + private JsonNullable lastName = JsonNullable.undefined(); + + private Optional> emailAddress = Optional.empty(); + + private Optional> phoneNumber = Optional.empty(); + + private Optional> web3Wallet = Optional.empty(); + + private JsonNullable username = JsonNullable.undefined(); + + private JsonNullable password = JsonNullable.undefined(); + + private Optional passwordDigest = Optional.empty(); + + private Optional passwordHasher = Optional.empty(); + + private Optional skipPasswordChecks = Optional.empty(); + + private Optional skipPasswordRequirement = Optional.empty(); + + private Optional totpSecret = Optional.empty(); + + private Optional> backupCodes = Optional.empty(); + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Optional unsafeMetadata = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + public Builder externalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + public Builder externalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + /** + * The first name to assign to the user + */ + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + /** + * The first name to assign to the user + */ + public Builder firstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + /** + * The last name to assign to the user + */ + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + /** + * The last name to assign to the user + */ + public Builder lastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * Email addresses to add to the user. + * Must be unique across your instance. + * The first email address will be set as the user's primary email address. + */ + public Builder emailAddress(java.util.List emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Email addresses to add to the user. + * Must be unique across your instance. + * The first email address will be set as the user's primary email address. + */ + public Builder emailAddress(Optional> emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Phone numbers to add to the user. + * Must be unique across your instance. + * The first phone number will be set as the user's primary phone number. + */ + public Builder phoneNumber(java.util.List phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Phone numbers to add to the user. + * Must be unique across your instance. + * The first phone number will be set as the user's primary phone number. + */ + public Builder phoneNumber(Optional> phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Web3 wallets to add to the user. + * Must be unique across your instance. + * The first wallet will be set as the user's primary wallet. + */ + public Builder web3Wallet(java.util.List web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = Optional.ofNullable(web3Wallet); + return this; + } + + /** + * Web3 wallets to add to the user. + * Must be unique across your instance. + * The first wallet will be set as the user's primary wallet. + */ + public Builder web3Wallet(Optional> web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + public Builder username(String username) { + Utils.checkNotNull(username, "username"); + this.username = JsonNullable.of(username); + return this; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + public Builder username(JsonNullable username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + public Builder password(String password) { + Utils.checkNotNull(password, "password"); + this.password = JsonNullable.of(password); + return this; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + public Builder password(JsonNullable password) { + Utils.checkNotNull(password, "password"); + this.password = password; + return this; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + public Builder passwordDigest(String passwordDigest) { + Utils.checkNotNull(passwordDigest, "passwordDigest"); + this.passwordDigest = Optional.ofNullable(passwordDigest); + return this; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + public Builder passwordDigest(Optional passwordDigest) { + Utils.checkNotNull(passwordDigest, "passwordDigest"); + this.passwordDigest = passwordDigest; + return this; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + * + * **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. + * + * The format is the following: + * `<hash>$<salt>` + * + * The value is expected to have 2 segments separated by the $ character and include the following information: + * _hash:_ The sha256 hash, a 64-length hex string. + * _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + */ + public Builder passwordHasher(PasswordHasher passwordHasher) { + Utils.checkNotNull(passwordHasher, "passwordHasher"); + this.passwordHasher = Optional.ofNullable(passwordHasher); + return this; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + * + * **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. + * + * The format is the following: + * `<hash>$<salt>` + * + * The value is expected to have 2 segments separated by the $ character and include the following information: + * _hash:_ The sha256 hash, a 64-length hex string. + * _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + */ + public Builder passwordHasher(Optional passwordHasher) { + Utils.checkNotNull(passwordHasher, "passwordHasher"); + this.passwordHasher = passwordHasher; + return this; + } + + /** + * When set to `true` all password checks are skipped. + * It is recommended to use this method only when migrating plaintext passwords to Clerk. + * Upon migration the user base should be prompted to pick stronger password. + */ + public Builder skipPasswordChecks(boolean skipPasswordChecks) { + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + this.skipPasswordChecks = Optional.ofNullable(skipPasswordChecks); + return this; + } + + /** + * When set to `true` all password checks are skipped. + * It is recommended to use this method only when migrating plaintext passwords to Clerk. + * Upon migration the user base should be prompted to pick stronger password. + */ + public Builder skipPasswordChecks(Optional skipPasswordChecks) { + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + this.skipPasswordChecks = skipPasswordChecks; + return this; + } + + /** + * When set to `true`, `password` is not required anymore when creating the user and can be omitted. + * This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + * Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + */ + public Builder skipPasswordRequirement(boolean skipPasswordRequirement) { + Utils.checkNotNull(skipPasswordRequirement, "skipPasswordRequirement"); + this.skipPasswordRequirement = Optional.ofNullable(skipPasswordRequirement); + return this; + } + + /** + * When set to `true`, `password` is not required anymore when creating the user and can be omitted. + * This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + * Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + */ + public Builder skipPasswordRequirement(Optional skipPasswordRequirement) { + Utils.checkNotNull(skipPasswordRequirement, "skipPasswordRequirement"); + this.skipPasswordRequirement = skipPasswordRequirement; + return this; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + public Builder totpSecret(String totpSecret) { + Utils.checkNotNull(totpSecret, "totpSecret"); + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + public Builder totpSecret(Optional totpSecret) { + Utils.checkNotNull(totpSecret, "totpSecret"); + this.totpSecret = totpSecret; + return this; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + public Builder backupCodes(java.util.List backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = Optional.ofNullable(backupCodes); + return this; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + public Builder backupCodes(Optional> backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = backupCodes; + return this; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + public Builder publicMetadata(PublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + public Builder privateMetadata(PrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public Builder unsafeMetadata(UnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public Builder unsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + public Builder createdAt(String createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public CreateUserRequestBody build() { + return new CreateUserRequestBody( + externalId, + firstName, + lastName, + emailAddress, + phoneNumber, + web3Wallet, + username, + password, + passwordDigest, + passwordHasher, + skipPasswordChecks, + skipPasswordRequirement, + totpSecret, + backupCodes, + publicMetadata, + privateMetadata, + unsafeMetadata, + createdAt); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateUserRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/CreateUserRequestBuilder.java new file mode 100644 index 0000000..3369e0c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateUserRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateUserRequestBuilder { + + private CreateUserRequestBody request; + private final SDKMethodInterfaces.MethodCallCreateUser sdk; + + public CreateUserRequestBuilder(SDKMethodInterfaces.MethodCallCreateUser sdk) { + this.sdk = sdk; + } + + public CreateUserRequestBuilder request(CreateUserRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateUserResponse call() throws Exception { + + return sdk.create( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateUserResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateUserResponse.java new file mode 100644 index 0000000..95db2c1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateUserResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class CreateUserResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public CreateUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public CreateUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public CreateUserResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateUserResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateUserResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public CreateUserResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public CreateUserResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUserResponse other = (CreateUserResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(CreateUserResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public CreateUserResponse build() { + return new CreateUserResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierRequest.java new file mode 100644 index 0000000..a648ad1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteAllowlistIdentifierRequest { + + /** + * The ID of the identifier to delete from the allow-list + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=identifier_id") + private String identifierId; + + @JsonCreator + public DeleteAllowlistIdentifierRequest( + String identifierId) { + Utils.checkNotNull(identifierId, "identifierId"); + this.identifierId = identifierId; + } + + /** + * The ID of the identifier to delete from the allow-list + */ + @JsonIgnore + public String identifierId() { + return identifierId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the identifier to delete from the allow-list + */ + public DeleteAllowlistIdentifierRequest withIdentifierId(String identifierId) { + Utils.checkNotNull(identifierId, "identifierId"); + this.identifierId = identifierId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAllowlistIdentifierRequest other = (DeleteAllowlistIdentifierRequest) o; + return + java.util.Objects.deepEquals(this.identifierId, other.identifierId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + identifierId); + } + + @Override + public String toString() { + return Utils.toString(DeleteAllowlistIdentifierRequest.class, + "identifierId", identifierId); + } + + public final static class Builder { + + private String identifierId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the identifier to delete from the allow-list + */ + public Builder identifierId(String identifierId) { + Utils.checkNotNull(identifierId, "identifierId"); + this.identifierId = identifierId; + return this; + } + + public DeleteAllowlistIdentifierRequest build() { + return new DeleteAllowlistIdentifierRequest( + identifierId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierRequestBuilder.java new file mode 100644 index 0000000..82da05f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteAllowlistIdentifierRequestBuilder { + + private String identifierId; + private final SDKMethodInterfaces.MethodCallDeleteAllowlistIdentifier sdk; + + public DeleteAllowlistIdentifierRequestBuilder(SDKMethodInterfaces.MethodCallDeleteAllowlistIdentifier sdk) { + this.sdk = sdk; + } + + public DeleteAllowlistIdentifierRequestBuilder identifierId(String identifierId) { + Utils.checkNotNull(identifierId, "identifierId"); + this.identifierId = identifierId; + return this; + } + + public DeleteAllowlistIdentifierResponse call() throws Exception { + + return sdk.delete( + identifierId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierResponse.java new file mode 100644 index 0000000..97f6de9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteAllowlistIdentifierResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteAllowlistIdentifierResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteAllowlistIdentifierResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteAllowlistIdentifierResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteAllowlistIdentifierResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteAllowlistIdentifierResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteAllowlistIdentifierResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteAllowlistIdentifierResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteAllowlistIdentifierResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAllowlistIdentifierResponse other = (DeleteAllowlistIdentifierResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteAllowlistIdentifierResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteAllowlistIdentifierResponse build() { + return new DeleteAllowlistIdentifierResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierRequest.java new file mode 100644 index 0000000..38c8c50 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteBlocklistIdentifierRequest { + + /** + * The ID of the identifier to delete from the block-list + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=identifier_id") + private String identifierId; + + @JsonCreator + public DeleteBlocklistIdentifierRequest( + String identifierId) { + Utils.checkNotNull(identifierId, "identifierId"); + this.identifierId = identifierId; + } + + /** + * The ID of the identifier to delete from the block-list + */ + @JsonIgnore + public String identifierId() { + return identifierId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the identifier to delete from the block-list + */ + public DeleteBlocklistIdentifierRequest withIdentifierId(String identifierId) { + Utils.checkNotNull(identifierId, "identifierId"); + this.identifierId = identifierId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteBlocklistIdentifierRequest other = (DeleteBlocklistIdentifierRequest) o; + return + java.util.Objects.deepEquals(this.identifierId, other.identifierId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + identifierId); + } + + @Override + public String toString() { + return Utils.toString(DeleteBlocklistIdentifierRequest.class, + "identifierId", identifierId); + } + + public final static class Builder { + + private String identifierId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the identifier to delete from the block-list + */ + public Builder identifierId(String identifierId) { + Utils.checkNotNull(identifierId, "identifierId"); + this.identifierId = identifierId; + return this; + } + + public DeleteBlocklistIdentifierRequest build() { + return new DeleteBlocklistIdentifierRequest( + identifierId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierRequestBuilder.java new file mode 100644 index 0000000..05515b6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteBlocklistIdentifierRequestBuilder { + + private String identifierId; + private final SDKMethodInterfaces.MethodCallDeleteBlocklistIdentifier sdk; + + public DeleteBlocklistIdentifierRequestBuilder(SDKMethodInterfaces.MethodCallDeleteBlocklistIdentifier sdk) { + this.sdk = sdk; + } + + public DeleteBlocklistIdentifierRequestBuilder identifierId(String identifierId) { + Utils.checkNotNull(identifierId, "identifierId"); + this.identifierId = identifierId; + return this; + } + + public DeleteBlocklistIdentifierResponse call() throws Exception { + + return sdk.delete( + identifierId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierResponse.java new file mode 100644 index 0000000..7d8012a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteBlocklistIdentifierResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteBlocklistIdentifierResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteBlocklistIdentifierResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteBlocklistIdentifierResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteBlocklistIdentifierResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteBlocklistIdentifierResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteBlocklistIdentifierResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteBlocklistIdentifierResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteBlocklistIdentifierResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteBlocklistIdentifierResponse other = (DeleteBlocklistIdentifierResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteBlocklistIdentifierResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteBlocklistIdentifierResponse build() { + return new DeleteBlocklistIdentifierResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainRequest.java new file mode 100644 index 0000000..49554b3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteDomainRequest { + + /** + * The ID of the domain that will be deleted. Must be a satellite domain. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=domain_id") + private String domainId; + + @JsonCreator + public DeleteDomainRequest( + String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + } + + /** + * The ID of the domain that will be deleted. Must be a satellite domain. + */ + @JsonIgnore + public String domainId() { + return domainId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the domain that will be deleted. Must be a satellite domain. + */ + public DeleteDomainRequest withDomainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteDomainRequest other = (DeleteDomainRequest) o; + return + java.util.Objects.deepEquals(this.domainId, other.domainId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + domainId); + } + + @Override + public String toString() { + return Utils.toString(DeleteDomainRequest.class, + "domainId", domainId); + } + + public final static class Builder { + + private String domainId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the domain that will be deleted. Must be a satellite domain. + */ + public Builder domainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + public DeleteDomainRequest build() { + return new DeleteDomainRequest( + domainId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainRequestBuilder.java new file mode 100644 index 0000000..a5c5385 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteDomainRequestBuilder { + + private String domainId; + private final SDKMethodInterfaces.MethodCallDeleteDomain sdk; + + public DeleteDomainRequestBuilder(SDKMethodInterfaces.MethodCallDeleteDomain sdk) { + this.sdk = sdk; + } + + public DeleteDomainRequestBuilder domainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + public DeleteDomainResponse call() throws Exception { + + return sdk.delete( + domainId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainResponse.java new file mode 100644 index 0000000..baabe9f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteDomainResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteDomainResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteDomainResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteDomainResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteDomainResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteDomainResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteDomainResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteDomainResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteDomainResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteDomainResponse other = (DeleteDomainResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteDomainResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteDomainResponse build() { + return new DeleteDomainResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressRequest.java new file mode 100644 index 0000000..151475c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteEmailAddressRequest { + + /** + * The ID of the email address to delete + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=email_address_id") + private String emailAddressId; + + @JsonCreator + public DeleteEmailAddressRequest( + String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + } + + /** + * The ID of the email address to delete + */ + @JsonIgnore + public String emailAddressId() { + return emailAddressId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the email address to delete + */ + public DeleteEmailAddressRequest withEmailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteEmailAddressRequest other = (DeleteEmailAddressRequest) o; + return + java.util.Objects.deepEquals(this.emailAddressId, other.emailAddressId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + emailAddressId); + } + + @Override + public String toString() { + return Utils.toString(DeleteEmailAddressRequest.class, + "emailAddressId", emailAddressId); + } + + public final static class Builder { + + private String emailAddressId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the email address to delete + */ + public Builder emailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + public DeleteEmailAddressRequest build() { + return new DeleteEmailAddressRequest( + emailAddressId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressRequestBuilder.java new file mode 100644 index 0000000..d62a321 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteEmailAddressRequestBuilder { + + private String emailAddressId; + private final SDKMethodInterfaces.MethodCallDeleteEmailAddress sdk; + + public DeleteEmailAddressRequestBuilder(SDKMethodInterfaces.MethodCallDeleteEmailAddress sdk) { + this.sdk = sdk; + } + + public DeleteEmailAddressRequestBuilder emailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + public DeleteEmailAddressResponse call() throws Exception { + + return sdk.delete( + emailAddressId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressResponse.java new file mode 100644 index 0000000..dc745ff --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteEmailAddressResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteEmailAddressResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteEmailAddressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteEmailAddressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteEmailAddressResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteEmailAddressResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteEmailAddressResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteEmailAddressResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteEmailAddressResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteEmailAddressResponse other = (DeleteEmailAddressResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteEmailAddressResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteEmailAddressResponse build() { + return new DeleteEmailAddressResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateRequest.java new file mode 100644 index 0000000..fb232bd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteJWTTemplateRequest { + + /** + * JWT Template ID + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_id") + private String templateId; + + @JsonCreator + public DeleteJWTTemplateRequest( + String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + } + + /** + * JWT Template ID + */ + @JsonIgnore + public String templateId() { + return templateId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * JWT Template ID + */ + public DeleteJWTTemplateRequest withTemplateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteJWTTemplateRequest other = (DeleteJWTTemplateRequest) o; + return + java.util.Objects.deepEquals(this.templateId, other.templateId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateId); + } + + @Override + public String toString() { + return Utils.toString(DeleteJWTTemplateRequest.class, + "templateId", templateId); + } + + public final static class Builder { + + private String templateId; + + private Builder() { + // force use of static builder() method + } + + /** + * JWT Template ID + */ + public Builder templateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + public DeleteJWTTemplateRequest build() { + return new DeleteJWTTemplateRequest( + templateId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateRequestBuilder.java new file mode 100644 index 0000000..95cd2b4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteJWTTemplateRequestBuilder { + + private String templateId; + private final SDKMethodInterfaces.MethodCallDeleteJWTTemplate sdk; + + public DeleteJWTTemplateRequestBuilder(SDKMethodInterfaces.MethodCallDeleteJWTTemplate sdk) { + this.sdk = sdk; + } + + public DeleteJWTTemplateRequestBuilder templateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + public DeleteJWTTemplateResponse call() throws Exception { + + return sdk.delete( + templateId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateResponse.java new file mode 100644 index 0000000..5dcfb5b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteJWTTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteJWTTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteJWTTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteJWTTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteJWTTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteJWTTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteJWTTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteJWTTemplateResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteJWTTemplateResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteJWTTemplateResponse other = (DeleteJWTTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteJWTTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteJWTTemplateResponse build() { + return new DeleteJWTTemplateResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationRequest.java new file mode 100644 index 0000000..ea7f319 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteOAuthApplicationRequest { + + /** + * The ID of the OAuth application to delete + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=oauth_application_id") + private String oauthApplicationId; + + @JsonCreator + public DeleteOAuthApplicationRequest( + String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + } + + /** + * The ID of the OAuth application to delete + */ + @JsonIgnore + public String oauthApplicationId() { + return oauthApplicationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the OAuth application to delete + */ + public DeleteOAuthApplicationRequest withOauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteOAuthApplicationRequest other = (DeleteOAuthApplicationRequest) o; + return + java.util.Objects.deepEquals(this.oauthApplicationId, other.oauthApplicationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + oauthApplicationId); + } + + @Override + public String toString() { + return Utils.toString(DeleteOAuthApplicationRequest.class, + "oauthApplicationId", oauthApplicationId); + } + + public final static class Builder { + + private String oauthApplicationId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the OAuth application to delete + */ + public Builder oauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public DeleteOAuthApplicationRequest build() { + return new DeleteOAuthApplicationRequest( + oauthApplicationId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationRequestBuilder.java new file mode 100644 index 0000000..82f412e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteOAuthApplicationRequestBuilder { + + private String oauthApplicationId; + private final SDKMethodInterfaces.MethodCallDeleteOAuthApplication sdk; + + public DeleteOAuthApplicationRequestBuilder(SDKMethodInterfaces.MethodCallDeleteOAuthApplication sdk) { + this.sdk = sdk; + } + + public DeleteOAuthApplicationRequestBuilder oauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public DeleteOAuthApplicationResponse call() throws Exception { + + return sdk.delete( + oauthApplicationId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationResponse.java new file mode 100644 index 0000000..a7392ab --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOAuthApplicationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteOAuthApplicationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteOAuthApplicationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteOAuthApplicationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteOAuthApplicationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteOAuthApplicationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteOAuthApplicationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteOAuthApplicationResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteOAuthApplicationResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteOAuthApplicationResponse other = (DeleteOAuthApplicationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteOAuthApplicationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteOAuthApplicationResponse build() { + return new DeleteOAuthApplicationResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoRequest.java new file mode 100644 index 0000000..32d3a50 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteOrganizationLogoRequest { + + /** + * The ID of the organization for which the logo will be deleted. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @JsonCreator + public DeleteOrganizationLogoRequest( + String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + } + + /** + * The ID of the organization for which the logo will be deleted. + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization for which the logo will be deleted. + */ + public DeleteOrganizationLogoRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteOrganizationLogoRequest other = (DeleteOrganizationLogoRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId); + } + + @Override + public String toString() { + return Utils.toString(DeleteOrganizationLogoRequest.class, + "organizationId", organizationId); + } + + public final static class Builder { + + private String organizationId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization for which the logo will be deleted. + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public DeleteOrganizationLogoRequest build() { + return new DeleteOrganizationLogoRequest( + organizationId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoRequestBuilder.java new file mode 100644 index 0000000..2b04430 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteOrganizationLogoRequestBuilder { + + private String organizationId; + private final SDKMethodInterfaces.MethodCallDeleteOrganizationLogo sdk; + + public DeleteOrganizationLogoRequestBuilder(SDKMethodInterfaces.MethodCallDeleteOrganizationLogo sdk) { + this.sdk = sdk; + } + + public DeleteOrganizationLogoRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public DeleteOrganizationLogoResponse call() throws Exception { + + return sdk.deleteLogo( + organizationId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoResponse.java new file mode 100644 index 0000000..e821df7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationLogoResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteOrganizationLogoResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization + */ + private Optional organization; + + @JsonCreator + public DeleteOrganizationLogoResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organization) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organization, "organization"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organization = organization; + } + + public DeleteOrganizationLogoResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organization() { + return (Optional) organization; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteOrganizationLogoResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteOrganizationLogoResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteOrganizationLogoResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public DeleteOrganizationLogoResponse withOrganization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public DeleteOrganizationLogoResponse withOrganization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteOrganizationLogoResponse other = (DeleteOrganizationLogoResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organization, other.organization); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organization); + } + + @Override + public String toString() { + return Utils.toString(DeleteOrganizationLogoResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organization", organization); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organization = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public Builder organization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public Builder organization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + public DeleteOrganizationLogoResponse build() { + return new DeleteOrganizationLogoResponse( + contentType, + statusCode, + rawResponse, + organization); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipRequest.java new file mode 100644 index 0000000..1b57b85 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipRequest.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteOrganizationMembershipRequest { + + /** + * The ID of the organization the membership belongs to + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + /** + * The ID of the user that this membership belongs to + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public DeleteOrganizationMembershipRequest( + String organizationId, + String userId) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(userId, "userId"); + this.organizationId = organizationId; + this.userId = userId; + } + + /** + * The ID of the organization the membership belongs to + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + /** + * The ID of the user that this membership belongs to + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization the membership belongs to + */ + public DeleteOrganizationMembershipRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The ID of the user that this membership belongs to + */ + public DeleteOrganizationMembershipRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteOrganizationMembershipRequest other = (DeleteOrganizationMembershipRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + userId); + } + + @Override + public String toString() { + return Utils.toString(DeleteOrganizationMembershipRequest.class, + "organizationId", organizationId, + "userId", userId); + } + + public final static class Builder { + + private String organizationId; + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization the membership belongs to + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The ID of the user that this membership belongs to + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DeleteOrganizationMembershipRequest build() { + return new DeleteOrganizationMembershipRequest( + organizationId, + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipRequestBuilder.java new file mode 100644 index 0000000..b3deb9c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteOrganizationMembershipRequestBuilder { + + private String organizationId; + private String userId; + private final SDKMethodInterfaces.MethodCallDeleteOrganizationMembership sdk; + + public DeleteOrganizationMembershipRequestBuilder(SDKMethodInterfaces.MethodCallDeleteOrganizationMembership sdk) { + this.sdk = sdk; + } + + public DeleteOrganizationMembershipRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public DeleteOrganizationMembershipRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DeleteOrganizationMembershipResponse call() throws Exception { + + return sdk.delete( + organizationId, + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipResponse.java new file mode 100644 index 0000000..d3854af --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationMembershipResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteOrganizationMembershipResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional organizationMembership; + + @JsonCreator + public DeleteOrganizationMembershipResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationMembership) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationMembership = organizationMembership; + } + + public DeleteOrganizationMembershipResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationMembership() { + return (Optional) organizationMembership; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteOrganizationMembershipResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteOrganizationMembershipResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteOrganizationMembershipResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public DeleteOrganizationMembershipResponse withOrganizationMembership(com.clerk.backend_api.models.components.OrganizationMembership organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = Optional.ofNullable(organizationMembership); + return this; + } + + /** + * Success + */ + public DeleteOrganizationMembershipResponse withOrganizationMembership(Optional organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = organizationMembership; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteOrganizationMembershipResponse other = (DeleteOrganizationMembershipResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationMembership, other.organizationMembership); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationMembership); + } + + @Override + public String toString() { + return Utils.toString(DeleteOrganizationMembershipResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationMembership", organizationMembership); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationMembership = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder organizationMembership(com.clerk.backend_api.models.components.OrganizationMembership organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = Optional.ofNullable(organizationMembership); + return this; + } + + /** + * Success + */ + public Builder organizationMembership(Optional organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = organizationMembership; + return this; + } + + public DeleteOrganizationMembershipResponse build() { + return new DeleteOrganizationMembershipResponse( + contentType, + statusCode, + rawResponse, + organizationMembership); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationRequest.java new file mode 100644 index 0000000..6515c85 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteOrganizationRequest { + + /** + * The ID of the organization to delete + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @JsonCreator + public DeleteOrganizationRequest( + String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + } + + /** + * The ID of the organization to delete + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization to delete + */ + public DeleteOrganizationRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteOrganizationRequest other = (DeleteOrganizationRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId); + } + + @Override + public String toString() { + return Utils.toString(DeleteOrganizationRequest.class, + "organizationId", organizationId); + } + + public final static class Builder { + + private String organizationId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization to delete + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public DeleteOrganizationRequest build() { + return new DeleteOrganizationRequest( + organizationId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationRequestBuilder.java new file mode 100644 index 0000000..897a88f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteOrganizationRequestBuilder { + + private String organizationId; + private final SDKMethodInterfaces.MethodCallDeleteOrganization sdk; + + public DeleteOrganizationRequestBuilder(SDKMethodInterfaces.MethodCallDeleteOrganization sdk) { + this.sdk = sdk; + } + + public DeleteOrganizationRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public DeleteOrganizationResponse call() throws Exception { + + return sdk.delete( + organizationId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationResponse.java new file mode 100644 index 0000000..fcd292c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteOrganizationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteOrganizationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteOrganizationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteOrganizationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteOrganizationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteOrganizationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteOrganizationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteOrganizationResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteOrganizationResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteOrganizationResponse other = (DeleteOrganizationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteOrganizationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteOrganizationResponse build() { + return new DeleteOrganizationResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberRequest.java new file mode 100644 index 0000000..d4bb0ee --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeletePhoneNumberRequest { + + /** + * The ID of the phone number to delete + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=phone_number_id") + private String phoneNumberId; + + @JsonCreator + public DeletePhoneNumberRequest( + String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + } + + /** + * The ID of the phone number to delete + */ + @JsonIgnore + public String phoneNumberId() { + return phoneNumberId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the phone number to delete + */ + public DeletePhoneNumberRequest withPhoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletePhoneNumberRequest other = (DeletePhoneNumberRequest) o; + return + java.util.Objects.deepEquals(this.phoneNumberId, other.phoneNumberId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + phoneNumberId); + } + + @Override + public String toString() { + return Utils.toString(DeletePhoneNumberRequest.class, + "phoneNumberId", phoneNumberId); + } + + public final static class Builder { + + private String phoneNumberId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the phone number to delete + */ + public Builder phoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + public DeletePhoneNumberRequest build() { + return new DeletePhoneNumberRequest( + phoneNumberId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberRequestBuilder.java new file mode 100644 index 0000000..bf8c6b5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeletePhoneNumberRequestBuilder { + + private String phoneNumberId; + private final SDKMethodInterfaces.MethodCallDeletePhoneNumber sdk; + + public DeletePhoneNumberRequestBuilder(SDKMethodInterfaces.MethodCallDeletePhoneNumber sdk) { + this.sdk = sdk; + } + + public DeletePhoneNumberRequestBuilder phoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + public DeletePhoneNumberResponse call() throws Exception { + + return sdk.delete( + phoneNumberId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberResponse.java new file mode 100644 index 0000000..ab08341 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeletePhoneNumberResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeletePhoneNumberResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeletePhoneNumberResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeletePhoneNumberResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeletePhoneNumberResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeletePhoneNumberResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeletePhoneNumberResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeletePhoneNumberResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeletePhoneNumberResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletePhoneNumberResponse other = (DeletePhoneNumberResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeletePhoneNumberResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeletePhoneNumberResponse build() { + return new DeletePhoneNumberResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLRequest.java new file mode 100644 index 0000000..30c40a5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteRedirectURLRequest { + + /** + * The ID of the redirect URL + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + @JsonCreator + public DeleteRedirectURLRequest( + String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + } + + /** + * The ID of the redirect URL + */ + @JsonIgnore + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the redirect URL + */ + public DeleteRedirectURLRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteRedirectURLRequest other = (DeleteRedirectURLRequest) o; + return + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id); + } + + @Override + public String toString() { + return Utils.toString(DeleteRedirectURLRequest.class, + "id", id); + } + + public final static class Builder { + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the redirect URL + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public DeleteRedirectURLRequest build() { + return new DeleteRedirectURLRequest( + id); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLRequestBuilder.java new file mode 100644 index 0000000..5eded07 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteRedirectURLRequestBuilder { + + private String id; + private final SDKMethodInterfaces.MethodCallDeleteRedirectURL sdk; + + public DeleteRedirectURLRequestBuilder(SDKMethodInterfaces.MethodCallDeleteRedirectURL sdk) { + this.sdk = sdk; + } + + public DeleteRedirectURLRequestBuilder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public DeleteRedirectURLResponse call() throws Exception { + + return sdk.delete( + id); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLResponse.java new file mode 100644 index 0000000..5734d53 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteRedirectURLResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteRedirectURLResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteRedirectURLResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteRedirectURLResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteRedirectURLResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteRedirectURLResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteRedirectURLResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteRedirectURLResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteRedirectURLResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteRedirectURLResponse other = (DeleteRedirectURLResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteRedirectURLResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteRedirectURLResponse build() { + return new DeleteRedirectURLResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionRequest.java new file mode 100644 index 0000000..cff83c4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteSAMLConnectionRequest { + + /** + * The ID of the SAML Connection to delete + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=saml_connection_id") + private String samlConnectionId; + + @JsonCreator + public DeleteSAMLConnectionRequest( + String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + } + + /** + * The ID of the SAML Connection to delete + */ + @JsonIgnore + public String samlConnectionId() { + return samlConnectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the SAML Connection to delete + */ + public DeleteSAMLConnectionRequest withSamlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteSAMLConnectionRequest other = (DeleteSAMLConnectionRequest) o; + return + java.util.Objects.deepEquals(this.samlConnectionId, other.samlConnectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + samlConnectionId); + } + + @Override + public String toString() { + return Utils.toString(DeleteSAMLConnectionRequest.class, + "samlConnectionId", samlConnectionId); + } + + public final static class Builder { + + private String samlConnectionId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the SAML Connection to delete + */ + public Builder samlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + public DeleteSAMLConnectionRequest build() { + return new DeleteSAMLConnectionRequest( + samlConnectionId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionRequestBuilder.java new file mode 100644 index 0000000..4aade63 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteSAMLConnectionRequestBuilder { + + private String samlConnectionId; + private final SDKMethodInterfaces.MethodCallDeleteSAMLConnection sdk; + + public DeleteSAMLConnectionRequestBuilder(SDKMethodInterfaces.MethodCallDeleteSAMLConnection sdk) { + this.sdk = sdk; + } + + public DeleteSAMLConnectionRequestBuilder samlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + public DeleteSAMLConnectionResponse call() throws Exception { + + return sdk.delete( + samlConnectionId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionResponse.java new file mode 100644 index 0000000..1db11db --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteSAMLConnectionResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteSAMLConnectionResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteSAMLConnectionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteSAMLConnectionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteSAMLConnectionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteSAMLConnectionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteSAMLConnectionResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteSAMLConnectionResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteSAMLConnectionResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteSAMLConnectionResponse other = (DeleteSAMLConnectionResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteSAMLConnectionResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteSAMLConnectionResponse build() { + return new DeleteSAMLConnectionResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteSvixAppRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteSvixAppRequestBuilder.java new file mode 100644 index 0000000..ad3f5f2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteSvixAppRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteSvixAppRequestBuilder { + + private final SDKMethodInterfaces.MethodCallDeleteSvixApp sdk; + + public DeleteSvixAppRequestBuilder(SDKMethodInterfaces.MethodCallDeleteSvixApp sdk) { + this.sdk = sdk; + } + + public DeleteSvixAppResponse call() throws Exception { + + return sdk.deleteSvixAppDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteSvixAppResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteSvixAppResponse.java new file mode 100644 index 0000000..ff6370f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteSvixAppResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; + +public class DeleteSvixAppResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public DeleteSvixAppResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteSvixAppResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteSvixAppResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteSvixAppResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteSvixAppResponse other = (DeleteSvixAppResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteSvixAppResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeleteSvixAppResponse build() { + return new DeleteSvixAppResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageRequest.java new file mode 100644 index 0000000..d026539 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteUserProfileImageRequest { + + /** + * The ID of the user to delete the profile image for + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public DeleteUserProfileImageRequest( + String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + /** + * The ID of the user to delete the profile image for + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to delete the profile image for + */ + public DeleteUserProfileImageRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUserProfileImageRequest other = (DeleteUserProfileImageRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(DeleteUserProfileImageRequest.class, + "userId", userId); + } + + public final static class Builder { + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to delete the profile image for + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DeleteUserProfileImageRequest build() { + return new DeleteUserProfileImageRequest( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageRequestBuilder.java new file mode 100644 index 0000000..46f0d43 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteUserProfileImageRequestBuilder { + + private String userId; + private final SDKMethodInterfaces.MethodCallDeleteUserProfileImage sdk; + + public DeleteUserProfileImageRequestBuilder(SDKMethodInterfaces.MethodCallDeleteUserProfileImage sdk) { + this.sdk = sdk; + } + + public DeleteUserProfileImageRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DeleteUserProfileImageResponse call() throws Exception { + + return sdk.deleteProfileImage( + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageResponse.java new file mode 100644 index 0000000..7755a58 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserProfileImageResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteUserProfileImageResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public DeleteUserProfileImageResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public DeleteUserProfileImageResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteUserProfileImageResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteUserProfileImageResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteUserProfileImageResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public DeleteUserProfileImageResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public DeleteUserProfileImageResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUserProfileImageResponse other = (DeleteUserProfileImageResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(DeleteUserProfileImageResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public DeleteUserProfileImageResponse build() { + return new DeleteUserProfileImageResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteUserRequest.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserRequest.java new file mode 100644 index 0000000..5acbbee --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DeleteUserRequest { + + /** + * The ID of the user to delete + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public DeleteUserRequest( + String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + /** + * The ID of the user to delete + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to delete + */ + public DeleteUserRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUserRequest other = (DeleteUserRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(DeleteUserRequest.class, + "userId", userId); + } + + public final static class Builder { + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to delete + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DeleteUserRequest build() { + return new DeleteUserRequest( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteUserRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserRequestBuilder.java new file mode 100644 index 0000000..178aa36 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DeleteUserRequestBuilder { + + private String userId; + private final SDKMethodInterfaces.MethodCallDeleteUser sdk; + + public DeleteUserRequestBuilder(SDKMethodInterfaces.MethodCallDeleteUser sdk) { + this.sdk = sdk; + } + + public DeleteUserRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DeleteUserResponse call() throws Exception { + + return sdk.delete( + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DeleteUserResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserResponse.java new file mode 100644 index 0000000..e7eea03 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DeleteUserResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DeleteUserResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Deleted Object + */ + private Optional deletedObject; + + @JsonCreator + public DeleteUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deletedObject) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deletedObject, "deletedObject"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deletedObject = deletedObject; + } + + public DeleteUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Deleted Object + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deletedObject() { + return (Optional) deletedObject; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteUserResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteUserResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteUserResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public DeleteUserResponse withDeletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public DeleteUserResponse withDeletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUserResponse other = (DeleteUserResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.deletedObject, other.deletedObject); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + deletedObject); + } + + @Override + public String toString() { + return Utils.toString(DeleteUserResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deletedObject", deletedObject); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deletedObject = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(com.clerk.backend_api.models.components.DeletedObject deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = Optional.ofNullable(deletedObject); + return this; + } + + /** + * Deleted Object + */ + public Builder deletedObject(Optional deletedObject) { + Utils.checkNotNull(deletedObject, "deletedObject"); + this.deletedObject = deletedObject; + return this; + } + + public DeleteUserResponse build() { + return new DeleteUserResponse( + contentType, + statusCode, + rawResponse, + deletedObject); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DisableMFARequest.java b/src/main/java/com/clerk/backend_api/models/operations/DisableMFARequest.java new file mode 100644 index 0000000..aed3528 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DisableMFARequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class DisableMFARequest { + + /** + * The ID of the user whose MFA methods are to be disabled + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public DisableMFARequest( + String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + /** + * The ID of the user whose MFA methods are to be disabled + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user whose MFA methods are to be disabled + */ + public DisableMFARequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisableMFARequest other = (DisableMFARequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(DisableMFARequest.class, + "userId", userId); + } + + public final static class Builder { + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user whose MFA methods are to be disabled + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DisableMFARequest build() { + return new DisableMFARequest( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DisableMFARequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/DisableMFARequestBuilder.java new file mode 100644 index 0000000..b458345 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DisableMFARequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DisableMFARequestBuilder { + + private String userId; + private final SDKMethodInterfaces.MethodCallDisableMFA sdk; + + public DisableMFARequestBuilder(SDKMethodInterfaces.MethodCallDisableMFA sdk) { + this.sdk = sdk; + } + + public DisableMFARequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DisableMFAResponse call() throws Exception { + + return sdk.disableMFA( + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/DisableMFAResponse.java b/src/main/java/com/clerk/backend_api/models/operations/DisableMFAResponse.java new file mode 100644 index 0000000..6af7c12 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DisableMFAResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class DisableMFAResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful operation. + */ + private Optional object; + + @JsonCreator + public DisableMFAResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public DisableMFAResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful operation. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DisableMFAResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DisableMFAResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DisableMFAResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful operation. + */ + public DisableMFAResponse withObject(DisableMFAResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Successful operation. + */ + public DisableMFAResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisableMFAResponse other = (DisableMFAResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(DisableMFAResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful operation. + */ + public Builder object(DisableMFAResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Successful operation. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public DisableMFAResponse build() { + return new DisableMFAResponse( + contentType, + statusCode, + rawResponse, + object); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/DisableMFAResponseBody.java b/src/main/java/com/clerk/backend_api/models/operations/DisableMFAResponseBody.java new file mode 100644 index 0000000..88e753e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/DisableMFAResponseBody.java @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * DisableMFAResponseBody - Successful operation. + */ + +public class DisableMFAResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("user_id") + private Optional userId; + + @JsonCreator + public DisableMFAResponseBody( + @JsonProperty("user_id") Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + public DisableMFAResponseBody() { + this(Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + public final static Builder builder() { + return new Builder(); + } + + public DisableMFAResponseBody withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public DisableMFAResponseBody withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisableMFAResponseBody other = (DisableMFAResponseBody) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(DisableMFAResponseBody.class, + "userId", userId); + } + + public final static class Builder { + + private Optional userId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public DisableMFAResponseBody build() { + return new DisableMFAResponseBody( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/File.java b/src/main/java/com/clerk/backend_api/models/operations/File.java new file mode 100644 index 0000000..6d06475 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/File.java @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class File { + + @SpeakeasyMetadata("multipartForm:name=file") + private String fileName; + + @SpeakeasyMetadata("multipartForm:content") + private byte[] content; + + @JsonCreator + public File( + String fileName, + byte[] content) { + Utils.checkNotNull(fileName, "fileName"); + Utils.checkNotNull(content, "content"); + this.fileName = fileName; + this.content = content; + } + + @JsonIgnore + public String fileName() { + return fileName; + } + + @JsonIgnore + public byte[] content() { + return content; + } + + public final static Builder builder() { + return new Builder(); + } + + public File withFileName(String fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = fileName; + return this; + } + + public File withContent(byte[] content) { + Utils.checkNotNull(content, "content"); + this.content = content; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + File other = (File) o; + return + java.util.Objects.deepEquals(this.fileName, other.fileName) && + java.util.Objects.deepEquals(this.content, other.content); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + fileName, + content); + } + + @Override + public String toString() { + return Utils.toString(File.class, + "fileName", fileName, + "content", content); + } + + public final static class Builder { + + private String fileName; + + private byte[] content; + + private Builder() { + // force use of static builder() method + } + + public Builder fileName(String fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = fileName; + return this; + } + + public Builder content(byte[] content) { + Utils.checkNotNull(content, "content"); + this.content = content; + return this; + } + + public File build() { + return new File( + fileName, + content); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GenerateSvixAuthURLRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GenerateSvixAuthURLRequestBuilder.java new file mode 100644 index 0000000..d7b4874 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GenerateSvixAuthURLRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GenerateSvixAuthURLRequestBuilder { + + private final SDKMethodInterfaces.MethodCallGenerateSvixAuthURL sdk; + + public GenerateSvixAuthURLRequestBuilder(SDKMethodInterfaces.MethodCallGenerateSvixAuthURL sdk) { + this.sdk = sdk; + } + + public GenerateSvixAuthURLResponse call() throws Exception { + + return sdk.generateSvixAuthURLDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GenerateSvixAuthURLResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GenerateSvixAuthURLResponse.java new file mode 100644 index 0000000..9e9bb78 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GenerateSvixAuthURLResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GenerateSvixAuthURLResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + private Optional svixURL; + + @JsonCreator + public GenerateSvixAuthURLResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional svixURL) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(svixURL, "svixURL"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.svixURL = svixURL; + } + + public GenerateSvixAuthURLResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional svixURL() { + return (Optional) svixURL; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GenerateSvixAuthURLResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GenerateSvixAuthURLResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GenerateSvixAuthURLResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + public GenerateSvixAuthURLResponse withSvixURL(com.clerk.backend_api.models.components.SvixURL svixURL) { + Utils.checkNotNull(svixURL, "svixURL"); + this.svixURL = Optional.ofNullable(svixURL); + return this; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + public GenerateSvixAuthURLResponse withSvixURL(Optional svixURL) { + Utils.checkNotNull(svixURL, "svixURL"); + this.svixURL = svixURL; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateSvixAuthURLResponse other = (GenerateSvixAuthURLResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.svixURL, other.svixURL); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + svixURL); + } + + @Override + public String toString() { + return Utils.toString(GenerateSvixAuthURLResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "svixURL", svixURL); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional svixURL = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + public Builder svixURL(com.clerk.backend_api.models.components.SvixURL svixURL) { + Utils.checkNotNull(svixURL, "svixURL"); + this.svixURL = Optional.ofNullable(svixURL); + return this; + } + + /** + * Response that contains a temporary Svix URL to access management dashboard + */ + public Builder svixURL(Optional svixURL) { + Utils.checkNotNull(svixURL, "svixURL"); + this.svixURL = svixURL; + return this; + } + + public GenerateSvixAuthURLResponse build() { + return new GenerateSvixAuthURLResponse( + contentType, + statusCode, + rawResponse, + svixURL); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetClientListRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetClientListRequest.java new file mode 100644 index 0000000..6cd06f0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetClientListRequest.java @@ -0,0 +1,223 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class GetClientListRequest { + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + @JsonCreator + public GetClientListRequest( + Optional limit, + Optional offset) { + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + this.limit = limit; + this.offset = offset; + } + + public GetClientListRequest() { + this(Optional.empty(), Optional.empty()); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public GetClientListRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public GetClientListRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public GetClientListRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public GetClientListRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetClientListRequest other = (GetClientListRequest) o; + return + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + limit, + offset); + } + + @Override + public String toString() { + return Utils.toString(GetClientListRequest.class, + "limit", limit, + "offset", offset); + } + + public final static class Builder { + + private Optional limit; + + private Optional offset; + + private Builder() { + // force use of static builder() method + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public GetClientListRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new GetClientListRequest( + limit, + offset); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetClientListRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetClientListRequestBuilder.java new file mode 100644 index 0000000..e2d0148 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetClientListRequestBuilder.java @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetClientListRequestBuilder { + + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "10", + new TypeReference>() {}); + private Optional offset = Utils.readDefaultOrConstValue( + "offset", + "0", + new TypeReference>() {}); + private final SDKMethodInterfaces.MethodCallGetClientList sdk; + + public GetClientListRequestBuilder(SDKMethodInterfaces.MethodCallGetClientList sdk) { + this.sdk = sdk; + } + + public GetClientListRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public GetClientListRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public GetClientListRequestBuilder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.of(offset); + return this; + } + + public GetClientListRequestBuilder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public GetClientListResponse call() throws Exception { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + + return sdk.list( + limit, + offset); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetClientListResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetClientListResponse.java new file mode 100644 index 0000000..842d820 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetClientListResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class GetClientListResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional> clientList; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public GetClientListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> clientList) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(clientList, "clientList"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.clientList = clientList; + } + + public GetClientListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> clientList() { + return (Optional>) clientList; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private GetClientListResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetClientListResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetClientListResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetClientListResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetClientListResponse withClientList(java.util.List clientList) { + Utils.checkNotNull(clientList, "clientList"); + this.clientList = Optional.ofNullable(clientList); + return this; + } + + /** + * Success + */ + public GetClientListResponse withClientList(Optional> clientList) { + Utils.checkNotNull(clientList, "clientList"); + this.clientList = clientList; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetClientListResponse other = (GetClientListResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.clientList, other.clientList); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + clientList); + } + + @Override + public String toString() { + return Utils.toString(GetClientListResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "clientList", clientList); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> clientList = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder clientList(java.util.List clientList) { + Utils.checkNotNull(clientList, "clientList"); + this.clientList = Optional.ofNullable(clientList); + return this; + } + + /** + * Success + */ + public Builder clientList(Optional> clientList) { + Utils.checkNotNull(clientList, "clientList"); + this.clientList = clientList; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public GetClientListResponse build() { + return new GetClientListResponse( + contentType, + statusCode, + rawResponse, + clientList) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetClientRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetClientRequest.java new file mode 100644 index 0000000..2d2ccb0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetClientRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetClientRequest { + + /** + * Client ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=client_id") + private String clientId; + + @JsonCreator + public GetClientRequest( + String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + } + + /** + * Client ID. + */ + @JsonIgnore + public String clientId() { + return clientId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Client ID. + */ + public GetClientRequest withClientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetClientRequest other = (GetClientRequest) o; + return + java.util.Objects.deepEquals(this.clientId, other.clientId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + clientId); + } + + @Override + public String toString() { + return Utils.toString(GetClientRequest.class, + "clientId", clientId); + } + + public final static class Builder { + + private String clientId; + + private Builder() { + // force use of static builder() method + } + + /** + * Client ID. + */ + public Builder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + public GetClientRequest build() { + return new GetClientRequest( + clientId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetClientRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetClientRequestBuilder.java new file mode 100644 index 0000000..0ed182d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetClientRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetClientRequestBuilder { + + private String clientId; + private final SDKMethodInterfaces.MethodCallGetClient sdk; + + public GetClientRequestBuilder(SDKMethodInterfaces.MethodCallGetClient sdk) { + this.sdk = sdk; + } + + public GetClientRequestBuilder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + public GetClientResponse call() throws Exception { + + return sdk.get( + clientId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetClientResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetClientResponse.java new file mode 100644 index 0000000..0d3e869 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetClientResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetClientResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional client; + + @JsonCreator + public GetClientResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional client) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(client, "client"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.client = client; + } + + public GetClientResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional client() { + return (Optional) client; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetClientResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetClientResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetClientResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetClientResponse withClient(com.clerk.backend_api.models.components.Client client) { + Utils.checkNotNull(client, "client"); + this.client = Optional.ofNullable(client); + return this; + } + + /** + * Success + */ + public GetClientResponse withClient(Optional client) { + Utils.checkNotNull(client, "client"); + this.client = client; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetClientResponse other = (GetClientResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.client, other.client); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + client); + } + + @Override + public String toString() { + return Utils.toString(GetClientResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "client", client); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional client = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder client(com.clerk.backend_api.models.components.Client client) { + Utils.checkNotNull(client, "client"); + this.client = Optional.ofNullable(client); + return this; + } + + /** + * Success + */ + public Builder client(Optional client) { + Utils.checkNotNull(client, "client"); + this.client = client; + return this; + } + + public GetClientResponse build() { + return new GetClientResponse( + contentType, + statusCode, + rawResponse, + client); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressRequest.java new file mode 100644 index 0000000..ba4e3e6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetEmailAddressRequest { + + /** + * The ID of the email address to retrieve + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=email_address_id") + private String emailAddressId; + + @JsonCreator + public GetEmailAddressRequest( + String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + } + + /** + * The ID of the email address to retrieve + */ + @JsonIgnore + public String emailAddressId() { + return emailAddressId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the email address to retrieve + */ + public GetEmailAddressRequest withEmailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEmailAddressRequest other = (GetEmailAddressRequest) o; + return + java.util.Objects.deepEquals(this.emailAddressId, other.emailAddressId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + emailAddressId); + } + + @Override + public String toString() { + return Utils.toString(GetEmailAddressRequest.class, + "emailAddressId", emailAddressId); + } + + public final static class Builder { + + private String emailAddressId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the email address to retrieve + */ + public Builder emailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + public GetEmailAddressRequest build() { + return new GetEmailAddressRequest( + emailAddressId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressRequestBuilder.java new file mode 100644 index 0000000..01c196b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetEmailAddressRequestBuilder { + + private String emailAddressId; + private final SDKMethodInterfaces.MethodCallGetEmailAddress sdk; + + public GetEmailAddressRequestBuilder(SDKMethodInterfaces.MethodCallGetEmailAddress sdk) { + this.sdk = sdk; + } + + public GetEmailAddressRequestBuilder emailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + public GetEmailAddressResponse call() throws Exception { + + return sdk.get( + emailAddressId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressResponse.java new file mode 100644 index 0000000..d71ff28 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetEmailAddressResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetEmailAddressResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional emailAddress; + + @JsonCreator + public GetEmailAddressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional emailAddress) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(emailAddress, "emailAddress"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.emailAddress = emailAddress; + } + + public GetEmailAddressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional emailAddress() { + return (Optional) emailAddress; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetEmailAddressResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetEmailAddressResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetEmailAddressResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetEmailAddressResponse withEmailAddress(com.clerk.backend_api.models.components.EmailAddress emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Success + */ + public GetEmailAddressResponse withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEmailAddressResponse other = (GetEmailAddressResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + emailAddress); + } + + @Override + public String toString() { + return Utils.toString(GetEmailAddressResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "emailAddress", emailAddress); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional emailAddress = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder emailAddress(com.clerk.backend_api.models.components.EmailAddress emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Success + */ + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public GetEmailAddressResponse build() { + return new GetEmailAddressResponse( + contentType, + statusCode, + rawResponse, + emailAddress); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetJWKSRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetJWKSRequestBuilder.java new file mode 100644 index 0000000..1dfea75 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetJWKSRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetJWKSRequestBuilder { + + private final SDKMethodInterfaces.MethodCallGetJWKS sdk; + + public GetJWKSRequestBuilder(SDKMethodInterfaces.MethodCallGetJWKS sdk) { + this.sdk = sdk; + } + + public GetJWKSResponse call() throws Exception { + + return sdk.getJWKSDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetJWKSResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetJWKSResponse.java new file mode 100644 index 0000000..1158815 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetJWKSResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; + +public class GetJWKSResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetJWKSResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetJWKSResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetJWKSResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetJWKSResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetJWKSResponse other = (GetJWKSResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetJWKSResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetJWKSResponse build() { + return new GetJWKSResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateRequest.java new file mode 100644 index 0000000..abd87d6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetJWTTemplateRequest { + + /** + * JWT Template ID + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_id") + private String templateId; + + @JsonCreator + public GetJWTTemplateRequest( + String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + } + + /** + * JWT Template ID + */ + @JsonIgnore + public String templateId() { + return templateId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * JWT Template ID + */ + public GetJWTTemplateRequest withTemplateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetJWTTemplateRequest other = (GetJWTTemplateRequest) o; + return + java.util.Objects.deepEquals(this.templateId, other.templateId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateId); + } + + @Override + public String toString() { + return Utils.toString(GetJWTTemplateRequest.class, + "templateId", templateId); + } + + public final static class Builder { + + private String templateId; + + private Builder() { + // force use of static builder() method + } + + /** + * JWT Template ID + */ + public Builder templateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + public GetJWTTemplateRequest build() { + return new GetJWTTemplateRequest( + templateId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateRequestBuilder.java new file mode 100644 index 0000000..e319de0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetJWTTemplateRequestBuilder { + + private String templateId; + private final SDKMethodInterfaces.MethodCallGetJWTTemplate sdk; + + public GetJWTTemplateRequestBuilder(SDKMethodInterfaces.MethodCallGetJWTTemplate sdk) { + this.sdk = sdk; + } + + public GetJWTTemplateRequestBuilder templateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + public GetJWTTemplateResponse call() throws Exception { + + return sdk.get( + templateId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateResponse.java new file mode 100644 index 0000000..c7189ea --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetJWTTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetJWTTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional jwtTemplate; + + @JsonCreator + public GetJWTTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional jwtTemplate) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.jwtTemplate = jwtTemplate; + } + + public GetJWTTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional jwtTemplate() { + return (Optional) jwtTemplate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetJWTTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetJWTTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetJWTTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetJWTTemplateResponse withJWTTemplate(com.clerk.backend_api.models.components.JWTTemplate jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = Optional.ofNullable(jwtTemplate); + return this; + } + + /** + * Success + */ + public GetJWTTemplateResponse withJWTTemplate(Optional jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = jwtTemplate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetJWTTemplateResponse other = (GetJWTTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.jwtTemplate, other.jwtTemplate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + jwtTemplate); + } + + @Override + public String toString() { + return Utils.toString(GetJWTTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "jwtTemplate", jwtTemplate); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional jwtTemplate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder jwtTemplate(com.clerk.backend_api.models.components.JWTTemplate jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = Optional.ofNullable(jwtTemplate); + return this; + } + + /** + * Success + */ + public Builder jwtTemplate(Optional jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = jwtTemplate; + return this; + } + + public GetJWTTemplateResponse build() { + return new GetJWTTemplateResponse( + contentType, + statusCode, + rawResponse, + jwtTemplate); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenPublicMetadata.java new file mode 100644 index 0000000..44d183c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenPublicMetadata.java @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetOAuthAccessTokenPublicMetadata { + + @JsonCreator + public GetOAuthAccessTokenPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(GetOAuthAccessTokenPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public GetOAuthAccessTokenPublicMetadata build() { + return new GetOAuthAccessTokenPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenRequest.java new file mode 100644 index 0000000..c5972c4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenRequest.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetOAuthAccessTokenRequest { + + /** + * The ID of the user for which to retrieve the OAuth access token + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + /** + * The ID of the OAuth provider (e.g. `oauth_google`) + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=provider") + private String provider; + + @JsonCreator + public GetOAuthAccessTokenRequest( + String userId, + String provider) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(provider, "provider"); + this.userId = userId; + this.provider = provider; + } + + /** + * The ID of the user for which to retrieve the OAuth access token + */ + @JsonIgnore + public String userId() { + return userId; + } + + /** + * The ID of the OAuth provider (e.g. `oauth_google`) + */ + @JsonIgnore + public String provider() { + return provider; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user for which to retrieve the OAuth access token + */ + public GetOAuthAccessTokenRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The ID of the OAuth provider (e.g. `oauth_google`) + */ + public GetOAuthAccessTokenRequest withProvider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOAuthAccessTokenRequest other = (GetOAuthAccessTokenRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.provider, other.provider); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + provider); + } + + @Override + public String toString() { + return Utils.toString(GetOAuthAccessTokenRequest.class, + "userId", userId, + "provider", provider); + } + + public final static class Builder { + + private String userId; + + private String provider; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user for which to retrieve the OAuth access token + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * The ID of the OAuth provider (e.g. `oauth_google`) + */ + public Builder provider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + public GetOAuthAccessTokenRequest build() { + return new GetOAuthAccessTokenRequest( + userId, + provider); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenRequestBuilder.java new file mode 100644 index 0000000..df54012 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetOAuthAccessTokenRequestBuilder { + + private String userId; + private String provider; + private final SDKMethodInterfaces.MethodCallGetOAuthAccessToken sdk; + + public GetOAuthAccessTokenRequestBuilder(SDKMethodInterfaces.MethodCallGetOAuthAccessToken sdk) { + this.sdk = sdk; + } + + public GetOAuthAccessTokenRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public GetOAuthAccessTokenRequestBuilder provider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + public GetOAuthAccessTokenResponse call() throws Exception { + + return sdk.getOAuthAccessToken( + userId, + provider); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenResponse.java new file mode 100644 index 0000000..7948826 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthAccessTokenResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetOAuthAccessTokenResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The OAuth access token of the user, if any. + */ + private Optional> responseBodies; + + @JsonCreator + public GetOAuthAccessTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> responseBodies) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(responseBodies, "responseBodies"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.responseBodies = responseBodies; + } + + public GetOAuthAccessTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The OAuth access token of the user, if any. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> responseBodies() { + return (Optional>) responseBodies; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetOAuthAccessTokenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetOAuthAccessTokenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetOAuthAccessTokenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The OAuth access token of the user, if any. + */ + public GetOAuthAccessTokenResponse withResponseBodies(java.util.List responseBodies) { + Utils.checkNotNull(responseBodies, "responseBodies"); + this.responseBodies = Optional.ofNullable(responseBodies); + return this; + } + + /** + * The OAuth access token of the user, if any. + */ + public GetOAuthAccessTokenResponse withResponseBodies(Optional> responseBodies) { + Utils.checkNotNull(responseBodies, "responseBodies"); + this.responseBodies = responseBodies; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOAuthAccessTokenResponse other = (GetOAuthAccessTokenResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.responseBodies, other.responseBodies); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + responseBodies); + } + + @Override + public String toString() { + return Utils.toString(GetOAuthAccessTokenResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "responseBodies", responseBodies); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> responseBodies = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The OAuth access token of the user, if any. + */ + public Builder responseBodies(java.util.List responseBodies) { + Utils.checkNotNull(responseBodies, "responseBodies"); + this.responseBodies = Optional.ofNullable(responseBodies); + return this; + } + + /** + * The OAuth access token of the user, if any. + */ + public Builder responseBodies(Optional> responseBodies) { + Utils.checkNotNull(responseBodies, "responseBodies"); + this.responseBodies = responseBodies; + return this; + } + + public GetOAuthAccessTokenResponse build() { + return new GetOAuthAccessTokenResponse( + contentType, + statusCode, + rawResponse, + responseBodies); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationRequest.java new file mode 100644 index 0000000..a4755bf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetOAuthApplicationRequest { + + /** + * The ID of the OAuth application + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=oauth_application_id") + private String oauthApplicationId; + + @JsonCreator + public GetOAuthApplicationRequest( + String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + } + + /** + * The ID of the OAuth application + */ + @JsonIgnore + public String oauthApplicationId() { + return oauthApplicationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the OAuth application + */ + public GetOAuthApplicationRequest withOauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOAuthApplicationRequest other = (GetOAuthApplicationRequest) o; + return + java.util.Objects.deepEquals(this.oauthApplicationId, other.oauthApplicationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + oauthApplicationId); + } + + @Override + public String toString() { + return Utils.toString(GetOAuthApplicationRequest.class, + "oauthApplicationId", oauthApplicationId); + } + + public final static class Builder { + + private String oauthApplicationId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the OAuth application + */ + public Builder oauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public GetOAuthApplicationRequest build() { + return new GetOAuthApplicationRequest( + oauthApplicationId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationRequestBuilder.java new file mode 100644 index 0000000..0482946 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetOAuthApplicationRequestBuilder { + + private String oauthApplicationId; + private final SDKMethodInterfaces.MethodCallGetOAuthApplication sdk; + + public GetOAuthApplicationRequestBuilder(SDKMethodInterfaces.MethodCallGetOAuthApplication sdk) { + this.sdk = sdk; + } + + public GetOAuthApplicationRequestBuilder oauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public GetOAuthApplicationResponse call() throws Exception { + + return sdk.get( + oauthApplicationId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationResponse.java new file mode 100644 index 0000000..8abae8f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOAuthApplicationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetOAuthApplicationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An OAuth application + */ + private Optional oAuthApplication; + + @JsonCreator + public GetOAuthApplicationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional oAuthApplication) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.oAuthApplication = oAuthApplication; + } + + public GetOAuthApplicationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An OAuth application + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional oAuthApplication() { + return (Optional) oAuthApplication; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetOAuthApplicationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetOAuthApplicationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetOAuthApplicationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An OAuth application + */ + public GetOAuthApplicationResponse withOAuthApplication(com.clerk.backend_api.models.components.OAuthApplication oAuthApplication) { + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.oAuthApplication = Optional.ofNullable(oAuthApplication); + return this; + } + + /** + * An OAuth application + */ + public GetOAuthApplicationResponse withOAuthApplication(Optional oAuthApplication) { + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.oAuthApplication = oAuthApplication; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOAuthApplicationResponse other = (GetOAuthApplicationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.oAuthApplication, other.oAuthApplication); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + oAuthApplication); + } + + @Override + public String toString() { + return Utils.toString(GetOAuthApplicationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "oAuthApplication", oAuthApplication); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional oAuthApplication = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An OAuth application + */ + public Builder oAuthApplication(com.clerk.backend_api.models.components.OAuthApplication oAuthApplication) { + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.oAuthApplication = Optional.ofNullable(oAuthApplication); + return this; + } + + /** + * An OAuth application + */ + public Builder oAuthApplication(Optional oAuthApplication) { + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.oAuthApplication = oAuthApplication; + return this; + } + + public GetOAuthApplicationResponse build() { + return new GetOAuthApplicationResponse( + contentType, + statusCode, + rawResponse, + oAuthApplication); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationRequest.java new file mode 100644 index 0000000..f7daf8a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationRequest.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetOrganizationInvitationRequest { + + /** + * The organization ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + /** + * The organization invitation ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=invitation_id") + private String invitationId; + + @JsonCreator + public GetOrganizationInvitationRequest( + String organizationId, + String invitationId) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(invitationId, "invitationId"); + this.organizationId = organizationId; + this.invitationId = invitationId; + } + + /** + * The organization ID. + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + /** + * The organization invitation ID. + */ + @JsonIgnore + public String invitationId() { + return invitationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The organization ID. + */ + public GetOrganizationInvitationRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The organization invitation ID. + */ + public GetOrganizationInvitationRequest withInvitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOrganizationInvitationRequest other = (GetOrganizationInvitationRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.invitationId, other.invitationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + invitationId); + } + + @Override + public String toString() { + return Utils.toString(GetOrganizationInvitationRequest.class, + "organizationId", organizationId, + "invitationId", invitationId); + } + + public final static class Builder { + + private String organizationId; + + private String invitationId; + + private Builder() { + // force use of static builder() method + } + + /** + * The organization ID. + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The organization invitation ID. + */ + public Builder invitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + public GetOrganizationInvitationRequest build() { + return new GetOrganizationInvitationRequest( + organizationId, + invitationId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationRequestBuilder.java new file mode 100644 index 0000000..14cbf6b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetOrganizationInvitationRequestBuilder { + + private String organizationId; + private String invitationId; + private final SDKMethodInterfaces.MethodCallGetOrganizationInvitation sdk; + + public GetOrganizationInvitationRequestBuilder(SDKMethodInterfaces.MethodCallGetOrganizationInvitation sdk) { + this.sdk = sdk; + } + + public GetOrganizationInvitationRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public GetOrganizationInvitationRequestBuilder invitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + public GetOrganizationInvitationResponse call() throws Exception { + + return sdk.get( + organizationId, + invitationId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationResponse.java new file mode 100644 index 0000000..927bc01 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationInvitationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetOrganizationInvitationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization invitation + */ + private Optional organizationInvitation; + + @JsonCreator + public GetOrganizationInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationInvitation) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationInvitation = organizationInvitation; + } + + public GetOrganizationInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization invitation + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationInvitation() { + return (Optional) organizationInvitation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetOrganizationInvitationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetOrganizationInvitationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetOrganizationInvitationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization invitation + */ + public GetOrganizationInvitationResponse withOrganizationInvitation(com.clerk.backend_api.models.components.OrganizationInvitation organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = Optional.ofNullable(organizationInvitation); + return this; + } + + /** + * An organization invitation + */ + public GetOrganizationInvitationResponse withOrganizationInvitation(Optional organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = organizationInvitation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOrganizationInvitationResponse other = (GetOrganizationInvitationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationInvitation, other.organizationInvitation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationInvitation); + } + + @Override + public String toString() { + return Utils.toString(GetOrganizationInvitationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationInvitation", organizationInvitation); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationInvitation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization invitation + */ + public Builder organizationInvitation(com.clerk.backend_api.models.components.OrganizationInvitation organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = Optional.ofNullable(organizationInvitation); + return this; + } + + /** + * An organization invitation + */ + public Builder organizationInvitation(Optional organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = organizationInvitation; + return this; + } + + public GetOrganizationInvitationResponse build() { + return new GetOrganizationInvitationResponse( + contentType, + statusCode, + rawResponse, + organizationInvitation); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationRequest.java new file mode 100644 index 0000000..cdd50bb --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetOrganizationRequest { + + /** + * The ID or slug of the organization + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @JsonCreator + public GetOrganizationRequest( + String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + } + + /** + * The ID or slug of the organization + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID or slug of the organization + */ + public GetOrganizationRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOrganizationRequest other = (GetOrganizationRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId); + } + + @Override + public String toString() { + return Utils.toString(GetOrganizationRequest.class, + "organizationId", organizationId); + } + + public final static class Builder { + + private String organizationId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID or slug of the organization + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public GetOrganizationRequest build() { + return new GetOrganizationRequest( + organizationId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationRequestBuilder.java new file mode 100644 index 0000000..ce23aa3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetOrganizationRequestBuilder { + + private String organizationId; + private final SDKMethodInterfaces.MethodCallGetOrganization sdk; + + public GetOrganizationRequestBuilder(SDKMethodInterfaces.MethodCallGetOrganization sdk) { + this.sdk = sdk; + } + + public GetOrganizationRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public GetOrganizationResponse call() throws Exception { + + return sdk.get( + organizationId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationResponse.java new file mode 100644 index 0000000..fb2d7af --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetOrganizationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetOrganizationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization + */ + private Optional organization; + + @JsonCreator + public GetOrganizationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organization) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organization, "organization"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organization = organization; + } + + public GetOrganizationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organization() { + return (Optional) organization; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetOrganizationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetOrganizationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetOrganizationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public GetOrganizationResponse withOrganization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public GetOrganizationResponse withOrganization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOrganizationResponse other = (GetOrganizationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organization, other.organization); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organization); + } + + @Override + public String toString() { + return Utils.toString(GetOrganizationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organization", organization); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organization = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public Builder organization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public Builder organization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + public GetOrganizationResponse build() { + return new GetOrganizationResponse( + contentType, + statusCode, + rawResponse, + organization); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberRequest.java new file mode 100644 index 0000000..c81a569 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetPhoneNumberRequest { + + /** + * The ID of the phone number to retrieve + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=phone_number_id") + private String phoneNumberId; + + @JsonCreator + public GetPhoneNumberRequest( + String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + } + + /** + * The ID of the phone number to retrieve + */ + @JsonIgnore + public String phoneNumberId() { + return phoneNumberId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the phone number to retrieve + */ + public GetPhoneNumberRequest withPhoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPhoneNumberRequest other = (GetPhoneNumberRequest) o; + return + java.util.Objects.deepEquals(this.phoneNumberId, other.phoneNumberId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + phoneNumberId); + } + + @Override + public String toString() { + return Utils.toString(GetPhoneNumberRequest.class, + "phoneNumberId", phoneNumberId); + } + + public final static class Builder { + + private String phoneNumberId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the phone number to retrieve + */ + public Builder phoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + public GetPhoneNumberRequest build() { + return new GetPhoneNumberRequest( + phoneNumberId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberRequestBuilder.java new file mode 100644 index 0000000..6321b06 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetPhoneNumberRequestBuilder { + + private String phoneNumberId; + private final SDKMethodInterfaces.MethodCallGetPhoneNumber sdk; + + public GetPhoneNumberRequestBuilder(SDKMethodInterfaces.MethodCallGetPhoneNumber sdk) { + this.sdk = sdk; + } + + public GetPhoneNumberRequestBuilder phoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + public GetPhoneNumberResponse call() throws Exception { + + return sdk.get( + phoneNumberId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberResponse.java new file mode 100644 index 0000000..14ee19a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetPhoneNumberResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetPhoneNumberResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional phoneNumber; + + @JsonCreator + public GetPhoneNumberResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional phoneNumber) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.phoneNumber = phoneNumber; + } + + public GetPhoneNumberResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional phoneNumber() { + return (Optional) phoneNumber; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetPhoneNumberResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetPhoneNumberResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPhoneNumberResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetPhoneNumberResponse withPhoneNumber(com.clerk.backend_api.models.components.PhoneNumber phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Success + */ + public GetPhoneNumberResponse withPhoneNumber(Optional phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPhoneNumberResponse other = (GetPhoneNumberResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + phoneNumber); + } + + @Override + public String toString() { + return Utils.toString(GetPhoneNumberResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "phoneNumber", phoneNumber); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional phoneNumber = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder phoneNumber(com.clerk.backend_api.models.components.PhoneNumber phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Success + */ + public Builder phoneNumber(Optional phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + public GetPhoneNumberResponse build() { + return new GetPhoneNumberResponse( + contentType, + statusCode, + rawResponse, + phoneNumber); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialRequest.java new file mode 100644 index 0000000..cc4b51a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class GetPublicInterstitialRequest { + + /** + * The Frontend API key of your instance + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=frontendApi") + private Optional frontendApi; + + /** + * The publishable key of your instance + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=publishable_key") + private Optional publishableKey; + + @JsonCreator + public GetPublicInterstitialRequest( + Optional frontendApi, + Optional publishableKey) { + Utils.checkNotNull(frontendApi, "frontendApi"); + Utils.checkNotNull(publishableKey, "publishableKey"); + this.frontendApi = frontendApi; + this.publishableKey = publishableKey; + } + + public GetPublicInterstitialRequest() { + this(Optional.empty(), Optional.empty()); + } + + /** + * The Frontend API key of your instance + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional frontendApi() { + return (Optional) frontendApi; + } + + /** + * The publishable key of your instance + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publishableKey() { + return (Optional) publishableKey; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The Frontend API key of your instance + */ + public GetPublicInterstitialRequest withFrontendApi(String frontendApi) { + Utils.checkNotNull(frontendApi, "frontendApi"); + this.frontendApi = Optional.ofNullable(frontendApi); + return this; + } + + /** + * The Frontend API key of your instance + */ + public GetPublicInterstitialRequest withFrontendApi(Optional frontendApi) { + Utils.checkNotNull(frontendApi, "frontendApi"); + this.frontendApi = frontendApi; + return this; + } + + /** + * The publishable key of your instance + */ + public GetPublicInterstitialRequest withPublishableKey(String publishableKey) { + Utils.checkNotNull(publishableKey, "publishableKey"); + this.publishableKey = Optional.ofNullable(publishableKey); + return this; + } + + /** + * The publishable key of your instance + */ + public GetPublicInterstitialRequest withPublishableKey(Optional publishableKey) { + Utils.checkNotNull(publishableKey, "publishableKey"); + this.publishableKey = publishableKey; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPublicInterstitialRequest other = (GetPublicInterstitialRequest) o; + return + java.util.Objects.deepEquals(this.frontendApi, other.frontendApi) && + java.util.Objects.deepEquals(this.publishableKey, other.publishableKey); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + frontendApi, + publishableKey); + } + + @Override + public String toString() { + return Utils.toString(GetPublicInterstitialRequest.class, + "frontendApi", frontendApi, + "publishableKey", publishableKey); + } + + public final static class Builder { + + private Optional frontendApi = Optional.empty(); + + private Optional publishableKey = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The Frontend API key of your instance + */ + public Builder frontendApi(String frontendApi) { + Utils.checkNotNull(frontendApi, "frontendApi"); + this.frontendApi = Optional.ofNullable(frontendApi); + return this; + } + + /** + * The Frontend API key of your instance + */ + public Builder frontendApi(Optional frontendApi) { + Utils.checkNotNull(frontendApi, "frontendApi"); + this.frontendApi = frontendApi; + return this; + } + + /** + * The publishable key of your instance + */ + public Builder publishableKey(String publishableKey) { + Utils.checkNotNull(publishableKey, "publishableKey"); + this.publishableKey = Optional.ofNullable(publishableKey); + return this; + } + + /** + * The publishable key of your instance + */ + public Builder publishableKey(Optional publishableKey) { + Utils.checkNotNull(publishableKey, "publishableKey"); + this.publishableKey = publishableKey; + return this; + } + + public GetPublicInterstitialRequest build() { + return new GetPublicInterstitialRequest( + frontendApi, + publishableKey); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialRequestBuilder.java new file mode 100644 index 0000000..1be539e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetPublicInterstitialRequestBuilder { + + private Optional frontendApi = Optional.empty(); + private Optional publishableKey = Optional.empty(); + private final SDKMethodInterfaces.MethodCallGetPublicInterstitial sdk; + + public GetPublicInterstitialRequestBuilder(SDKMethodInterfaces.MethodCallGetPublicInterstitial sdk) { + this.sdk = sdk; + } + + public GetPublicInterstitialRequestBuilder frontendApi(String frontendApi) { + Utils.checkNotNull(frontendApi, "frontendApi"); + this.frontendApi = Optional.of(frontendApi); + return this; + } + + public GetPublicInterstitialRequestBuilder frontendApi(Optional frontendApi) { + Utils.checkNotNull(frontendApi, "frontendApi"); + this.frontendApi = frontendApi; + return this; + } + + public GetPublicInterstitialRequestBuilder publishableKey(String publishableKey) { + Utils.checkNotNull(publishableKey, "publishableKey"); + this.publishableKey = Optional.of(publishableKey); + return this; + } + + public GetPublicInterstitialRequestBuilder publishableKey(Optional publishableKey) { + Utils.checkNotNull(publishableKey, "publishableKey"); + this.publishableKey = publishableKey; + return this; + } + + public GetPublicInterstitialResponse call() throws Exception { + + return sdk.getPublicInterstitial( + frontendApi, + publishableKey); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialResponse.java new file mode 100644 index 0000000..afa5f9b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetPublicInterstitialResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; + +public class GetPublicInterstitialResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetPublicInterstitialResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetPublicInterstitialResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetPublicInterstitialResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPublicInterstitialResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPublicInterstitialResponse other = (GetPublicInterstitialResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPublicInterstitialResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetPublicInterstitialResponse build() { + return new GetPublicInterstitialResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLRequest.java new file mode 100644 index 0000000..2c9bd03 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetRedirectURLRequest { + + /** + * The ID of the redirect URL + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + @JsonCreator + public GetRedirectURLRequest( + String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + } + + /** + * The ID of the redirect URL + */ + @JsonIgnore + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the redirect URL + */ + public GetRedirectURLRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRedirectURLRequest other = (GetRedirectURLRequest) o; + return + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id); + } + + @Override + public String toString() { + return Utils.toString(GetRedirectURLRequest.class, + "id", id); + } + + public final static class Builder { + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the redirect URL + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetRedirectURLRequest build() { + return new GetRedirectURLRequest( + id); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLRequestBuilder.java new file mode 100644 index 0000000..c9eecff --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetRedirectURLRequestBuilder { + + private String id; + private final SDKMethodInterfaces.MethodCallGetRedirectURL sdk; + + public GetRedirectURLRequestBuilder(SDKMethodInterfaces.MethodCallGetRedirectURL sdk) { + this.sdk = sdk; + } + + public GetRedirectURLRequestBuilder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GetRedirectURLResponse call() throws Exception { + + return sdk.get( + id); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLResponse.java new file mode 100644 index 0000000..d98bec8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetRedirectURLResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetRedirectURLResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional redirectURL; + + @JsonCreator + public GetRedirectURLResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional redirectURL) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(redirectURL, "redirectURL"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.redirectURL = redirectURL; + } + + public GetRedirectURLResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional redirectURL() { + return (Optional) redirectURL; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetRedirectURLResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetRedirectURLResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRedirectURLResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetRedirectURLResponse withRedirectURL(com.clerk.backend_api.models.components.RedirectURL redirectURL) { + Utils.checkNotNull(redirectURL, "redirectURL"); + this.redirectURL = Optional.ofNullable(redirectURL); + return this; + } + + /** + * Success + */ + public GetRedirectURLResponse withRedirectURL(Optional redirectURL) { + Utils.checkNotNull(redirectURL, "redirectURL"); + this.redirectURL = redirectURL; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRedirectURLResponse other = (GetRedirectURLResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.redirectURL, other.redirectURL); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + redirectURL); + } + + @Override + public String toString() { + return Utils.toString(GetRedirectURLResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "redirectURL", redirectURL); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional redirectURL = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder redirectURL(com.clerk.backend_api.models.components.RedirectURL redirectURL) { + Utils.checkNotNull(redirectURL, "redirectURL"); + this.redirectURL = Optional.ofNullable(redirectURL); + return this; + } + + /** + * Success + */ + public Builder redirectURL(Optional redirectURL) { + Utils.checkNotNull(redirectURL, "redirectURL"); + this.redirectURL = redirectURL; + return this; + } + + public GetRedirectURLResponse build() { + return new GetRedirectURLResponse( + contentType, + statusCode, + rawResponse, + redirectURL); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionRequest.java new file mode 100644 index 0000000..1a354a5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetSAMLConnectionRequest { + + /** + * The ID of the SAML Connection + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=saml_connection_id") + private String samlConnectionId; + + @JsonCreator + public GetSAMLConnectionRequest( + String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + } + + /** + * The ID of the SAML Connection + */ + @JsonIgnore + public String samlConnectionId() { + return samlConnectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the SAML Connection + */ + public GetSAMLConnectionRequest withSamlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSAMLConnectionRequest other = (GetSAMLConnectionRequest) o; + return + java.util.Objects.deepEquals(this.samlConnectionId, other.samlConnectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + samlConnectionId); + } + + @Override + public String toString() { + return Utils.toString(GetSAMLConnectionRequest.class, + "samlConnectionId", samlConnectionId); + } + + public final static class Builder { + + private String samlConnectionId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the SAML Connection + */ + public Builder samlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + public GetSAMLConnectionRequest build() { + return new GetSAMLConnectionRequest( + samlConnectionId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionRequestBuilder.java new file mode 100644 index 0000000..6397da5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetSAMLConnectionRequestBuilder { + + private String samlConnectionId; + private final SDKMethodInterfaces.MethodCallGetSAMLConnection sdk; + + public GetSAMLConnectionRequestBuilder(SDKMethodInterfaces.MethodCallGetSAMLConnection sdk) { + this.sdk = sdk; + } + + public GetSAMLConnectionRequestBuilder samlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + public GetSAMLConnectionResponse call() throws Exception { + + return sdk.get( + samlConnectionId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionResponse.java new file mode 100644 index 0000000..27a245b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSAMLConnectionResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetSAMLConnectionResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A SAML Connection + */ + private Optional samlConnection; + + @JsonCreator + public GetSAMLConnectionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional samlConnection) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(samlConnection, "samlConnection"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.samlConnection = samlConnection; + } + + public GetSAMLConnectionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A SAML Connection + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional samlConnection() { + return (Optional) samlConnection; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetSAMLConnectionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSAMLConnectionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSAMLConnectionResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A SAML Connection + */ + public GetSAMLConnectionResponse withSAMLConnection(com.clerk.backend_api.models.components.SAMLConnection samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = Optional.ofNullable(samlConnection); + return this; + } + + /** + * A SAML Connection + */ + public GetSAMLConnectionResponse withSAMLConnection(Optional samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = samlConnection; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSAMLConnectionResponse other = (GetSAMLConnectionResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.samlConnection, other.samlConnection); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + samlConnection); + } + + @Override + public String toString() { + return Utils.toString(GetSAMLConnectionResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "samlConnection", samlConnection); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional samlConnection = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A SAML Connection + */ + public Builder samlConnection(com.clerk.backend_api.models.components.SAMLConnection samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = Optional.ofNullable(samlConnection); + return this; + } + + /** + * A SAML Connection + */ + public Builder samlConnection(Optional samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = samlConnection; + return this; + } + + public GetSAMLConnectionResponse build() { + return new GetSAMLConnectionResponse( + contentType, + statusCode, + rawResponse, + samlConnection); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSessionListRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetSessionListRequest.java new file mode 100644 index 0000000..c1c6350 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSessionListRequest.java @@ -0,0 +1,403 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class GetSessionListRequest { + + /** + * List sessions for the given client + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=client_id") + private Optional clientId; + + /** + * List sessions for the given user + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=user_id") + private Optional userId; + + /** + * Filter sessions by the provided status + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=status") + private Optional status; + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + @JsonCreator + public GetSessionListRequest( + Optional clientId, + Optional userId, + Optional status, + Optional limit, + Optional offset) { + Utils.checkNotNull(clientId, "clientId"); + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + this.clientId = clientId; + this.userId = userId; + this.status = status; + this.limit = limit; + this.offset = offset; + } + + public GetSessionListRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * List sessions for the given client + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional clientId() { + return (Optional) clientId; + } + + /** + * List sessions for the given user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + /** + * Filter sessions by the provided status + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * List sessions for the given client + */ + public GetSessionListRequest withClientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + * List sessions for the given client + */ + public GetSessionListRequest withClientId(Optional clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + /** + * List sessions for the given user + */ + public GetSessionListRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * List sessions for the given user + */ + public GetSessionListRequest withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * Filter sessions by the provided status + */ + public GetSessionListRequest withStatus(Status status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Filter sessions by the provided status + */ + public GetSessionListRequest withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public GetSessionListRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public GetSessionListRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public GetSessionListRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public GetSessionListRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionListRequest other = (GetSessionListRequest) o; + return + java.util.Objects.deepEquals(this.clientId, other.clientId) && + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + clientId, + userId, + status, + limit, + offset); + } + + @Override + public String toString() { + return Utils.toString(GetSessionListRequest.class, + "clientId", clientId, + "userId", userId, + "status", status, + "limit", limit, + "offset", offset); + } + + public final static class Builder { + + private Optional clientId = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional limit; + + private Optional offset; + + private Builder() { + // force use of static builder() method + } + + /** + * List sessions for the given client + */ + public Builder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + * List sessions for the given client + */ + public Builder clientId(Optional clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + /** + * List sessions for the given user + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * List sessions for the given user + */ + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * Filter sessions by the provided status + */ + public Builder status(Status status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Filter sessions by the provided status + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public GetSessionListRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new GetSessionListRequest( + clientId, + userId, + status, + limit, + offset); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSessionListRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetSessionListRequestBuilder.java new file mode 100644 index 0000000..9695e0b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSessionListRequestBuilder.java @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetSessionListRequestBuilder { + + private GetSessionListRequest request; + private final SDKMethodInterfaces.MethodCallGetSessionList sdk; + + public GetSessionListRequestBuilder(SDKMethodInterfaces.MethodCallGetSessionList sdk) { + this.sdk = sdk; + } + + public GetSessionListRequestBuilder request(GetSessionListRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetSessionListResponse call() throws Exception { + + return sdk.list( + request); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSessionListResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetSessionListResponse.java new file mode 100644 index 0000000..2feb5d6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSessionListResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class GetSessionListResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional> sessionList; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public GetSessionListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> sessionList) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(sessionList, "sessionList"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.sessionList = sessionList; + } + + public GetSessionListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> sessionList() { + return (Optional>) sessionList; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private GetSessionListResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetSessionListResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSessionListResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionListResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetSessionListResponse withSessionList(java.util.List sessionList) { + Utils.checkNotNull(sessionList, "sessionList"); + this.sessionList = Optional.ofNullable(sessionList); + return this; + } + + /** + * Success + */ + public GetSessionListResponse withSessionList(Optional> sessionList) { + Utils.checkNotNull(sessionList, "sessionList"); + this.sessionList = sessionList; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionListResponse other = (GetSessionListResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.sessionList, other.sessionList); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + sessionList); + } + + @Override + public String toString() { + return Utils.toString(GetSessionListResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "sessionList", sessionList); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> sessionList = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder sessionList(java.util.List sessionList) { + Utils.checkNotNull(sessionList, "sessionList"); + this.sessionList = Optional.ofNullable(sessionList); + return this; + } + + /** + * Success + */ + public Builder sessionList(Optional> sessionList) { + Utils.checkNotNull(sessionList, "sessionList"); + this.sessionList = sessionList; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public GetSessionListResponse build() { + return new GetSessionListResponse( + contentType, + statusCode, + rawResponse, + sessionList) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSessionRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetSessionRequest.java new file mode 100644 index 0000000..1e30e95 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSessionRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetSessionRequest { + + /** + * The ID of the session + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=session_id") + private String sessionId; + + @JsonCreator + public GetSessionRequest( + String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + } + + /** + * The ID of the session + */ + @JsonIgnore + public String sessionId() { + return sessionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the session + */ + public GetSessionRequest withSessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionRequest other = (GetSessionRequest) o; + return + java.util.Objects.deepEquals(this.sessionId, other.sessionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + sessionId); + } + + @Override + public String toString() { + return Utils.toString(GetSessionRequest.class, + "sessionId", sessionId); + } + + public final static class Builder { + + private String sessionId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the session + */ + public Builder sessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + public GetSessionRequest build() { + return new GetSessionRequest( + sessionId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSessionRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetSessionRequestBuilder.java new file mode 100644 index 0000000..e0ff55c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSessionRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetSessionRequestBuilder { + + private String sessionId; + private final SDKMethodInterfaces.MethodCallGetSession sdk; + + public GetSessionRequestBuilder(SDKMethodInterfaces.MethodCallGetSession sdk) { + this.sdk = sdk; + } + + public GetSessionRequestBuilder sessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + public GetSessionResponse call() throws Exception { + + return sdk.get( + sessionId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetSessionResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetSessionResponse.java new file mode 100644 index 0000000..3e396c0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetSessionResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetSessionResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional session; + + @JsonCreator + public GetSessionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional session) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(session, "session"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.session = session; + } + + public GetSessionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional session() { + return (Optional) session; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetSessionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSessionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetSessionResponse withSession(com.clerk.backend_api.models.components.Session session) { + Utils.checkNotNull(session, "session"); + this.session = Optional.ofNullable(session); + return this; + } + + /** + * Success + */ + public GetSessionResponse withSession(Optional session) { + Utils.checkNotNull(session, "session"); + this.session = session; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionResponse other = (GetSessionResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.session, other.session); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + session); + } + + @Override + public String toString() { + return Utils.toString(GetSessionResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "session", session); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional session = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder session(com.clerk.backend_api.models.components.Session session) { + Utils.checkNotNull(session, "session"); + this.session = Optional.ofNullable(session); + return this; + } + + /** + * Success + */ + public Builder session(Optional session) { + Utils.checkNotNull(session, "session"); + this.session = session; + return this; + } + + public GetSessionResponse build() { + return new GetSessionResponse( + contentType, + statusCode, + rawResponse, + session); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListRequest.java new file mode 100644 index 0000000..28560aa --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetTemplateListRequest { + + /** + * The type of templates to list (email or SMS) + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_type") + private TemplateType templateType; + + @JsonCreator + public GetTemplateListRequest( + TemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + } + + /** + * The type of templates to list (email or SMS) + */ + @JsonIgnore + public TemplateType templateType() { + return templateType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The type of templates to list (email or SMS) + */ + public GetTemplateListRequest withTemplateType(TemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTemplateListRequest other = (GetTemplateListRequest) o; + return + java.util.Objects.deepEquals(this.templateType, other.templateType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateType); + } + + @Override + public String toString() { + return Utils.toString(GetTemplateListRequest.class, + "templateType", templateType); + } + + public final static class Builder { + + private TemplateType templateType; + + private Builder() { + // force use of static builder() method + } + + /** + * The type of templates to list (email or SMS) + */ + public Builder templateType(TemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + public GetTemplateListRequest build() { + return new GetTemplateListRequest( + templateType); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListRequestBuilder.java new file mode 100644 index 0000000..c54ab92 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetTemplateListRequestBuilder { + + private TemplateType templateType; + private final SDKMethodInterfaces.MethodCallGetTemplateList sdk; + + public GetTemplateListRequestBuilder(SDKMethodInterfaces.MethodCallGetTemplateList sdk) { + this.sdk = sdk; + } + + public GetTemplateListRequestBuilder templateType(TemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + public GetTemplateListResponse call() throws Exception { + + return sdk.list( + templateType); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListResponse.java new file mode 100644 index 0000000..ee1f9b3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateListResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetTemplateListResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional> templateList; + + @JsonCreator + public GetTemplateListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> templateList) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(templateList, "templateList"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.templateList = templateList; + } + + public GetTemplateListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> templateList() { + return (Optional>) templateList; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetTemplateListResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetTemplateListResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTemplateListResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetTemplateListResponse withTemplateList(java.util.List templateList) { + Utils.checkNotNull(templateList, "templateList"); + this.templateList = Optional.ofNullable(templateList); + return this; + } + + /** + * Success + */ + public GetTemplateListResponse withTemplateList(Optional> templateList) { + Utils.checkNotNull(templateList, "templateList"); + this.templateList = templateList; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTemplateListResponse other = (GetTemplateListResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.templateList, other.templateList); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + templateList); + } + + @Override + public String toString() { + return Utils.toString(GetTemplateListResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "templateList", templateList); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> templateList = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder templateList(java.util.List templateList) { + Utils.checkNotNull(templateList, "templateList"); + this.templateList = Optional.ofNullable(templateList); + return this; + } + + /** + * Success + */ + public Builder templateList(Optional> templateList) { + Utils.checkNotNull(templateList, "templateList"); + this.templateList = templateList; + return this; + } + + public GetTemplateListResponse build() { + return new GetTemplateListResponse( + contentType, + statusCode, + rawResponse, + templateList); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetTemplateRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateRequest.java new file mode 100644 index 0000000..089f07c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateRequest.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetTemplateRequest { + + /** + * The type of templates to retrieve (email or SMS) + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_type") + private PathParamTemplateType templateType; + + /** + * The slug (i.e. machine-friendly name) of the template to retrieve + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=slug") + private String slug; + + @JsonCreator + public GetTemplateRequest( + PathParamTemplateType templateType, + String slug) { + Utils.checkNotNull(templateType, "templateType"); + Utils.checkNotNull(slug, "slug"); + this.templateType = templateType; + this.slug = slug; + } + + /** + * The type of templates to retrieve (email or SMS) + */ + @JsonIgnore + public PathParamTemplateType templateType() { + return templateType; + } + + /** + * The slug (i.e. machine-friendly name) of the template to retrieve + */ + @JsonIgnore + public String slug() { + return slug; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The type of templates to retrieve (email or SMS) + */ + public GetTemplateRequest withTemplateType(PathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug (i.e. machine-friendly name) of the template to retrieve + */ + public GetTemplateRequest withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTemplateRequest other = (GetTemplateRequest) o; + return + java.util.Objects.deepEquals(this.templateType, other.templateType) && + java.util.Objects.deepEquals(this.slug, other.slug); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateType, + slug); + } + + @Override + public String toString() { + return Utils.toString(GetTemplateRequest.class, + "templateType", templateType, + "slug", slug); + } + + public final static class Builder { + + private PathParamTemplateType templateType; + + private String slug; + + private Builder() { + // force use of static builder() method + } + + /** + * The type of templates to retrieve (email or SMS) + */ + public Builder templateType(PathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug (i.e. machine-friendly name) of the template to retrieve + */ + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public GetTemplateRequest build() { + return new GetTemplateRequest( + templateType, + slug); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateRequestBuilder.java new file mode 100644 index 0000000..e3c27e3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetTemplateRequestBuilder { + + private PathParamTemplateType templateType; + private String slug; + private final SDKMethodInterfaces.MethodCallGetTemplate sdk; + + public GetTemplateRequestBuilder(SDKMethodInterfaces.MethodCallGetTemplate sdk) { + this.sdk = sdk; + } + + public GetTemplateRequestBuilder templateType(PathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + public GetTemplateRequestBuilder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public GetTemplateResponse call() throws Exception { + + return sdk.get( + templateType, + slug); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateResponse.java new file mode 100644 index 0000000..cbe5c37 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional template; + + @JsonCreator + public GetTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional template) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(template, "template"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.template = template; + } + + public GetTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional template() { + return (Optional) template; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetTemplateResponse withTemplate(com.clerk.backend_api.models.components.Template template) { + Utils.checkNotNull(template, "template"); + this.template = Optional.ofNullable(template); + return this; + } + + /** + * Success + */ + public GetTemplateResponse withTemplate(Optional template) { + Utils.checkNotNull(template, "template"); + this.template = template; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTemplateResponse other = (GetTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.template, other.template); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + template); + } + + @Override + public String toString() { + return Utils.toString(GetTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "template", template); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional template = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder template(com.clerk.backend_api.models.components.Template template) { + Utils.checkNotNull(template, "template"); + this.template = Optional.ofNullable(template); + return this; + } + + /** + * Success + */ + public Builder template(Optional template) { + Utils.checkNotNull(template, "template"); + this.template = template; + return this; + } + + public GetTemplateResponse build() { + return new GetTemplateResponse( + contentType, + statusCode, + rawResponse, + template); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUserListRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetUserListRequest.java new file mode 100644 index 0000000..53ec595 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUserListRequest.java @@ -0,0 +1,1042 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class GetUserListRequest { + + /** + * Returns users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=email_address") + private Optional> emailAddress; + + /** + * Returns users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=phone_number") + private Optional> phoneNumber; + + /** + * Returns users with the specified external ids. + * For each external id, the `+` and `-` can be + * prepended to the id, which denote whether the + * respective external id should be included or + * excluded from the result set. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=external_id") + private Optional> externalId; + + /** + * Returns users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=username") + private Optional> username; + + /** + * Returns users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=web3_wallet") + private Optional> web3Wallet; + + /** + * 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. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=user_id") + private Optional> userId; + + /** + * 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. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=organization_id") + private Optional> organizationId; + + /** + * 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. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + /** + * 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. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=last_active_at_since") + private Optional lastActiveAtSince; + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + /** + * 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. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=order_by") + private Optional orderBy; + + @JsonCreator + public GetUserListRequest( + Optional> emailAddress, + Optional> phoneNumber, + Optional> externalId, + Optional> username, + Optional> web3Wallet, + Optional> userId, + Optional> organizationId, + Optional query, + Optional lastActiveAtSince, + Optional limit, + Optional offset, + Optional orderBy) { + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + Utils.checkNotNull(externalId, "externalId"); + Utils.checkNotNull(username, "username"); + Utils.checkNotNull(web3Wallet, "web3Wallet"); + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(query, "query"); + Utils.checkNotNull(lastActiveAtSince, "lastActiveAtSince"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + Utils.checkNotNull(orderBy, "orderBy"); + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.externalId = externalId; + this.username = username; + this.web3Wallet = web3Wallet; + this.userId = userId; + this.organizationId = organizationId; + this.query = query; + this.lastActiveAtSince = lastActiveAtSince; + this.limit = limit; + this.offset = offset; + this.orderBy = orderBy; + } + + public GetUserListRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * Returns users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> emailAddress() { + return (Optional>) emailAddress; + } + + /** + * Returns users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> phoneNumber() { + return (Optional>) phoneNumber; + } + + /** + * Returns users with the specified external ids. + * For each external id, the `+` and `-` can be + * prepended to the id, which denote whether the + * respective external id should be included or + * excluded from the result set. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> externalId() { + return (Optional>) externalId; + } + + /** + * Returns users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> username() { + return (Optional>) username; + } + + /** + * Returns users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> web3Wallet() { + return (Optional>) web3Wallet; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> userId() { + return (Optional>) userId; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> organizationId() { + return (Optional>) organizationId; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional query() { + return (Optional) query; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastActiveAtSince() { + return (Optional) lastActiveAtSince; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional orderBy() { + return (Optional) orderBy; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Returns users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + public GetUserListRequest withEmailAddress(java.util.List emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Returns users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + public GetUserListRequest withEmailAddress(Optional> emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Returns users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + public GetUserListRequest withPhoneNumber(java.util.List phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Returns users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + public GetUserListRequest withPhoneNumber(Optional> phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Returns users with the specified external ids. + * For each external id, the `+` and `-` can be + * prepended to the id, which denote whether the + * respective external id should be included or + * excluded from the result set. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + public GetUserListRequest withExternalId(java.util.List externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = Optional.ofNullable(externalId); + return this; + } + + /** + * Returns users with the specified external ids. + * For each external id, the `+` and `-` can be + * prepended to the id, which denote whether the + * respective external id should be included or + * excluded from the result set. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + public GetUserListRequest withExternalId(Optional> externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + /** + * Returns users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + public GetUserListRequest withUsername(java.util.List username) { + Utils.checkNotNull(username, "username"); + this.username = Optional.ofNullable(username); + return this; + } + + /** + * Returns users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + public GetUserListRequest withUsername(Optional> username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + /** + * Returns users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + public GetUserListRequest withWeb3Wallet(java.util.List web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = Optional.ofNullable(web3Wallet); + return this; + } + + /** + * Returns users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + public GetUserListRequest withWeb3Wallet(Optional> web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + /** + * 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. + */ + public GetUserListRequest withUserId(java.util.List userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * 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. + */ + public GetUserListRequest withUserId(Optional> userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * 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. + */ + public GetUserListRequest withOrganizationId(java.util.List organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + /** + * 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. + */ + public GetUserListRequest withOrganizationId(Optional> organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * 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. + */ + public GetUserListRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * 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. + */ + public GetUserListRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + /** + * 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. + */ + public GetUserListRequest withLastActiveAtSince(long lastActiveAtSince) { + Utils.checkNotNull(lastActiveAtSince, "lastActiveAtSince"); + this.lastActiveAtSince = Optional.ofNullable(lastActiveAtSince); + return this; + } + + /** + * 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. + */ + public GetUserListRequest withLastActiveAtSince(Optional lastActiveAtSince) { + Utils.checkNotNull(lastActiveAtSince, "lastActiveAtSince"); + this.lastActiveAtSince = lastActiveAtSince; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public GetUserListRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public GetUserListRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public GetUserListRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public GetUserListRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * 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. + */ + public GetUserListRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * 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. + */ + public GetUserListRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserListRequest other = (GetUserListRequest) o; + return + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber) && + java.util.Objects.deepEquals(this.externalId, other.externalId) && + java.util.Objects.deepEquals(this.username, other.username) && + java.util.Objects.deepEquals(this.web3Wallet, other.web3Wallet) && + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.query, other.query) && + java.util.Objects.deepEquals(this.lastActiveAtSince, other.lastActiveAtSince) && + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + emailAddress, + phoneNumber, + externalId, + username, + web3Wallet, + userId, + organizationId, + query, + lastActiveAtSince, + limit, + offset, + orderBy); + } + + @Override + public String toString() { + return Utils.toString(GetUserListRequest.class, + "emailAddress", emailAddress, + "phoneNumber", phoneNumber, + "externalId", externalId, + "username", username, + "web3Wallet", web3Wallet, + "userId", userId, + "organizationId", organizationId, + "query", query, + "lastActiveAtSince", lastActiveAtSince, + "limit", limit, + "offset", offset, + "orderBy", orderBy); + } + + public final static class Builder { + + private Optional> emailAddress = Optional.empty(); + + private Optional> phoneNumber = Optional.empty(); + + private Optional> externalId = Optional.empty(); + + private Optional> username = Optional.empty(); + + private Optional> web3Wallet = Optional.empty(); + + private Optional> userId = Optional.empty(); + + private Optional> organizationId = Optional.empty(); + + private Optional query = Optional.empty(); + + private Optional lastActiveAtSince = Optional.empty(); + + private Optional limit; + + private Optional offset; + + private Optional orderBy; + + private Builder() { + // force use of static builder() method + } + + /** + * Returns users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + public Builder emailAddress(java.util.List emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Returns users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + public Builder emailAddress(Optional> emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Returns users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + public Builder phoneNumber(java.util.List phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Returns users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + public Builder phoneNumber(Optional> phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Returns users with the specified external ids. + * For each external id, the `+` and `-` can be + * prepended to the id, which denote whether the + * respective external id should be included or + * excluded from the result set. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + public Builder externalId(java.util.List externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = Optional.ofNullable(externalId); + return this; + } + + /** + * Returns users with the specified external ids. + * For each external id, the `+` and `-` can be + * prepended to the id, which denote whether the + * respective external id should be included or + * excluded from the result set. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + public Builder externalId(Optional> externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + /** + * Returns users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + public Builder username(java.util.List username) { + Utils.checkNotNull(username, "username"); + this.username = Optional.ofNullable(username); + return this; + } + + /** + * Returns users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + public Builder username(Optional> username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + /** + * Returns users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + public Builder web3Wallet(java.util.List web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = Optional.ofNullable(web3Wallet); + return this; + } + + /** + * Returns users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + public Builder web3Wallet(Optional> web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + /** + * 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. + */ + public Builder userId(java.util.List userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * 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. + */ + public Builder userId(Optional> userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * 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. + */ + public Builder organizationId(java.util.List organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = Optional.ofNullable(organizationId); + return this; + } + + /** + * 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. + */ + public Builder organizationId(Optional> organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * 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. + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * 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. + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + /** + * 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. + */ + public Builder lastActiveAtSince(long lastActiveAtSince) { + Utils.checkNotNull(lastActiveAtSince, "lastActiveAtSince"); + this.lastActiveAtSince = Optional.ofNullable(lastActiveAtSince); + return this; + } + + /** + * 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. + */ + public Builder lastActiveAtSince(Optional lastActiveAtSince) { + Utils.checkNotNull(lastActiveAtSince, "lastActiveAtSince"); + this.lastActiveAtSince = lastActiveAtSince; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * 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. + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * 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. + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + public GetUserListRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + if (orderBy == null) { + orderBy = _SINGLETON_VALUE_OrderBy.value(); + } + return new GetUserListRequest( + emailAddress, + phoneNumber, + externalId, + username, + web3Wallet, + userId, + organizationId, + query, + lastActiveAtSince, + limit, + offset, + orderBy); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_OrderBy = + new LazySingletonValue<>( + "order_by", + "\"-created_at\"", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUserListRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetUserListRequestBuilder.java new file mode 100644 index 0000000..7334f0a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUserListRequestBuilder.java @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetUserListRequestBuilder { + + private GetUserListRequest request; + private final SDKMethodInterfaces.MethodCallGetUserList sdk; + + public GetUserListRequestBuilder(SDKMethodInterfaces.MethodCallGetUserList sdk) { + this.sdk = sdk; + } + + public GetUserListRequestBuilder request(GetUserListRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetUserListResponse call() throws Exception { + + return sdk.list( + request); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUserListResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetUserListResponse.java new file mode 100644 index 0000000..aae957e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUserListResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class GetUserListResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional> userList; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public GetUserListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> userList) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(userList, "userList"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.userList = userList; + } + + public GetUserListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> userList() { + return (Optional>) userList; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private GetUserListResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetUserListResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetUserListResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUserListResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetUserListResponse withUserList(java.util.List userList) { + Utils.checkNotNull(userList, "userList"); + this.userList = Optional.ofNullable(userList); + return this; + } + + /** + * Success + */ + public GetUserListResponse withUserList(Optional> userList) { + Utils.checkNotNull(userList, "userList"); + this.userList = userList; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserListResponse other = (GetUserListResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.userList, other.userList); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + userList); + } + + @Override + public String toString() { + return Utils.toString(GetUserListResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "userList", userList); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> userList = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder userList(java.util.List userList) { + Utils.checkNotNull(userList, "userList"); + this.userList = Optional.ofNullable(userList); + return this; + } + + /** + * Success + */ + public Builder userList(Optional> userList) { + Utils.checkNotNull(userList, "userList"); + this.userList = userList; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public GetUserListResponse build() { + return new GetUserListResponse( + contentType, + statusCode, + rawResponse, + userList) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUserRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetUserRequest.java new file mode 100644 index 0000000..00f4d39 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUserRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class GetUserRequest { + + /** + * The ID of the user to retrieve + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public GetUserRequest( + String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + /** + * The ID of the user to retrieve + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to retrieve + */ + public GetUserRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserRequest other = (GetUserRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(GetUserRequest.class, + "userId", userId); + } + + public final static class Builder { + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to retrieve + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public GetUserRequest build() { + return new GetUserRequest( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUserRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetUserRequestBuilder.java new file mode 100644 index 0000000..b77fb4e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUserRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetUserRequestBuilder { + + private String userId; + private final SDKMethodInterfaces.MethodCallGetUser sdk; + + public GetUserRequestBuilder(SDKMethodInterfaces.MethodCallGetUser sdk) { + this.sdk = sdk; + } + + public GetUserRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public GetUserResponse call() throws Exception { + + return sdk.get( + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUserResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetUserResponse.java new file mode 100644 index 0000000..62a66d7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUserResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetUserResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public GetUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public GetUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetUserResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetUserResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUserResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetUserResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public GetUserResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserResponse other = (GetUserResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(GetUserResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public GetUserResponse build() { + return new GetUserResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountRequest.java b/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountRequest.java new file mode 100644 index 0000000..f1d827b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountRequest.java @@ -0,0 +1,570 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class GetUsersCountRequest { + + /** + * Counts users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=email_address") + private Optional> emailAddress; + + /** + * Counts users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=phone_number") + private Optional> phoneNumber; + + /** + * Counts users with the specified external ids. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=external_id") + private Optional> externalId; + + /** + * Counts users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=username") + private Optional> username; + + /** + * Counts users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=web3_wallet") + private Optional> web3Wallet; + + /** + * Counts users with the user ids specified. + * Accepts up to 100 user ids. + * Any user ids not found are ignored. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=user_id") + private Optional> userId; + + /** + * 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. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + @JsonCreator + public GetUsersCountRequest( + Optional> emailAddress, + Optional> phoneNumber, + Optional> externalId, + Optional> username, + Optional> web3Wallet, + Optional> userId, + Optional query) { + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + Utils.checkNotNull(externalId, "externalId"); + Utils.checkNotNull(username, "username"); + Utils.checkNotNull(web3Wallet, "web3Wallet"); + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(query, "query"); + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.externalId = externalId; + this.username = username; + this.web3Wallet = web3Wallet; + this.userId = userId; + this.query = query; + } + + public GetUsersCountRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * Counts users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> emailAddress() { + return (Optional>) emailAddress; + } + + /** + * Counts users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> phoneNumber() { + return (Optional>) phoneNumber; + } + + /** + * Counts users with the specified external ids. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> externalId() { + return (Optional>) externalId; + } + + /** + * Counts users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> username() { + return (Optional>) username; + } + + /** + * Counts users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> web3Wallet() { + return (Optional>) web3Wallet; + } + + /** + * Counts users with the user ids specified. + * Accepts up to 100 user ids. + * Any user ids not found are ignored. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> userId() { + return (Optional>) userId; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional query() { + return (Optional) query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Counts users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + public GetUsersCountRequest withEmailAddress(java.util.List emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Counts users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + public GetUsersCountRequest withEmailAddress(Optional> emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Counts users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + public GetUsersCountRequest withPhoneNumber(java.util.List phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Counts users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + public GetUsersCountRequest withPhoneNumber(Optional> phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Counts users with the specified external ids. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + public GetUsersCountRequest withExternalId(java.util.List externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = Optional.ofNullable(externalId); + return this; + } + + /** + * Counts users with the specified external ids. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + public GetUsersCountRequest withExternalId(Optional> externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + /** + * Counts users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + public GetUsersCountRequest withUsername(java.util.List username) { + Utils.checkNotNull(username, "username"); + this.username = Optional.ofNullable(username); + return this; + } + + /** + * Counts users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + public GetUsersCountRequest withUsername(Optional> username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + /** + * Counts users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + public GetUsersCountRequest withWeb3Wallet(java.util.List web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = Optional.ofNullable(web3Wallet); + return this; + } + + /** + * Counts users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + public GetUsersCountRequest withWeb3Wallet(Optional> web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + /** + * Counts users with the user ids specified. + * Accepts up to 100 user ids. + * Any user ids not found are ignored. + */ + public GetUsersCountRequest withUserId(java.util.List userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * Counts users with the user ids specified. + * Accepts up to 100 user ids. + * Any user ids not found are ignored. + */ + public GetUsersCountRequest withUserId(Optional> userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * 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. + */ + public GetUsersCountRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * 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. + */ + public GetUsersCountRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUsersCountRequest other = (GetUsersCountRequest) o; + return + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber) && + java.util.Objects.deepEquals(this.externalId, other.externalId) && + java.util.Objects.deepEquals(this.username, other.username) && + java.util.Objects.deepEquals(this.web3Wallet, other.web3Wallet) && + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + emailAddress, + phoneNumber, + externalId, + username, + web3Wallet, + userId, + query); + } + + @Override + public String toString() { + return Utils.toString(GetUsersCountRequest.class, + "emailAddress", emailAddress, + "phoneNumber", phoneNumber, + "externalId", externalId, + "username", username, + "web3Wallet", web3Wallet, + "userId", userId, + "query", query); + } + + public final static class Builder { + + private Optional> emailAddress = Optional.empty(); + + private Optional> phoneNumber = Optional.empty(); + + private Optional> externalId = Optional.empty(); + + private Optional> username = Optional.empty(); + + private Optional> web3Wallet = Optional.empty(); + + private Optional> userId = Optional.empty(); + + private Optional query = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Counts users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + public Builder emailAddress(java.util.List emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Counts users with the specified email addresses. + * Accepts up to 100 email addresses. + * Any email addresses not found are ignored. + */ + public Builder emailAddress(Optional> emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Counts users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + public Builder phoneNumber(java.util.List phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Counts users with the specified phone numbers. + * Accepts up to 100 phone numbers. + * Any phone numbers not found are ignored. + */ + public Builder phoneNumber(Optional> phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Counts users with the specified external ids. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + public Builder externalId(java.util.List externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = Optional.ofNullable(externalId); + return this; + } + + /** + * Counts users with the specified external ids. + * Accepts up to 100 external ids. + * Any external ids not found are ignored. + */ + public Builder externalId(Optional> externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + /** + * Counts users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + public Builder username(java.util.List username) { + Utils.checkNotNull(username, "username"); + this.username = Optional.ofNullable(username); + return this; + } + + /** + * Counts users with the specified usernames. + * Accepts up to 100 usernames. + * Any usernames not found are ignored. + */ + public Builder username(Optional> username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + /** + * Counts users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + public Builder web3Wallet(java.util.List web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = Optional.ofNullable(web3Wallet); + return this; + } + + /** + * Counts users with the specified web3 wallet addresses. + * Accepts up to 100 web3 wallet addresses. + * Any web3 wallet addressed not found are ignored. + */ + public Builder web3Wallet(Optional> web3Wallet) { + Utils.checkNotNull(web3Wallet, "web3Wallet"); + this.web3Wallet = web3Wallet; + return this; + } + + /** + * Counts users with the user ids specified. + * Accepts up to 100 user ids. + * Any user ids not found are ignored. + */ + public Builder userId(java.util.List userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + * Counts users with the user ids specified. + * Accepts up to 100 user ids. + * Any user ids not found are ignored. + */ + public Builder userId(Optional> userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * 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. + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * 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. + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public GetUsersCountRequest build() { + return new GetUsersCountRequest( + emailAddress, + phoneNumber, + externalId, + username, + web3Wallet, + userId, + query); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountRequestBuilder.java new file mode 100644 index 0000000..0492e3d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetUsersCountRequestBuilder { + + private GetUsersCountRequest request; + private final SDKMethodInterfaces.MethodCallGetUsersCount sdk; + + public GetUsersCountRequestBuilder(SDKMethodInterfaces.MethodCallGetUsersCount sdk) { + this.sdk = sdk; + } + + public GetUsersCountRequestBuilder request(GetUsersCountRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetUsersCountResponse call() throws Exception { + + return sdk.count( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountResponse.java b/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountResponse.java new file mode 100644 index 0000000..4680cd5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/GetUsersCountResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class GetUsersCountResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional totalCount; + + @JsonCreator + public GetUsersCountResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional totalCount) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(totalCount, "totalCount"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.totalCount = totalCount; + } + + public GetUsersCountResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional totalCount() { + return (Optional) totalCount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetUsersCountResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetUsersCountResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUsersCountResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public GetUsersCountResponse withTotalCount(com.clerk.backend_api.models.components.TotalCount totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = Optional.ofNullable(totalCount); + return this; + } + + /** + * Success + */ + public GetUsersCountResponse withTotalCount(Optional totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUsersCountResponse other = (GetUsersCountResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.totalCount, other.totalCount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + totalCount); + } + + @Override + public String toString() { + return Utils.toString(GetUsersCountResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "totalCount", totalCount); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional totalCount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder totalCount(com.clerk.backend_api.models.components.TotalCount totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = Optional.ofNullable(totalCount); + return this; + } + + /** + * Success + */ + public Builder totalCount(Optional totalCount) { + Utils.checkNotNull(totalCount, "totalCount"); + this.totalCount = totalCount; + return this; + } + + public GetUsersCountResponse build() { + return new GetUsersCountResponse( + contentType, + statusCode, + rawResponse, + totalCount); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListAllowlistIdentifiersRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListAllowlistIdentifiersRequestBuilder.java new file mode 100644 index 0000000..dcf1c0b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListAllowlistIdentifiersRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListAllowlistIdentifiersRequestBuilder { + + private final SDKMethodInterfaces.MethodCallListAllowlistIdentifiers sdk; + + public ListAllowlistIdentifiersRequestBuilder(SDKMethodInterfaces.MethodCallListAllowlistIdentifiers sdk) { + this.sdk = sdk; + } + + public ListAllowlistIdentifiersResponse call() throws Exception { + + return sdk.listDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListAllowlistIdentifiersResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListAllowlistIdentifiersResponse.java new file mode 100644 index 0000000..366ad9e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListAllowlistIdentifiersResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class ListAllowlistIdentifiersResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional> allowlistIdentifierList; + + @JsonCreator + public ListAllowlistIdentifiersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> allowlistIdentifierList) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(allowlistIdentifierList, "allowlistIdentifierList"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.allowlistIdentifierList = allowlistIdentifierList; + } + + public ListAllowlistIdentifiersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> allowlistIdentifierList() { + return (Optional>) allowlistIdentifierList; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListAllowlistIdentifiersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAllowlistIdentifiersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAllowlistIdentifiersResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public ListAllowlistIdentifiersResponse withAllowlistIdentifierList(java.util.List allowlistIdentifierList) { + Utils.checkNotNull(allowlistIdentifierList, "allowlistIdentifierList"); + this.allowlistIdentifierList = Optional.ofNullable(allowlistIdentifierList); + return this; + } + + /** + * Success + */ + public ListAllowlistIdentifiersResponse withAllowlistIdentifierList(Optional> allowlistIdentifierList) { + Utils.checkNotNull(allowlistIdentifierList, "allowlistIdentifierList"); + this.allowlistIdentifierList = allowlistIdentifierList; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAllowlistIdentifiersResponse other = (ListAllowlistIdentifiersResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.allowlistIdentifierList, other.allowlistIdentifierList); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + allowlistIdentifierList); + } + + @Override + public String toString() { + return Utils.toString(ListAllowlistIdentifiersResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "allowlistIdentifierList", allowlistIdentifierList); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> allowlistIdentifierList = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder allowlistIdentifierList(java.util.List allowlistIdentifierList) { + Utils.checkNotNull(allowlistIdentifierList, "allowlistIdentifierList"); + this.allowlistIdentifierList = Optional.ofNullable(allowlistIdentifierList); + return this; + } + + /** + * Success + */ + public Builder allowlistIdentifierList(Optional> allowlistIdentifierList) { + Utils.checkNotNull(allowlistIdentifierList, "allowlistIdentifierList"); + this.allowlistIdentifierList = allowlistIdentifierList; + return this; + } + + public ListAllowlistIdentifiersResponse build() { + return new ListAllowlistIdentifiersResponse( + contentType, + statusCode, + rawResponse, + allowlistIdentifierList); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListBlocklistIdentifiersRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListBlocklistIdentifiersRequestBuilder.java new file mode 100644 index 0000000..53ea609 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListBlocklistIdentifiersRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListBlocklistIdentifiersRequestBuilder { + + private final SDKMethodInterfaces.MethodCallListBlocklistIdentifiers sdk; + + public ListBlocklistIdentifiersRequestBuilder(SDKMethodInterfaces.MethodCallListBlocklistIdentifiers sdk) { + this.sdk = sdk; + } + + public ListBlocklistIdentifiersResponse call() throws Exception { + + return sdk.listDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListBlocklistIdentifiersResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListBlocklistIdentifiersResponse.java new file mode 100644 index 0000000..3a145ff --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListBlocklistIdentifiersResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class ListBlocklistIdentifiersResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional blocklistIdentifiers; + + @JsonCreator + public ListBlocklistIdentifiersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional blocklistIdentifiers) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(blocklistIdentifiers, "blocklistIdentifiers"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.blocklistIdentifiers = blocklistIdentifiers; + } + + public ListBlocklistIdentifiersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional blocklistIdentifiers() { + return (Optional) blocklistIdentifiers; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListBlocklistIdentifiersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListBlocklistIdentifiersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListBlocklistIdentifiersResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public ListBlocklistIdentifiersResponse withBlocklistIdentifiers(com.clerk.backend_api.models.components.BlocklistIdentifiers blocklistIdentifiers) { + Utils.checkNotNull(blocklistIdentifiers, "blocklistIdentifiers"); + this.blocklistIdentifiers = Optional.ofNullable(blocklistIdentifiers); + return this; + } + + /** + * Success + */ + public ListBlocklistIdentifiersResponse withBlocklistIdentifiers(Optional blocklistIdentifiers) { + Utils.checkNotNull(blocklistIdentifiers, "blocklistIdentifiers"); + this.blocklistIdentifiers = blocklistIdentifiers; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListBlocklistIdentifiersResponse other = (ListBlocklistIdentifiersResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.blocklistIdentifiers, other.blocklistIdentifiers); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + blocklistIdentifiers); + } + + @Override + public String toString() { + return Utils.toString(ListBlocklistIdentifiersResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "blocklistIdentifiers", blocklistIdentifiers); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional blocklistIdentifiers = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder blocklistIdentifiers(com.clerk.backend_api.models.components.BlocklistIdentifiers blocklistIdentifiers) { + Utils.checkNotNull(blocklistIdentifiers, "blocklistIdentifiers"); + this.blocklistIdentifiers = Optional.ofNullable(blocklistIdentifiers); + return this; + } + + /** + * Success + */ + public Builder blocklistIdentifiers(Optional blocklistIdentifiers) { + Utils.checkNotNull(blocklistIdentifiers, "blocklistIdentifiers"); + this.blocklistIdentifiers = blocklistIdentifiers; + return this; + } + + public ListBlocklistIdentifiersResponse build() { + return new ListBlocklistIdentifiersResponse( + contentType, + statusCode, + rawResponse, + blocklistIdentifiers); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListDomainsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListDomainsRequestBuilder.java new file mode 100644 index 0000000..5cbacae --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListDomainsRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListDomainsRequestBuilder { + + private final SDKMethodInterfaces.MethodCallListDomains sdk; + + public ListDomainsRequestBuilder(SDKMethodInterfaces.MethodCallListDomains sdk) { + this.sdk = sdk; + } + + public ListDomainsResponse call() throws Exception { + + return sdk.listDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListDomainsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListDomainsResponse.java new file mode 100644 index 0000000..42c5010 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListDomainsResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class ListDomainsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of domains + */ + private Optional domains; + + @JsonCreator + public ListDomainsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional domains) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(domains, "domains"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.domains = domains; + } + + public ListDomainsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of domains + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional domains() { + return (Optional) domains; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListDomainsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListDomainsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListDomainsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of domains + */ + public ListDomainsResponse withDomains(com.clerk.backend_api.models.components.Domains domains) { + Utils.checkNotNull(domains, "domains"); + this.domains = Optional.ofNullable(domains); + return this; + } + + /** + * A list of domains + */ + public ListDomainsResponse withDomains(Optional domains) { + Utils.checkNotNull(domains, "domains"); + this.domains = domains; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListDomainsResponse other = (ListDomainsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.domains, other.domains); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + domains); + } + + @Override + public String toString() { + return Utils.toString(ListDomainsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "domains", domains); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional domains = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of domains + */ + public Builder domains(com.clerk.backend_api.models.components.Domains domains) { + Utils.checkNotNull(domains, "domains"); + this.domains = Optional.ofNullable(domains); + return this; + } + + /** + * A list of domains + */ + public Builder domains(Optional domains) { + Utils.checkNotNull(domains, "domains"); + this.domains = domains; + return this; + } + + public ListDomainsResponse build() { + return new ListDomainsResponse( + contentType, + statusCode, + rawResponse, + domains); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsRequest.java b/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsRequest.java new file mode 100644 index 0000000..67f5e06 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsRequest.java @@ -0,0 +1,283 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ListInvitationsRequest { + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + /** + * Filter invitations based on their status + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=status") + private Optional status; + + @JsonCreator + public ListInvitationsRequest( + Optional limit, + Optional offset, + Optional status) { + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + Utils.checkNotNull(status, "status"); + this.limit = limit; + this.offset = offset; + this.status = status; + } + + public ListInvitationsRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + /** + * Filter invitations based on their status + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListInvitationsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListInvitationsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListInvitationsRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListInvitationsRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * Filter invitations based on their status + */ + public ListInvitationsRequest withStatus(QueryParamStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Filter invitations based on their status + */ + public ListInvitationsRequest withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvitationsRequest other = (ListInvitationsRequest) o; + return + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + limit, + offset, + status); + } + + @Override + public String toString() { + return Utils.toString(ListInvitationsRequest.class, + "limit", limit, + "offset", offset, + "status", status); + } + + public final static class Builder { + + private Optional limit; + + private Optional offset; + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * Filter invitations based on their status + */ + public Builder status(QueryParamStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Filter invitations based on their status + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public ListInvitationsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new ListInvitationsRequest( + limit, + offset, + status); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsRequestBuilder.java new file mode 100644 index 0000000..e78550e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsRequestBuilder.java @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListInvitationsRequestBuilder { + + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "10", + new TypeReference>() {}); + private Optional offset = Utils.readDefaultOrConstValue( + "offset", + "0", + new TypeReference>() {}); + private Optional status = Optional.empty(); + private final SDKMethodInterfaces.MethodCallListInvitations sdk; + + public ListInvitationsRequestBuilder(SDKMethodInterfaces.MethodCallListInvitations sdk) { + this.sdk = sdk; + } + + public ListInvitationsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public ListInvitationsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListInvitationsRequestBuilder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.of(offset); + return this; + } + + public ListInvitationsRequestBuilder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListInvitationsRequestBuilder status(QueryParamStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.of(status); + return this; + } + + public ListInvitationsRequestBuilder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public ListInvitationsResponse call() throws Exception { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + + return sdk.list( + limit, + offset, + status); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsResponse.java new file mode 100644 index 0000000..0b6d6c0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListInvitationsResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class ListInvitationsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * List of invitations + */ + private Optional> invitationList; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public ListInvitationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> invitationList) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(invitationList, "invitationList"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.invitationList = invitationList; + } + + public ListInvitationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * List of invitations + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> invitationList() { + return (Optional>) invitationList; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private ListInvitationsResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListInvitationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListInvitationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListInvitationsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of invitations + */ + public ListInvitationsResponse withInvitationList(java.util.List invitationList) { + Utils.checkNotNull(invitationList, "invitationList"); + this.invitationList = Optional.ofNullable(invitationList); + return this; + } + + /** + * List of invitations + */ + public ListInvitationsResponse withInvitationList(Optional> invitationList) { + Utils.checkNotNull(invitationList, "invitationList"); + this.invitationList = invitationList; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvitationsResponse other = (ListInvitationsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.invitationList, other.invitationList); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + invitationList); + } + + @Override + public String toString() { + return Utils.toString(ListInvitationsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "invitationList", invitationList); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> invitationList = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of invitations + */ + public Builder invitationList(java.util.List invitationList) { + Utils.checkNotNull(invitationList, "invitationList"); + this.invitationList = Optional.ofNullable(invitationList); + return this; + } + + /** + * List of invitations + */ + public Builder invitationList(Optional> invitationList) { + Utils.checkNotNull(invitationList, "invitationList"); + this.invitationList = invitationList; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public ListInvitationsResponse build() { + return new ListInvitationsResponse( + contentType, + statusCode, + rawResponse, + invitationList) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListJWTTemplatesRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListJWTTemplatesRequestBuilder.java new file mode 100644 index 0000000..c33b74e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListJWTTemplatesRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListJWTTemplatesRequestBuilder { + + private final SDKMethodInterfaces.MethodCallListJWTTemplates sdk; + + public ListJWTTemplatesRequestBuilder(SDKMethodInterfaces.MethodCallListJWTTemplates sdk) { + this.sdk = sdk; + } + + public ListJWTTemplatesResponse call() throws Exception { + + return sdk.listDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListJWTTemplatesResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListJWTTemplatesResponse.java new file mode 100644 index 0000000..0150436 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListJWTTemplatesResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class ListJWTTemplatesResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * List of JWT templates + */ + private Optional> jwtTemplateList; + + @JsonCreator + public ListJWTTemplatesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> jwtTemplateList) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(jwtTemplateList, "jwtTemplateList"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.jwtTemplateList = jwtTemplateList; + } + + public ListJWTTemplatesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * List of JWT templates + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> jwtTemplateList() { + return (Optional>) jwtTemplateList; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListJWTTemplatesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListJWTTemplatesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListJWTTemplatesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of JWT templates + */ + public ListJWTTemplatesResponse withJWTTemplateList(java.util.List jwtTemplateList) { + Utils.checkNotNull(jwtTemplateList, "jwtTemplateList"); + this.jwtTemplateList = Optional.ofNullable(jwtTemplateList); + return this; + } + + /** + * List of JWT templates + */ + public ListJWTTemplatesResponse withJWTTemplateList(Optional> jwtTemplateList) { + Utils.checkNotNull(jwtTemplateList, "jwtTemplateList"); + this.jwtTemplateList = jwtTemplateList; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListJWTTemplatesResponse other = (ListJWTTemplatesResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.jwtTemplateList, other.jwtTemplateList); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + jwtTemplateList); + } + + @Override + public String toString() { + return Utils.toString(ListJWTTemplatesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "jwtTemplateList", jwtTemplateList); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> jwtTemplateList = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of JWT templates + */ + public Builder jwtTemplateList(java.util.List jwtTemplateList) { + Utils.checkNotNull(jwtTemplateList, "jwtTemplateList"); + this.jwtTemplateList = Optional.ofNullable(jwtTemplateList); + return this; + } + + /** + * List of JWT templates + */ + public Builder jwtTemplateList(Optional> jwtTemplateList) { + Utils.checkNotNull(jwtTemplateList, "jwtTemplateList"); + this.jwtTemplateList = jwtTemplateList; + return this; + } + + public ListJWTTemplatesResponse build() { + return new ListJWTTemplatesResponse( + contentType, + statusCode, + rawResponse, + jwtTemplateList); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsRequest.java b/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsRequest.java new file mode 100644 index 0000000..b738fa5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsRequest.java @@ -0,0 +1,223 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ListOAuthApplicationsRequest { + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + @JsonCreator + public ListOAuthApplicationsRequest( + Optional limit, + Optional offset) { + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + this.limit = limit; + this.offset = offset; + } + + public ListOAuthApplicationsRequest() { + this(Optional.empty(), Optional.empty()); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListOAuthApplicationsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListOAuthApplicationsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListOAuthApplicationsRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListOAuthApplicationsRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOAuthApplicationsRequest other = (ListOAuthApplicationsRequest) o; + return + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + limit, + offset); + } + + @Override + public String toString() { + return Utils.toString(ListOAuthApplicationsRequest.class, + "limit", limit, + "offset", offset); + } + + public final static class Builder { + + private Optional limit; + + private Optional offset; + + private Builder() { + // force use of static builder() method + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListOAuthApplicationsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new ListOAuthApplicationsRequest( + limit, + offset); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsRequestBuilder.java new file mode 100644 index 0000000..e017fbb --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsRequestBuilder.java @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListOAuthApplicationsRequestBuilder { + + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "10", + new TypeReference>() {}); + private Optional offset = Utils.readDefaultOrConstValue( + "offset", + "0", + new TypeReference>() {}); + private final SDKMethodInterfaces.MethodCallListOAuthApplications sdk; + + public ListOAuthApplicationsRequestBuilder(SDKMethodInterfaces.MethodCallListOAuthApplications sdk) { + this.sdk = sdk; + } + + public ListOAuthApplicationsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public ListOAuthApplicationsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListOAuthApplicationsRequestBuilder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.of(offset); + return this; + } + + public ListOAuthApplicationsRequestBuilder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListOAuthApplicationsResponse call() throws Exception { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + + return sdk.list( + limit, + offset); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsResponse.java new file mode 100644 index 0000000..46e7944 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOAuthApplicationsResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class ListOAuthApplicationsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of OAuth applications + */ + private Optional oAuthApplications; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public ListOAuthApplicationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional oAuthApplications) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(oAuthApplications, "oAuthApplications"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.oAuthApplications = oAuthApplications; + } + + public ListOAuthApplicationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of OAuth applications + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional oAuthApplications() { + return (Optional) oAuthApplications; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private ListOAuthApplicationsResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListOAuthApplicationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListOAuthApplicationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListOAuthApplicationsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of OAuth applications + */ + public ListOAuthApplicationsResponse withOAuthApplications(com.clerk.backend_api.models.components.OAuthApplications oAuthApplications) { + Utils.checkNotNull(oAuthApplications, "oAuthApplications"); + this.oAuthApplications = Optional.ofNullable(oAuthApplications); + return this; + } + + /** + * A list of OAuth applications + */ + public ListOAuthApplicationsResponse withOAuthApplications(Optional oAuthApplications) { + Utils.checkNotNull(oAuthApplications, "oAuthApplications"); + this.oAuthApplications = oAuthApplications; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOAuthApplicationsResponse other = (ListOAuthApplicationsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.oAuthApplications, other.oAuthApplications); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + oAuthApplications); + } + + @Override + public String toString() { + return Utils.toString(ListOAuthApplicationsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "oAuthApplications", oAuthApplications); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional oAuthApplications = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of OAuth applications + */ + public Builder oAuthApplications(com.clerk.backend_api.models.components.OAuthApplications oAuthApplications) { + Utils.checkNotNull(oAuthApplications, "oAuthApplications"); + this.oAuthApplications = Optional.ofNullable(oAuthApplications); + return this; + } + + /** + * A list of OAuth applications + */ + public Builder oAuthApplications(Optional oAuthApplications) { + Utils.checkNotNull(oAuthApplications, "oAuthApplications"); + this.oAuthApplications = oAuthApplications; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public ListOAuthApplicationsResponse build() { + return new ListOAuthApplicationsResponse( + contentType, + statusCode, + rawResponse, + oAuthApplications) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsQueryParamStatus.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsQueryParamStatus.java new file mode 100644 index 0000000..8bc174a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsQueryParamStatus.java @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * ListOrganizationInvitationsQueryParamStatus - Filter organization invitations based on their status + */ +public enum ListOrganizationInvitationsQueryParamStatus { + PENDING("pending"), + ACCEPTED("accepted"), + REVOKED("revoked"); + + @JsonValue + private final String value; + + private ListOrganizationInvitationsQueryParamStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsRequest.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsRequest.java new file mode 100644 index 0000000..dce3440 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsRequest.java @@ -0,0 +1,325 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ListOrganizationInvitationsRequest { + + /** + * The organization ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + /** + * Filter organization invitations based on their status + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=status") + private Optional status; + + @JsonCreator + public ListOrganizationInvitationsRequest( + String organizationId, + Optional limit, + Optional offset, + Optional status) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + Utils.checkNotNull(status, "status"); + this.organizationId = organizationId; + this.limit = limit; + this.offset = offset; + this.status = status; + } + + public ListOrganizationInvitationsRequest( + String organizationId) { + this(organizationId, Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The organization ID. + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + /** + * Filter organization invitations based on their status + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The organization ID. + */ + public ListOrganizationInvitationsRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListOrganizationInvitationsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListOrganizationInvitationsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListOrganizationInvitationsRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListOrganizationInvitationsRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * Filter organization invitations based on their status + */ + public ListOrganizationInvitationsRequest withStatus(ListOrganizationInvitationsQueryParamStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Filter organization invitations based on their status + */ + public ListOrganizationInvitationsRequest withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOrganizationInvitationsRequest other = (ListOrganizationInvitationsRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + limit, + offset, + status); + } + + @Override + public String toString() { + return Utils.toString(ListOrganizationInvitationsRequest.class, + "organizationId", organizationId, + "limit", limit, + "offset", offset, + "status", status); + } + + public final static class Builder { + + private String organizationId; + + private Optional limit; + + private Optional offset; + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The organization ID. + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * Filter organization invitations based on their status + */ + public Builder status(ListOrganizationInvitationsQueryParamStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Filter organization invitations based on their status + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public ListOrganizationInvitationsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new ListOrganizationInvitationsRequest( + organizationId, + limit, + offset, + status); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsRequestBuilder.java new file mode 100644 index 0000000..2f07f94 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsRequestBuilder.java @@ -0,0 +1,127 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListOrganizationInvitationsRequestBuilder { + + private String organizationId; + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "10", + new TypeReference>() {}); + private Optional offset = Utils.readDefaultOrConstValue( + "offset", + "0", + new TypeReference>() {}); + private Optional status = Optional.empty(); + private final SDKMethodInterfaces.MethodCallListOrganizationInvitations sdk; + + public ListOrganizationInvitationsRequestBuilder(SDKMethodInterfaces.MethodCallListOrganizationInvitations sdk) { + this.sdk = sdk; + } + + public ListOrganizationInvitationsRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public ListOrganizationInvitationsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public ListOrganizationInvitationsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListOrganizationInvitationsRequestBuilder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.of(offset); + return this; + } + + public ListOrganizationInvitationsRequestBuilder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListOrganizationInvitationsRequestBuilder status(ListOrganizationInvitationsQueryParamStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.of(status); + return this; + } + + public ListOrganizationInvitationsRequestBuilder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public ListOrganizationInvitationsResponse call() throws Exception { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + + return sdk.list( + organizationId, + limit, + offset, + status); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsResponse.java new file mode 100644 index 0000000..b2f1f17 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationInvitationsResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class ListOrganizationInvitationsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of organization invitations + */ + private Optional organizationInvitations; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public ListOrganizationInvitationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationInvitations) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationInvitations = organizationInvitations; + } + + public ListOrganizationInvitationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of organization invitations + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationInvitations() { + return (Optional) organizationInvitations; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private ListOrganizationInvitationsResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListOrganizationInvitationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListOrganizationInvitationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListOrganizationInvitationsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization invitations + */ + public ListOrganizationInvitationsResponse withOrganizationInvitations(com.clerk.backend_api.models.components.OrganizationInvitations organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = Optional.ofNullable(organizationInvitations); + return this; + } + + /** + * A list of organization invitations + */ + public ListOrganizationInvitationsResponse withOrganizationInvitations(Optional organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = organizationInvitations; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOrganizationInvitationsResponse other = (ListOrganizationInvitationsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationInvitations, other.organizationInvitations); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationInvitations); + } + + @Override + public String toString() { + return Utils.toString(ListOrganizationInvitationsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationInvitations", organizationInvitations); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationInvitations = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization invitations + */ + public Builder organizationInvitations(com.clerk.backend_api.models.components.OrganizationInvitations organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = Optional.ofNullable(organizationInvitations); + return this; + } + + /** + * A list of organization invitations + */ + public Builder organizationInvitations(Optional organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = organizationInvitations; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public ListOrganizationInvitationsResponse build() { + return new ListOrganizationInvitationsResponse( + contentType, + statusCode, + rawResponse, + organizationInvitations) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsRequest.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsRequest.java new file mode 100644 index 0000000..487c724 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsRequest.java @@ -0,0 +1,337 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ListOrganizationMembershipsRequest { + + /** + * The organization ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + /** + * Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + * By prepending one of those values with + or -, + * we can choose to sort in ascending (ASC) or descending (DESC) order." + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=order_by") + private Optional orderBy; + + @JsonCreator + public ListOrganizationMembershipsRequest( + String organizationId, + Optional limit, + Optional offset, + Optional orderBy) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + Utils.checkNotNull(orderBy, "orderBy"); + this.organizationId = organizationId; + this.limit = limit; + this.offset = offset; + this.orderBy = orderBy; + } + + public ListOrganizationMembershipsRequest( + String organizationId) { + this(organizationId, Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The organization ID. + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + /** + * Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + * By prepending one of those values with + or -, + * we can choose to sort in ascending (ASC) or descending (DESC) order." + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional orderBy() { + return (Optional) orderBy; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The organization ID. + */ + public ListOrganizationMembershipsRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListOrganizationMembershipsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListOrganizationMembershipsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListOrganizationMembershipsRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListOrganizationMembershipsRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + * By prepending one of those values with + or -, + * we can choose to sort in ascending (ASC) or descending (DESC) order." + */ + public ListOrganizationMembershipsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + * By prepending one of those values with + or -, + * we can choose to sort in ascending (ASC) or descending (DESC) order." + */ + public ListOrganizationMembershipsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOrganizationMembershipsRequest other = (ListOrganizationMembershipsRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + limit, + offset, + orderBy); + } + + @Override + public String toString() { + return Utils.toString(ListOrganizationMembershipsRequest.class, + "organizationId", organizationId, + "limit", limit, + "offset", offset, + "orderBy", orderBy); + } + + public final static class Builder { + + private String organizationId; + + private Optional limit; + + private Optional offset; + + private Optional orderBy = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The organization ID. + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + * By prepending one of those values with + or -, + * we can choose to sort in ascending (ASC) or descending (DESC) order." + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. + * By prepending one of those values with + or -, + * we can choose to sort in ascending (ASC) or descending (DESC) order." + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + public ListOrganizationMembershipsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new ListOrganizationMembershipsRequest( + organizationId, + limit, + offset, + orderBy); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsRequestBuilder.java new file mode 100644 index 0000000..1ddac50 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsRequestBuilder.java @@ -0,0 +1,127 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListOrganizationMembershipsRequestBuilder { + + private String organizationId; + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "10", + new TypeReference>() {}); + private Optional offset = Utils.readDefaultOrConstValue( + "offset", + "0", + new TypeReference>() {}); + private Optional orderBy = Optional.empty(); + private final SDKMethodInterfaces.MethodCallListOrganizationMemberships sdk; + + public ListOrganizationMembershipsRequestBuilder(SDKMethodInterfaces.MethodCallListOrganizationMemberships sdk) { + this.sdk = sdk; + } + + public ListOrganizationMembershipsRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public ListOrganizationMembershipsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public ListOrganizationMembershipsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListOrganizationMembershipsRequestBuilder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.of(offset); + return this; + } + + public ListOrganizationMembershipsRequestBuilder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListOrganizationMembershipsRequestBuilder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.of(orderBy); + return this; + } + + public ListOrganizationMembershipsRequestBuilder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + public ListOrganizationMembershipsResponse call() throws Exception { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + + return sdk.list( + organizationId, + limit, + offset, + orderBy); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsResponse.java new file mode 100644 index 0000000..a09a14a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationMembershipsResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class ListOrganizationMembershipsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of organization memberships + */ + private Optional organizationMemberships; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public ListOrganizationMembershipsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationMemberships) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationMemberships = organizationMemberships; + } + + public ListOrganizationMembershipsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of organization memberships + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationMemberships() { + return (Optional) organizationMemberships; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private ListOrganizationMembershipsResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListOrganizationMembershipsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListOrganizationMembershipsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListOrganizationMembershipsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization memberships + */ + public ListOrganizationMembershipsResponse withOrganizationMemberships(com.clerk.backend_api.models.components.OrganizationMemberships organizationMemberships) { + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.organizationMemberships = Optional.ofNullable(organizationMemberships); + return this; + } + + /** + * A list of organization memberships + */ + public ListOrganizationMembershipsResponse withOrganizationMemberships(Optional organizationMemberships) { + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.organizationMemberships = organizationMemberships; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOrganizationMembershipsResponse other = (ListOrganizationMembershipsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationMemberships, other.organizationMemberships); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationMemberships); + } + + @Override + public String toString() { + return Utils.toString(ListOrganizationMembershipsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationMemberships", organizationMemberships); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationMemberships = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization memberships + */ + public Builder organizationMemberships(com.clerk.backend_api.models.components.OrganizationMemberships organizationMemberships) { + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.organizationMemberships = Optional.ofNullable(organizationMemberships); + return this; + } + + /** + * A list of organization memberships + */ + public Builder organizationMemberships(Optional organizationMemberships) { + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.organizationMemberships = organizationMemberships; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public ListOrganizationMembershipsResponse build() { + return new ListOrganizationMembershipsResponse( + contentType, + statusCode, + rawResponse, + organizationMemberships) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsRequest.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsRequest.java new file mode 100644 index 0000000..021850d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsRequest.java @@ -0,0 +1,448 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ListOrganizationsRequest { + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + /** + * Flag to denote whether the member counts of each organization should be included in the response or not. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=include_members_count") + private Optional includeMembersCount; + + /** + * Returns organizations with ID, name, or slug that match the given query. + * Uses exact match for organization ID and partial match for name and slug. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + /** + * Allows to return organizations in a particular order. + * At the moment, you can order the returned organizations either by their `name`, `created_at` or `members_count`. + * In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + * For example, if you want organizations to be returned in descending order according to their `created_at` property, you can use `-created_at`. + * If you don't use `+` or `-`, then `+` is implied. + * Defaults to `-created_at`. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=order_by") + private Optional orderBy; + + @JsonCreator + public ListOrganizationsRequest( + Optional limit, + Optional offset, + Optional includeMembersCount, + Optional query, + Optional orderBy) { + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + Utils.checkNotNull(includeMembersCount, "includeMembersCount"); + Utils.checkNotNull(query, "query"); + Utils.checkNotNull(orderBy, "orderBy"); + this.limit = limit; + this.offset = offset; + this.includeMembersCount = includeMembersCount; + this.query = query; + this.orderBy = orderBy; + } + + public ListOrganizationsRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + /** + * Flag to denote whether the member counts of each organization should be included in the response or not. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional includeMembersCount() { + return (Optional) includeMembersCount; + } + + /** + * Returns organizations with ID, name, or slug that match the given query. + * Uses exact match for organization ID and partial match for name and slug. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional query() { + return (Optional) query; + } + + /** + * Allows to return organizations in a particular order. + * At the moment, you can order the returned organizations either by their `name`, `created_at` or `members_count`. + * In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + * For example, if you want organizations to be returned in descending order according to their `created_at` property, you can use `-created_at`. + * If you don't use `+` or `-`, then `+` is implied. + * Defaults to `-created_at`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional orderBy() { + return (Optional) orderBy; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListOrganizationsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListOrganizationsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListOrganizationsRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListOrganizationsRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * Flag to denote whether the member counts of each organization should be included in the response or not. + */ + public ListOrganizationsRequest withIncludeMembersCount(boolean includeMembersCount) { + Utils.checkNotNull(includeMembersCount, "includeMembersCount"); + this.includeMembersCount = Optional.ofNullable(includeMembersCount); + return this; + } + + /** + * Flag to denote whether the member counts of each organization should be included in the response or not. + */ + public ListOrganizationsRequest withIncludeMembersCount(Optional includeMembersCount) { + Utils.checkNotNull(includeMembersCount, "includeMembersCount"); + this.includeMembersCount = includeMembersCount; + return this; + } + + /** + * Returns organizations with ID, name, or slug that match the given query. + * Uses exact match for organization ID and partial match for name and slug. + */ + public ListOrganizationsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Returns organizations with ID, name, or slug that match the given query. + * Uses exact match for organization ID and partial match for name and slug. + */ + public ListOrganizationsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + /** + * Allows to return organizations in a particular order. + * At the moment, you can order the returned organizations either by their `name`, `created_at` or `members_count`. + * In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + * For example, if you want organizations to be returned in descending order according to their `created_at` property, you can use `-created_at`. + * If you don't use `+` or `-`, then `+` is implied. + * Defaults to `-created_at`. + */ + public ListOrganizationsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Allows to return organizations in a particular order. + * At the moment, you can order the returned organizations either by their `name`, `created_at` or `members_count`. + * In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + * For example, if you want organizations to be returned in descending order according to their `created_at` property, you can use `-created_at`. + * If you don't use `+` or `-`, then `+` is implied. + * Defaults to `-created_at`. + */ + public ListOrganizationsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOrganizationsRequest other = (ListOrganizationsRequest) o; + return + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset) && + java.util.Objects.deepEquals(this.includeMembersCount, other.includeMembersCount) && + java.util.Objects.deepEquals(this.query, other.query) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + limit, + offset, + includeMembersCount, + query, + orderBy); + } + + @Override + public String toString() { + return Utils.toString(ListOrganizationsRequest.class, + "limit", limit, + "offset", offset, + "includeMembersCount", includeMembersCount, + "query", query, + "orderBy", orderBy); + } + + public final static class Builder { + + private Optional limit; + + private Optional offset; + + private Optional includeMembersCount = Optional.empty(); + + private Optional query = Optional.empty(); + + private Optional orderBy; + + private Builder() { + // force use of static builder() method + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + /** + * Flag to denote whether the member counts of each organization should be included in the response or not. + */ + public Builder includeMembersCount(boolean includeMembersCount) { + Utils.checkNotNull(includeMembersCount, "includeMembersCount"); + this.includeMembersCount = Optional.ofNullable(includeMembersCount); + return this; + } + + /** + * Flag to denote whether the member counts of each organization should be included in the response or not. + */ + public Builder includeMembersCount(Optional includeMembersCount) { + Utils.checkNotNull(includeMembersCount, "includeMembersCount"); + this.includeMembersCount = includeMembersCount; + return this; + } + + /** + * Returns organizations with ID, name, or slug that match the given query. + * Uses exact match for organization ID and partial match for name and slug. + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Returns organizations with ID, name, or slug that match the given query. + * Uses exact match for organization ID and partial match for name and slug. + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + /** + * Allows to return organizations in a particular order. + * At the moment, you can order the returned organizations either by their `name`, `created_at` or `members_count`. + * In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + * For example, if you want organizations to be returned in descending order according to their `created_at` property, you can use `-created_at`. + * If you don't use `+` or `-`, then `+` is implied. + * Defaults to `-created_at`. + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Allows to return organizations in a particular order. + * At the moment, you can order the returned organizations either by their `name`, `created_at` or `members_count`. + * In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + * For example, if you want organizations to be returned in descending order according to their `created_at` property, you can use `-created_at`. + * If you don't use `+` or `-`, then `+` is implied. + * Defaults to `-created_at`. + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + public ListOrganizationsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + if (orderBy == null) { + orderBy = _SINGLETON_VALUE_OrderBy.value(); + } + return new ListOrganizationsRequest( + limit, + offset, + includeMembersCount, + query, + orderBy); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_OrderBy = + new LazySingletonValue<>( + "order_by", + "\"-created_at\"", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsRequestBuilder.java new file mode 100644 index 0000000..514c96c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsRequestBuilder.java @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListOrganizationsRequestBuilder { + + private ListOrganizationsRequest request; + private final SDKMethodInterfaces.MethodCallListOrganizations sdk; + + public ListOrganizationsRequestBuilder(SDKMethodInterfaces.MethodCallListOrganizations sdk) { + this.sdk = sdk; + } + + public ListOrganizationsRequestBuilder request(ListOrganizationsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListOrganizationsResponse call() throws Exception { + + return sdk.list( + request); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsResponse.java new file mode 100644 index 0000000..05645dd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListOrganizationsResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class ListOrganizationsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of organizations + */ + private Optional organizations; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public ListOrganizationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizations) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizations, "organizations"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizations = organizations; + } + + public ListOrganizationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of organizations + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizations() { + return (Optional) organizations; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private ListOrganizationsResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListOrganizationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListOrganizationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListOrganizationsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organizations + */ + public ListOrganizationsResponse withOrganizations(com.clerk.backend_api.models.components.Organizations organizations) { + Utils.checkNotNull(organizations, "organizations"); + this.organizations = Optional.ofNullable(organizations); + return this; + } + + /** + * A list of organizations + */ + public ListOrganizationsResponse withOrganizations(Optional organizations) { + Utils.checkNotNull(organizations, "organizations"); + this.organizations = organizations; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOrganizationsResponse other = (ListOrganizationsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizations, other.organizations); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizations); + } + + @Override + public String toString() { + return Utils.toString(ListOrganizationsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizations", organizations); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizations = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organizations + */ + public Builder organizations(com.clerk.backend_api.models.components.Organizations organizations) { + Utils.checkNotNull(organizations, "organizations"); + this.organizations = Optional.ofNullable(organizations); + return this; + } + + /** + * A list of organizations + */ + public Builder organizations(Optional organizations) { + Utils.checkNotNull(organizations, "organizations"); + this.organizations = organizations; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public ListOrganizationsResponse build() { + return new ListOrganizationsResponse( + contentType, + statusCode, + rawResponse, + organizations) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsRequest.java b/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsRequest.java new file mode 100644 index 0000000..e15c45d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsRequest.java @@ -0,0 +1,265 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ListPendingOrganizationInvitationsRequest { + + /** + * The organization ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + @JsonCreator + public ListPendingOrganizationInvitationsRequest( + String organizationId, + Optional limit, + Optional offset) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + this.organizationId = organizationId; + this.limit = limit; + this.offset = offset; + } + + public ListPendingOrganizationInvitationsRequest( + String organizationId) { + this(organizationId, Optional.empty(), Optional.empty()); + } + + /** + * The organization ID. + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The organization ID. + */ + public ListPendingOrganizationInvitationsRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListPendingOrganizationInvitationsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListPendingOrganizationInvitationsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListPendingOrganizationInvitationsRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListPendingOrganizationInvitationsRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListPendingOrganizationInvitationsRequest other = (ListPendingOrganizationInvitationsRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + limit, + offset); + } + + @Override + public String toString() { + return Utils.toString(ListPendingOrganizationInvitationsRequest.class, + "organizationId", organizationId, + "limit", limit, + "offset", offset); + } + + public final static class Builder { + + private String organizationId; + + private Optional limit; + + private Optional offset; + + private Builder() { + // force use of static builder() method + } + + /** + * The organization ID. + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListPendingOrganizationInvitationsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new ListPendingOrganizationInvitationsRequest( + organizationId, + limit, + offset); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsRequestBuilder.java new file mode 100644 index 0000000..a5c5ecf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsRequestBuilder.java @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListPendingOrganizationInvitationsRequestBuilder { + + private String organizationId; + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "10", + new TypeReference>() {}); + private Optional offset = Utils.readDefaultOrConstValue( + "offset", + "0", + new TypeReference>() {}); + private final SDKMethodInterfaces.MethodCallListPendingOrganizationInvitations sdk; + + public ListPendingOrganizationInvitationsRequestBuilder(SDKMethodInterfaces.MethodCallListPendingOrganizationInvitations sdk) { + this.sdk = sdk; + } + + public ListPendingOrganizationInvitationsRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public ListPendingOrganizationInvitationsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public ListPendingOrganizationInvitationsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListPendingOrganizationInvitationsRequestBuilder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.of(offset); + return this; + } + + public ListPendingOrganizationInvitationsRequestBuilder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListPendingOrganizationInvitationsResponse call() throws Exception { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + + return sdk.listPending( + organizationId, + limit, + offset); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsResponse.java new file mode 100644 index 0000000..c0a4540 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListPendingOrganizationInvitationsResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class ListPendingOrganizationInvitationsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of organization invitations + */ + private Optional organizationInvitations; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public ListPendingOrganizationInvitationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationInvitations) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationInvitations = organizationInvitations; + } + + public ListPendingOrganizationInvitationsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of organization invitations + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationInvitations() { + return (Optional) organizationInvitations; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private ListPendingOrganizationInvitationsResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListPendingOrganizationInvitationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListPendingOrganizationInvitationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListPendingOrganizationInvitationsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization invitations + */ + public ListPendingOrganizationInvitationsResponse withOrganizationInvitations(com.clerk.backend_api.models.components.OrganizationInvitations organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = Optional.ofNullable(organizationInvitations); + return this; + } + + /** + * A list of organization invitations + */ + public ListPendingOrganizationInvitationsResponse withOrganizationInvitations(Optional organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = organizationInvitations; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListPendingOrganizationInvitationsResponse other = (ListPendingOrganizationInvitationsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationInvitations, other.organizationInvitations); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationInvitations); + } + + @Override + public String toString() { + return Utils.toString(ListPendingOrganizationInvitationsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationInvitations", organizationInvitations); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationInvitations = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization invitations + */ + public Builder organizationInvitations(com.clerk.backend_api.models.components.OrganizationInvitations organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = Optional.ofNullable(organizationInvitations); + return this; + } + + /** + * A list of organization invitations + */ + public Builder organizationInvitations(Optional organizationInvitations) { + Utils.checkNotNull(organizationInvitations, "organizationInvitations"); + this.organizationInvitations = organizationInvitations; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public ListPendingOrganizationInvitationsResponse build() { + return new ListPendingOrganizationInvitationsResponse( + contentType, + statusCode, + rawResponse, + organizationInvitations) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListRedirectURLsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListRedirectURLsRequestBuilder.java new file mode 100644 index 0000000..9fadc2c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListRedirectURLsRequestBuilder.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListRedirectURLsRequestBuilder { + + private final SDKMethodInterfaces.MethodCallListRedirectURLs sdk; + + public ListRedirectURLsRequestBuilder(SDKMethodInterfaces.MethodCallListRedirectURLs sdk) { + this.sdk = sdk; + } + + public ListRedirectURLsResponse call() throws Exception { + + return sdk.listDirect(); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListRedirectURLsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListRedirectURLsResponse.java new file mode 100644 index 0000000..4c836d0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListRedirectURLsResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class ListRedirectURLsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * List of Redirect URLs + */ + private Optional> redirectURLList; + + @JsonCreator + public ListRedirectURLsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> redirectURLList) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(redirectURLList, "redirectURLList"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.redirectURLList = redirectURLList; + } + + public ListRedirectURLsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * List of Redirect URLs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> redirectURLList() { + return (Optional>) redirectURLList; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListRedirectURLsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListRedirectURLsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListRedirectURLsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of Redirect URLs + */ + public ListRedirectURLsResponse withRedirectURLList(java.util.List redirectURLList) { + Utils.checkNotNull(redirectURLList, "redirectURLList"); + this.redirectURLList = Optional.ofNullable(redirectURLList); + return this; + } + + /** + * List of Redirect URLs + */ + public ListRedirectURLsResponse withRedirectURLList(Optional> redirectURLList) { + Utils.checkNotNull(redirectURLList, "redirectURLList"); + this.redirectURLList = redirectURLList; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListRedirectURLsResponse other = (ListRedirectURLsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.redirectURLList, other.redirectURLList); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + redirectURLList); + } + + @Override + public String toString() { + return Utils.toString(ListRedirectURLsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "redirectURLList", redirectURLList); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> redirectURLList = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of Redirect URLs + */ + public Builder redirectURLList(java.util.List redirectURLList) { + Utils.checkNotNull(redirectURLList, "redirectURLList"); + this.redirectURLList = Optional.ofNullable(redirectURLList); + return this; + } + + /** + * List of Redirect URLs + */ + public Builder redirectURLList(Optional> redirectURLList) { + Utils.checkNotNull(redirectURLList, "redirectURLList"); + this.redirectURLList = redirectURLList; + return this; + } + + public ListRedirectURLsResponse build() { + return new ListRedirectURLsResponse( + contentType, + statusCode, + rawResponse, + redirectURLList); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsRequest.java b/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsRequest.java new file mode 100644 index 0000000..64ed786 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsRequest.java @@ -0,0 +1,223 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ListSAMLConnectionsRequest { + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + @JsonCreator + public ListSAMLConnectionsRequest( + Optional limit, + Optional offset) { + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + this.limit = limit; + this.offset = offset; + } + + public ListSAMLConnectionsRequest() { + this(Optional.empty(), Optional.empty()); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListSAMLConnectionsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public ListSAMLConnectionsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListSAMLConnectionsRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public ListSAMLConnectionsRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListSAMLConnectionsRequest other = (ListSAMLConnectionsRequest) o; + return + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + limit, + offset); + } + + @Override + public String toString() { + return Utils.toString(ListSAMLConnectionsRequest.class, + "limit", limit, + "offset", offset); + } + + public final static class Builder { + + private Optional limit; + + private Optional offset; + + private Builder() { + // force use of static builder() method + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListSAMLConnectionsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new ListSAMLConnectionsRequest( + limit, + offset); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsRequestBuilder.java new file mode 100644 index 0000000..1dab823 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsRequestBuilder.java @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ListSAMLConnectionsRequestBuilder { + + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "10", + new TypeReference>() {}); + private Optional offset = Utils.readDefaultOrConstValue( + "offset", + "0", + new TypeReference>() {}); + private final SDKMethodInterfaces.MethodCallListSAMLConnections sdk; + + public ListSAMLConnectionsRequestBuilder(SDKMethodInterfaces.MethodCallListSAMLConnections sdk) { + this.sdk = sdk; + } + + public ListSAMLConnectionsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public ListSAMLConnectionsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public ListSAMLConnectionsRequestBuilder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.of(offset); + return this; + } + + public ListSAMLConnectionsRequestBuilder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public ListSAMLConnectionsResponse call() throws Exception { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + + return sdk.list( + limit, + offset); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsResponse.java new file mode 100644 index 0000000..07e6897 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ListSAMLConnectionsResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class ListSAMLConnectionsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of SAML Connections + */ + private Optional samlConnections; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public ListSAMLConnectionsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional samlConnections) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(samlConnections, "samlConnections"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.samlConnections = samlConnections; + } + + public ListSAMLConnectionsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of SAML Connections + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional samlConnections() { + return (Optional) samlConnections; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private ListSAMLConnectionsResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListSAMLConnectionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListSAMLConnectionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListSAMLConnectionsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of SAML Connections + */ + public ListSAMLConnectionsResponse withSAMLConnections(com.clerk.backend_api.models.components.SAMLConnections samlConnections) { + Utils.checkNotNull(samlConnections, "samlConnections"); + this.samlConnections = Optional.ofNullable(samlConnections); + return this; + } + + /** + * A list of SAML Connections + */ + public ListSAMLConnectionsResponse withSAMLConnections(Optional samlConnections) { + Utils.checkNotNull(samlConnections, "samlConnections"); + this.samlConnections = samlConnections; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListSAMLConnectionsResponse other = (ListSAMLConnectionsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.samlConnections, other.samlConnections); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + samlConnections); + } + + @Override + public String toString() { + return Utils.toString(ListSAMLConnectionsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "samlConnections", samlConnections); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional samlConnections = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of SAML Connections + */ + public Builder samlConnections(com.clerk.backend_api.models.components.SAMLConnections samlConnections) { + Utils.checkNotNull(samlConnections, "samlConnections"); + this.samlConnections = Optional.ofNullable(samlConnections); + return this; + } + + /** + * A list of SAML Connections + */ + public Builder samlConnections(Optional samlConnections) { + Utils.checkNotNull(samlConnections, "samlConnections"); + this.samlConnections = samlConnections; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public ListSAMLConnectionsResponse build() { + return new ListSAMLConnectionsResponse( + contentType, + statusCode, + rawResponse, + samlConnections) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/LockUserRequest.java b/src/main/java/com/clerk/backend_api/models/operations/LockUserRequest.java new file mode 100644 index 0000000..7359ebd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/LockUserRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class LockUserRequest { + + /** + * The ID of the user to lock + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public LockUserRequest( + String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + /** + * The ID of the user to lock + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to lock + */ + public LockUserRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LockUserRequest other = (LockUserRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(LockUserRequest.class, + "userId", userId); + } + + public final static class Builder { + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to lock + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public LockUserRequest build() { + return new LockUserRequest( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/LockUserRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/LockUserRequestBuilder.java new file mode 100644 index 0000000..8da3ec1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/LockUserRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class LockUserRequestBuilder { + + private String userId; + private final SDKMethodInterfaces.MethodCallLockUser sdk; + + public LockUserRequestBuilder(SDKMethodInterfaces.MethodCallLockUser sdk) { + this.sdk = sdk; + } + + public LockUserRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public LockUserResponse call() throws Exception { + + return sdk.lock( + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/LockUserResponse.java b/src/main/java/com/clerk/backend_api/models/operations/LockUserResponse.java new file mode 100644 index 0000000..e2afa6f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/LockUserResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class LockUserResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public LockUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public LockUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public LockUserResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public LockUserResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LockUserResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public LockUserResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public LockUserResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LockUserResponse other = (LockUserResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(LockUserResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public LockUserResponse build() { + return new LockUserResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataPrivateMetadata.java new file mode 100644 index 0000000..a3a0e4f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataPrivateMetadata.java @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * MergeOrganizationMetadataPrivateMetadata - Metadata saved on the organization that is only visible to your backend. + * The new object will be merged with the existing value. + */ + +public class MergeOrganizationMetadataPrivateMetadata { + + @JsonCreator + public MergeOrganizationMetadataPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(MergeOrganizationMetadataPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public MergeOrganizationMetadataPrivateMetadata build() { + return new MergeOrganizationMetadataPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataPublicMetadata.java new file mode 100644 index 0000000..4ae8fe4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataPublicMetadata.java @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * MergeOrganizationMetadataPublicMetadata - Metadata saved on the organization, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + +public class MergeOrganizationMetadataPublicMetadata { + + @JsonCreator + public MergeOrganizationMetadataPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(MergeOrganizationMetadataPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public MergeOrganizationMetadataPublicMetadata build() { + return new MergeOrganizationMetadataPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequest.java b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequest.java new file mode 100644 index 0000000..e9ed4cf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class MergeOrganizationMetadataRequest { + + /** + * The ID of the organization for which metadata will be merged or updated + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private MergeOrganizationMetadataRequestBody requestBody; + + @JsonCreator + public MergeOrganizationMetadataRequest( + String organizationId, + MergeOrganizationMetadataRequestBody requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.requestBody = requestBody; + } + + /** + * The ID of the organization for which metadata will be merged or updated + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + @JsonIgnore + public MergeOrganizationMetadataRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization for which metadata will be merged or updated + */ + public MergeOrganizationMetadataRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public MergeOrganizationMetadataRequest withRequestBody(MergeOrganizationMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeOrganizationMetadataRequest other = (MergeOrganizationMetadataRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(MergeOrganizationMetadataRequest.class, + "organizationId", organizationId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private MergeOrganizationMetadataRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization for which metadata will be merged or updated + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public Builder requestBody(MergeOrganizationMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public MergeOrganizationMetadataRequest build() { + return new MergeOrganizationMetadataRequest( + organizationId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequestBody.java new file mode 100644 index 0000000..4374318 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequestBody.java @@ -0,0 +1,202 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class MergeOrganizationMetadataRequestBody { + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the organization that is only visible to your backend. + * The new object will be merged with the existing value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + @JsonCreator + public MergeOrganizationMetadataRequestBody( + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + } + + public MergeOrganizationMetadataRequestBody() { + this(Optional.empty(), Optional.empty()); + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + * The new object will be merged with the existing value. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public MergeOrganizationMetadataRequestBody withPublicMetadata(MergeOrganizationMetadataPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public MergeOrganizationMetadataRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public MergeOrganizationMetadataRequestBody withPrivateMetadata(MergeOrganizationMetadataPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public MergeOrganizationMetadataRequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeOrganizationMetadataRequestBody other = (MergeOrganizationMetadataRequestBody) o; + return + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + publicMetadata, + privateMetadata); + } + + @Override + public String toString() { + return Utils.toString(MergeOrganizationMetadataRequestBody.class, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata); + } + + public final static class Builder { + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public Builder publicMetadata(MergeOrganizationMetadataPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public Builder privateMetadata(MergeOrganizationMetadataPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public MergeOrganizationMetadataRequestBody build() { + return new MergeOrganizationMetadataRequestBody( + publicMetadata, + privateMetadata); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequestBuilder.java new file mode 100644 index 0000000..ab0eb93 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class MergeOrganizationMetadataRequestBuilder { + + private String organizationId; + private MergeOrganizationMetadataRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallMergeOrganizationMetadata sdk; + + public MergeOrganizationMetadataRequestBuilder(SDKMethodInterfaces.MethodCallMergeOrganizationMetadata sdk) { + this.sdk = sdk; + } + + public MergeOrganizationMetadataRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public MergeOrganizationMetadataRequestBuilder requestBody(MergeOrganizationMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public MergeOrganizationMetadataResponse call() throws Exception { + + return sdk.mergeMetadata( + organizationId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataResponse.java b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataResponse.java new file mode 100644 index 0000000..de9711f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/MergeOrganizationMetadataResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class MergeOrganizationMetadataResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization + */ + private Optional organization; + + @JsonCreator + public MergeOrganizationMetadataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organization) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organization, "organization"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organization = organization; + } + + public MergeOrganizationMetadataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organization() { + return (Optional) organization; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public MergeOrganizationMetadataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public MergeOrganizationMetadataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MergeOrganizationMetadataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public MergeOrganizationMetadataResponse withOrganization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public MergeOrganizationMetadataResponse withOrganization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeOrganizationMetadataResponse other = (MergeOrganizationMetadataResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organization, other.organization); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organization); + } + + @Override + public String toString() { + return Utils.toString(MergeOrganizationMetadataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organization", organization); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organization = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public Builder organization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public Builder organization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + public MergeOrganizationMetadataResponse build() { + return new MergeOrganizationMetadataResponse( + contentType, + statusCode, + rawResponse, + organization); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/Object.java b/src/main/java/com/clerk/backend_api/models/operations/Object.java new file mode 100644 index 0000000..0a51a00 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/Object.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public enum Object { + TOKEN("token"); + + @JsonValue + private final String value; + + private Object(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/PasswordHasher.java b/src/main/java/com/clerk/backend_api/models/operations/PasswordHasher.java new file mode 100644 index 0000000..e526bcb --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PasswordHasher.java @@ -0,0 +1,169 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * PasswordHasher - The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash), [sha256](https://en.wikipedia.org/wiki/SHA-2) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than 1024 bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + * + * **sha256_salted** (insecure): The digest should be a 64-length hex string with a salt. + * + * The format is the following: + * `<hash>$<salt>` + * + * The value is expected to have 2 segments separated by the $ character and include the following information: + * _hash:_ The sha256 hash, a 64-length hex string. + * _salt:_ The salt used to generate the above hash. Must be between 1 and 1024 bits. + */ +public enum PasswordHasher { + ARGON2I("argon2i"), + ARGON2ID("argon2id"), + BCRYPT("bcrypt"), + BCRYPT_SHA256_DJANGO("bcrypt_sha256_django"), + MD5("md5"), + PBKDF2_SHA256("pbkdf2_sha256"), + PBKDF2_SHA512("pbkdf2_sha512"), + PBKDF2_SHA256_DJANGO("pbkdf2_sha256_django"), + PBKDF2_SHA1("pbkdf2_sha1"), + PHPASS("phpass"), + SCRYPT_FIREBASE("scrypt_firebase"), + SCRYPT_WERKZEUG("scrypt_werkzeug"), + SHA256("sha256"), + SHA256_SALTED("sha256_salted"); + + @JsonValue + private final String value; + + private PasswordHasher(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/PathParamTemplateType.java b/src/main/java/com/clerk/backend_api/models/operations/PathParamTemplateType.java new file mode 100644 index 0000000..21f0351 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PathParamTemplateType.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * PathParamTemplateType - The type of templates to retrieve (email or SMS) + */ +public enum PathParamTemplateType { + EMAIL("email"), + SMS("sms"); + + @JsonValue + private final String value; + + private PathParamTemplateType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequest.java b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequest.java new file mode 100644 index 0000000..88dcdf0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequest.java @@ -0,0 +1,210 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class PreviewTemplateRequest { + + /** + * The type of template to preview + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_type") + private String templateType; + + /** + * The slug of the template to preview + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=slug") + private String slug; + + /** + * Required parameters + */ + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public PreviewTemplateRequest( + String templateType, + String slug, + Optional requestBody) { + Utils.checkNotNull(templateType, "templateType"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(requestBody, "requestBody"); + this.templateType = templateType; + this.slug = slug; + this.requestBody = requestBody; + } + + public PreviewTemplateRequest( + String templateType, + String slug) { + this(templateType, slug, Optional.empty()); + } + + /** + * The type of template to preview + */ + @JsonIgnore + public String templateType() { + return templateType; + } + + /** + * The slug of the template to preview + */ + @JsonIgnore + public String slug() { + return slug; + } + + /** + * Required parameters + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The type of template to preview + */ + public PreviewTemplateRequest withTemplateType(String templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug of the template to preview + */ + public PreviewTemplateRequest withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + /** + * Required parameters + */ + public PreviewTemplateRequest withRequestBody(PreviewTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + /** + * Required parameters + */ + public PreviewTemplateRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreviewTemplateRequest other = (PreviewTemplateRequest) o; + return + java.util.Objects.deepEquals(this.templateType, other.templateType) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateType, + slug, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(PreviewTemplateRequest.class, + "templateType", templateType, + "slug", slug, + "requestBody", requestBody); + } + + public final static class Builder { + + private String templateType; + + private String slug; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The type of template to preview + */ + public Builder templateType(String templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug of the template to preview + */ + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + /** + * Required parameters + */ + public Builder requestBody(PreviewTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + /** + * Required parameters + */ + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public PreviewTemplateRequest build() { + return new PreviewTemplateRequest( + templateType, + slug, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequestBody.java new file mode 100644 index 0000000..daa6aca --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequestBody.java @@ -0,0 +1,346 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; +/** + * PreviewTemplateRequestBody - Required parameters + */ + +public class PreviewTemplateRequestBody { + + /** + * The email subject. + * Applicable only to email templates. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subject") + private JsonNullable subject; + + /** + * The template body before variable interpolation + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("body") + private Optional body; + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("from_email_name") + private Optional fromEmailName; + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reply_to_email_name") + private Optional replyToEmailName; + + @JsonCreator + public PreviewTemplateRequestBody( + @JsonProperty("subject") JsonNullable subject, + @JsonProperty("body") Optional body, + @JsonProperty("from_email_name") Optional fromEmailName, + @JsonProperty("reply_to_email_name") Optional replyToEmailName) { + Utils.checkNotNull(subject, "subject"); + Utils.checkNotNull(body, "body"); + Utils.checkNotNull(fromEmailName, "fromEmailName"); + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.subject = subject; + this.body = body; + this.fromEmailName = fromEmailName; + this.replyToEmailName = replyToEmailName; + } + + public PreviewTemplateRequestBody() { + this(JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The email subject. + * Applicable only to email templates. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable subject() { + return (JsonNullable) subject; + } + + /** + * The template body before variable interpolation + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional body() { + return (Optional) body; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional fromEmailName() { + return (Optional) fromEmailName; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional replyToEmailName() { + return (Optional) replyToEmailName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The email subject. + * Applicable only to email templates. + */ + public PreviewTemplateRequestBody withSubject(String subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = JsonNullable.of(subject); + return this; + } + + /** + * The email subject. + * Applicable only to email templates. + */ + public PreviewTemplateRequestBody withSubject(JsonNullable subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = subject; + return this; + } + + /** + * The template body before variable interpolation + */ + public PreviewTemplateRequestBody withBody(String body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + /** + * The template body before variable interpolation + */ + public PreviewTemplateRequestBody withBody(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public PreviewTemplateRequestBody withFromEmailName(String fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = Optional.ofNullable(fromEmailName); + return this; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public PreviewTemplateRequestBody withFromEmailName(Optional fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = fromEmailName; + return this; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public PreviewTemplateRequestBody withReplyToEmailName(String replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = Optional.ofNullable(replyToEmailName); + return this; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public PreviewTemplateRequestBody withReplyToEmailName(Optional replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = replyToEmailName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreviewTemplateRequestBody other = (PreviewTemplateRequestBody) o; + return + java.util.Objects.deepEquals(this.subject, other.subject) && + java.util.Objects.deepEquals(this.body, other.body) && + java.util.Objects.deepEquals(this.fromEmailName, other.fromEmailName) && + java.util.Objects.deepEquals(this.replyToEmailName, other.replyToEmailName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + subject, + body, + fromEmailName, + replyToEmailName); + } + + @Override + public String toString() { + return Utils.toString(PreviewTemplateRequestBody.class, + "subject", subject, + "body", body, + "fromEmailName", fromEmailName, + "replyToEmailName", replyToEmailName); + } + + public final static class Builder { + + private JsonNullable subject = JsonNullable.undefined(); + + private Optional body = Optional.empty(); + + private Optional fromEmailName = Optional.empty(); + + private Optional replyToEmailName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The email subject. + * Applicable only to email templates. + */ + public Builder subject(String subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = JsonNullable.of(subject); + return this; + } + + /** + * The email subject. + * Applicable only to email templates. + */ + public Builder subject(JsonNullable subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = subject; + return this; + } + + /** + * The template body before variable interpolation + */ + public Builder body(String body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + /** + * The template body before variable interpolation + */ + public Builder body(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public Builder fromEmailName(String fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = Optional.ofNullable(fromEmailName); + return this; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public Builder fromEmailName(Optional fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = fromEmailName; + return this; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public Builder replyToEmailName(String replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = Optional.ofNullable(replyToEmailName); + return this; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public Builder replyToEmailName(Optional replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = replyToEmailName; + return this; + } + + public PreviewTemplateRequestBody build() { + return new PreviewTemplateRequestBody( + subject, + body, + fromEmailName, + replyToEmailName); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequestBuilder.java new file mode 100644 index 0000000..986945b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateRequestBuilder.java @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PreviewTemplateRequestBuilder { + + private String templateType; + private String slug; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallPreviewTemplate sdk; + + public PreviewTemplateRequestBuilder(SDKMethodInterfaces.MethodCallPreviewTemplate sdk) { + this.sdk = sdk; + } + + public PreviewTemplateRequestBuilder templateType(String templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + public PreviewTemplateRequestBuilder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public PreviewTemplateRequestBuilder requestBody(PreviewTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public PreviewTemplateRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public PreviewTemplateResponse call() throws Exception { + + return sdk.preview( + templateType, + slug, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateResponse.java new file mode 100644 index 0000000..86f9062 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class PreviewTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * OK + */ + private Optional object; + + @JsonCreator + public PreviewTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public PreviewTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * OK + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public PreviewTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PreviewTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PreviewTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * OK + */ + public PreviewTemplateResponse withObject(PreviewTemplateResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * OK + */ + public PreviewTemplateResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreviewTemplateResponse other = (PreviewTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(PreviewTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * OK + */ + public Builder object(PreviewTemplateResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * OK + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public PreviewTemplateResponse build() { + return new PreviewTemplateResponse( + contentType, + statusCode, + rawResponse, + object); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateResponseBody.java b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateResponseBody.java new file mode 100644 index 0000000..98c2c12 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PreviewTemplateResponseBody.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * PreviewTemplateResponseBody - OK + */ + +public class PreviewTemplateResponseBody { + + @JsonCreator + public PreviewTemplateResponseBody() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(PreviewTemplateResponseBody.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public PreviewTemplateResponseBody build() { + return new PreviewTemplateResponseBody( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/PrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/PrivateMetadata.java new file mode 100644 index 0000000..5f99ad5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PrivateMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * PrivateMetadata - Metadata saved on the user, that is only visible to your Backend API + */ + +public class PrivateMetadata { + + @JsonCreator + public PrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(PrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public PrivateMetadata build() { + return new PrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/Provider.java b/src/main/java/com/clerk/backend_api/models/operations/Provider.java new file mode 100644 index 0000000..a46bd2f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/Provider.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * Provider - The IdP provider of the connection. + */ +public enum Provider { + SAML_CUSTOM("saml_custom"), + SAML_OKTA("saml_okta"), + SAML_GOOGLE("saml_google"), + SAML_MICROSOFT("saml_microsoft"); + + @JsonValue + private final String value; + + private Provider(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/PublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/PublicMetadata.java new file mode 100644 index 0000000..6d43409 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/PublicMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * PublicMetadata - Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + +public class PublicMetadata { + + @JsonCreator + public PublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(PublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public PublicMetadata build() { + return new PublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/QueryParamStatus.java b/src/main/java/com/clerk/backend_api/models/operations/QueryParamStatus.java new file mode 100644 index 0000000..4993e2f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/QueryParamStatus.java @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * QueryParamStatus - Filter invitations based on their status + */ +public enum QueryParamStatus { + PENDING("pending"), + ACCEPTED("accepted"), + REVOKED("revoked"); + + @JsonValue + private final String value; + + private QueryParamStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/RequestBody.java new file mode 100644 index 0000000..03093f1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RequestBody.java @@ -0,0 +1,381 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class RequestBody { + + /** + * The email address of the new member that is going to be invited to the organization + */ + @JsonProperty("email_address") + private String emailAddress; + + /** + * The ID of the user that invites the new member to the organization. + * Must be an administrator in the organization. + */ + @JsonProperty("inviter_user_id") + private String inviterUserId; + + /** + * The role of the new member in the organization. + */ + @JsonProperty("role") + private String role; + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("redirect_url") + private Optional redirectUrl; + + @JsonCreator + public RequestBody( + @JsonProperty("email_address") String emailAddress, + @JsonProperty("inviter_user_id") String inviterUserId, + @JsonProperty("role") String role, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("redirect_url") Optional redirectUrl) { + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(inviterUserId, "inviterUserId"); + Utils.checkNotNull(role, "role"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.emailAddress = emailAddress; + this.inviterUserId = inviterUserId; + this.role = role; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.redirectUrl = redirectUrl; + } + + public RequestBody( + String emailAddress, + String inviterUserId, + String role) { + this(emailAddress, inviterUserId, role, Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The email address of the new member that is going to be invited to the organization + */ + @JsonIgnore + public String emailAddress() { + return emailAddress; + } + + /** + * The ID of the user that invites the new member to the organization. + * Must be an administrator in the organization. + */ + @JsonIgnore + public String inviterUserId() { + return inviterUserId; + } + + /** + * The role of the new member in the organization. + */ + @JsonIgnore + public String role() { + return role; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional redirectUrl() { + return (Optional) redirectUrl; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The email address of the new member that is going to be invited to the organization + */ + public RequestBody withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * The ID of the user that invites the new member to the organization. + * Must be an administrator in the organization. + */ + public RequestBody withInviterUserId(String inviterUserId) { + Utils.checkNotNull(inviterUserId, "inviterUserId"); + this.inviterUserId = inviterUserId; + return this; + } + + /** + * The role of the new member in the organization. + */ + public RequestBody withRole(String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + public RequestBody withPublicMetadata(CreateOrganizationInvitationBulkPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + public RequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + public RequestBody withPrivateMetadata(CreateOrganizationInvitationBulkPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + public RequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + public RequestBody withRedirectUrl(String redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = Optional.ofNullable(redirectUrl); + return this; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + public RequestBody withRedirectUrl(Optional redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = redirectUrl; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestBody other = (RequestBody) o; + return + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.inviterUserId, other.inviterUserId) && + java.util.Objects.deepEquals(this.role, other.role) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.redirectUrl, other.redirectUrl); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + emailAddress, + inviterUserId, + role, + publicMetadata, + privateMetadata, + redirectUrl); + } + + @Override + public String toString() { + return Utils.toString(RequestBody.class, + "emailAddress", emailAddress, + "inviterUserId", inviterUserId, + "role", role, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "redirectUrl", redirectUrl); + } + + public final static class Builder { + + private String emailAddress; + + private String inviterUserId; + + private String role; + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Optional redirectUrl = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The email address of the new member that is going to be invited to the organization + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * The ID of the user that invites the new member to the organization. + * Must be an administrator in the organization. + */ + public Builder inviterUserId(String inviterUserId) { + Utils.checkNotNull(inviterUserId, "inviterUserId"); + this.inviterUserId = inviterUserId; + return this; + } + + /** + * The role of the new member in the organization. + */ + public Builder role(String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + public Builder publicMetadata(CreateOrganizationInvitationBulkPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API. + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + public Builder privateMetadata(CreateOrganizationInvitationBulkPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API. + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + public Builder redirectUrl(String redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = Optional.ofNullable(redirectUrl); + return this; + } + + /** + * Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email. + */ + public Builder redirectUrl(Optional redirectUrl) { + Utils.checkNotNull(redirectUrl, "redirectUrl"); + this.redirectUrl = redirectUrl; + return this; + } + + public RequestBody build() { + return new RequestBody( + emailAddress, + inviterUserId, + role, + publicMetadata, + privateMetadata, + redirectUrl); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ResponseBody.java b/src/main/java/com/clerk/backend_api/models/operations/ResponseBody.java new file mode 100644 index 0000000..de0f289 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ResponseBody.java @@ -0,0 +1,570 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("object") + private Optional object; + + /** + * External account ID + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_account_id") + private Optional externalAccountId; + + /** + * The unique ID of the user in the external provider's system + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("provider_user_id") + private Optional providerUserId; + + /** + * The access token + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("token") + private Optional token; + + /** + * The ID of the provider + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("provider") + private Optional provider; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("label") + private JsonNullable label; + + /** + * The list of scopes that the token is valid for. + * Only present for OAuth 2.0 tokens. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("scopes") + private Optional> scopes; + + /** + * The token secret. Only present for OAuth 1.0 tokens. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("token_secret") + private Optional tokenSecret; + + @JsonCreator + public ResponseBody( + @JsonProperty("object") Optional object, + @JsonProperty("external_account_id") Optional externalAccountId, + @JsonProperty("provider_user_id") Optional providerUserId, + @JsonProperty("token") Optional token, + @JsonProperty("provider") Optional provider, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("label") JsonNullable label, + @JsonProperty("scopes") Optional> scopes, + @JsonProperty("token_secret") Optional tokenSecret) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(externalAccountId, "externalAccountId"); + Utils.checkNotNull(providerUserId, "providerUserId"); + Utils.checkNotNull(token, "token"); + Utils.checkNotNull(provider, "provider"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(label, "label"); + Utils.checkNotNull(scopes, "scopes"); + Utils.checkNotNull(tokenSecret, "tokenSecret"); + this.object = object; + this.externalAccountId = externalAccountId; + this.providerUserId = providerUserId; + this.token = token; + this.provider = provider; + this.publicMetadata = publicMetadata; + this.label = label; + this.scopes = scopes; + this.tokenSecret = tokenSecret; + } + + public ResponseBody() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + /** + * External account ID + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional externalAccountId() { + return (Optional) externalAccountId; + } + + /** + * The unique ID of the user in the external provider's system + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional providerUserId() { + return (Optional) providerUserId; + } + + /** + * The access token + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional token() { + return (Optional) token; + } + + /** + * The ID of the provider + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional provider() { + return (Optional) provider; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable label() { + return (JsonNullable) label; + } + + /** + * The list of scopes that the token is valid for. + * Only present for OAuth 2.0 tokens. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> scopes() { + return (Optional>) scopes; + } + + /** + * The token secret. Only present for OAuth 1.0 tokens. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional tokenSecret() { + return (Optional) tokenSecret; + } + + public final static Builder builder() { + return new Builder(); + } + + public ResponseBody withObject(String object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + public ResponseBody withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + /** + * External account ID + */ + public ResponseBody withExternalAccountId(String externalAccountId) { + Utils.checkNotNull(externalAccountId, "externalAccountId"); + this.externalAccountId = Optional.ofNullable(externalAccountId); + return this; + } + + /** + * External account ID + */ + public ResponseBody withExternalAccountId(Optional externalAccountId) { + Utils.checkNotNull(externalAccountId, "externalAccountId"); + this.externalAccountId = externalAccountId; + return this; + } + + /** + * The unique ID of the user in the external provider's system + */ + public ResponseBody withProviderUserId(String providerUserId) { + Utils.checkNotNull(providerUserId, "providerUserId"); + this.providerUserId = Optional.ofNullable(providerUserId); + return this; + } + + /** + * The unique ID of the user in the external provider's system + */ + public ResponseBody withProviderUserId(Optional providerUserId) { + Utils.checkNotNull(providerUserId, "providerUserId"); + this.providerUserId = providerUserId; + return this; + } + + /** + * The access token + */ + public ResponseBody withToken(String token) { + Utils.checkNotNull(token, "token"); + this.token = Optional.ofNullable(token); + return this; + } + + /** + * The access token + */ + public ResponseBody withToken(Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + /** + * The ID of the provider + */ + public ResponseBody withProvider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = Optional.ofNullable(provider); + return this; + } + + /** + * The ID of the provider + */ + public ResponseBody withProvider(Optional provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + public ResponseBody withPublicMetadata(GetOAuthAccessTokenPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public ResponseBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public ResponseBody withLabel(String label) { + Utils.checkNotNull(label, "label"); + this.label = JsonNullable.of(label); + return this; + } + + public ResponseBody withLabel(JsonNullable label) { + Utils.checkNotNull(label, "label"); + this.label = label; + return this; + } + + /** + * The list of scopes that the token is valid for. + * Only present for OAuth 2.0 tokens. + */ + public ResponseBody withScopes(java.util.List scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * The list of scopes that the token is valid for. + * Only present for OAuth 2.0 tokens. + */ + public ResponseBody withScopes(Optional> scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + /** + * The token secret. Only present for OAuth 1.0 tokens. + */ + public ResponseBody withTokenSecret(String tokenSecret) { + Utils.checkNotNull(tokenSecret, "tokenSecret"); + this.tokenSecret = Optional.ofNullable(tokenSecret); + return this; + } + + /** + * The token secret. Only present for OAuth 1.0 tokens. + */ + public ResponseBody withTokenSecret(Optional tokenSecret) { + Utils.checkNotNull(tokenSecret, "tokenSecret"); + this.tokenSecret = tokenSecret; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseBody other = (ResponseBody) o; + return + java.util.Objects.deepEquals(this.object, other.object) && + java.util.Objects.deepEquals(this.externalAccountId, other.externalAccountId) && + java.util.Objects.deepEquals(this.providerUserId, other.providerUserId) && + java.util.Objects.deepEquals(this.token, other.token) && + java.util.Objects.deepEquals(this.provider, other.provider) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.label, other.label) && + java.util.Objects.deepEquals(this.scopes, other.scopes) && + java.util.Objects.deepEquals(this.tokenSecret, other.tokenSecret); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + object, + externalAccountId, + providerUserId, + token, + provider, + publicMetadata, + label, + scopes, + tokenSecret); + } + + @Override + public String toString() { + return Utils.toString(ResponseBody.class, + "object", object, + "externalAccountId", externalAccountId, + "providerUserId", providerUserId, + "token", token, + "provider", provider, + "publicMetadata", publicMetadata, + "label", label, + "scopes", scopes, + "tokenSecret", tokenSecret); + } + + public final static class Builder { + + private Optional object = Optional.empty(); + + private Optional externalAccountId = Optional.empty(); + + private Optional providerUserId = Optional.empty(); + + private Optional token = Optional.empty(); + + private Optional provider = Optional.empty(); + + private Optional publicMetadata = Optional.empty(); + + private JsonNullable label = JsonNullable.undefined(); + + private Optional> scopes = Optional.empty(); + + private Optional tokenSecret = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder object(String object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + /** + * External account ID + */ + public Builder externalAccountId(String externalAccountId) { + Utils.checkNotNull(externalAccountId, "externalAccountId"); + this.externalAccountId = Optional.ofNullable(externalAccountId); + return this; + } + + /** + * External account ID + */ + public Builder externalAccountId(Optional externalAccountId) { + Utils.checkNotNull(externalAccountId, "externalAccountId"); + this.externalAccountId = externalAccountId; + return this; + } + + /** + * The unique ID of the user in the external provider's system + */ + public Builder providerUserId(String providerUserId) { + Utils.checkNotNull(providerUserId, "providerUserId"); + this.providerUserId = Optional.ofNullable(providerUserId); + return this; + } + + /** + * The unique ID of the user in the external provider's system + */ + public Builder providerUserId(Optional providerUserId) { + Utils.checkNotNull(providerUserId, "providerUserId"); + this.providerUserId = providerUserId; + return this; + } + + /** + * The access token + */ + public Builder token(String token) { + Utils.checkNotNull(token, "token"); + this.token = Optional.ofNullable(token); + return this; + } + + /** + * The access token + */ + public Builder token(Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + /** + * The ID of the provider + */ + public Builder provider(String provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = Optional.ofNullable(provider); + return this; + } + + /** + * The ID of the provider + */ + public Builder provider(Optional provider) { + Utils.checkNotNull(provider, "provider"); + this.provider = provider; + return this; + } + + public Builder publicMetadata(GetOAuthAccessTokenPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + public Builder label(String label) { + Utils.checkNotNull(label, "label"); + this.label = JsonNullable.of(label); + return this; + } + + public Builder label(JsonNullable label) { + Utils.checkNotNull(label, "label"); + this.label = label; + return this; + } + + /** + * The list of scopes that the token is valid for. + * Only present for OAuth 2.0 tokens. + */ + public Builder scopes(java.util.List scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * The list of scopes that the token is valid for. + * Only present for OAuth 2.0 tokens. + */ + public Builder scopes(Optional> scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + /** + * The token secret. Only present for OAuth 1.0 tokens. + */ + public Builder tokenSecret(String tokenSecret) { + Utils.checkNotNull(tokenSecret, "tokenSecret"); + this.tokenSecret = Optional.ofNullable(tokenSecret); + return this; + } + + /** + * The token secret. Only present for OAuth 1.0 tokens. + */ + public Builder tokenSecret(Optional tokenSecret) { + Utils.checkNotNull(tokenSecret, "tokenSecret"); + this.tokenSecret = tokenSecret; + return this; + } + + public ResponseBody build() { + return new ResponseBody( + object, + externalAccountId, + providerUserId, + token, + provider, + publicMetadata, + label, + scopes, + tokenSecret); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevertTemplatePathParamTemplateType.java b/src/main/java/com/clerk/backend_api/models/operations/RevertTemplatePathParamTemplateType.java new file mode 100644 index 0000000..ec2857e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevertTemplatePathParamTemplateType.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * RevertTemplatePathParamTemplateType - The type of template to revert + */ +public enum RevertTemplatePathParamTemplateType { + EMAIL("email"), + SMS("sms"); + + @JsonValue + private final String value; + + private RevertTemplatePathParamTemplateType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateRequest.java b/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateRequest.java new file mode 100644 index 0000000..2bc305d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateRequest.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RevertTemplateRequest { + + /** + * The type of template to revert + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_type") + private RevertTemplatePathParamTemplateType templateType; + + /** + * The slug of the template to revert + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=slug") + private String slug; + + @JsonCreator + public RevertTemplateRequest( + RevertTemplatePathParamTemplateType templateType, + String slug) { + Utils.checkNotNull(templateType, "templateType"); + Utils.checkNotNull(slug, "slug"); + this.templateType = templateType; + this.slug = slug; + } + + /** + * The type of template to revert + */ + @JsonIgnore + public RevertTemplatePathParamTemplateType templateType() { + return templateType; + } + + /** + * The slug of the template to revert + */ + @JsonIgnore + public String slug() { + return slug; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The type of template to revert + */ + public RevertTemplateRequest withTemplateType(RevertTemplatePathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug of the template to revert + */ + public RevertTemplateRequest withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevertTemplateRequest other = (RevertTemplateRequest) o; + return + java.util.Objects.deepEquals(this.templateType, other.templateType) && + java.util.Objects.deepEquals(this.slug, other.slug); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateType, + slug); + } + + @Override + public String toString() { + return Utils.toString(RevertTemplateRequest.class, + "templateType", templateType, + "slug", slug); + } + + public final static class Builder { + + private RevertTemplatePathParamTemplateType templateType; + + private String slug; + + private Builder() { + // force use of static builder() method + } + + /** + * The type of template to revert + */ + public Builder templateType(RevertTemplatePathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug of the template to revert + */ + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public RevertTemplateRequest build() { + return new RevertTemplateRequest( + templateType, + slug); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateRequestBuilder.java new file mode 100644 index 0000000..26013d7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class RevertTemplateRequestBuilder { + + private RevertTemplatePathParamTemplateType templateType; + private String slug; + private final SDKMethodInterfaces.MethodCallRevertTemplate sdk; + + public RevertTemplateRequestBuilder(SDKMethodInterfaces.MethodCallRevertTemplate sdk) { + this.sdk = sdk; + } + + public RevertTemplateRequestBuilder templateType(RevertTemplatePathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + public RevertTemplateRequestBuilder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public RevertTemplateResponse call() throws Exception { + + return sdk.revert( + templateType, + slug); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateResponse.java new file mode 100644 index 0000000..9dc2fc1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevertTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class RevertTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional template; + + @JsonCreator + public RevertTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional template) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(template, "template"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.template = template; + } + + public RevertTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional template() { + return (Optional) template; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RevertTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RevertTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RevertTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public RevertTemplateResponse withTemplate(com.clerk.backend_api.models.components.Template template) { + Utils.checkNotNull(template, "template"); + this.template = Optional.ofNullable(template); + return this; + } + + /** + * Success + */ + public RevertTemplateResponse withTemplate(Optional template) { + Utils.checkNotNull(template, "template"); + this.template = template; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevertTemplateResponse other = (RevertTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.template, other.template); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + template); + } + + @Override + public String toString() { + return Utils.toString(RevertTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "template", template); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional template = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder template(com.clerk.backend_api.models.components.Template template) { + Utils.checkNotNull(template, "template"); + this.template = Optional.ofNullable(template); + return this; + } + + /** + * Success + */ + public Builder template(Optional template) { + Utils.checkNotNull(template, "template"); + this.template = template; + return this; + } + + public RevertTemplateResponse build() { + return new RevertTemplateResponse( + contentType, + statusCode, + rawResponse, + template); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenRequest.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenRequest.java new file mode 100644 index 0000000..aa052ba --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RevokeActorTokenRequest { + + /** + * The ID of the actor token to be revoked. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=actor_token_id") + private String actorTokenId; + + @JsonCreator + public RevokeActorTokenRequest( + String actorTokenId) { + Utils.checkNotNull(actorTokenId, "actorTokenId"); + this.actorTokenId = actorTokenId; + } + + /** + * The ID of the actor token to be revoked. + */ + @JsonIgnore + public String actorTokenId() { + return actorTokenId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the actor token to be revoked. + */ + public RevokeActorTokenRequest withActorTokenId(String actorTokenId) { + Utils.checkNotNull(actorTokenId, "actorTokenId"); + this.actorTokenId = actorTokenId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeActorTokenRequest other = (RevokeActorTokenRequest) o; + return + java.util.Objects.deepEquals(this.actorTokenId, other.actorTokenId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + actorTokenId); + } + + @Override + public String toString() { + return Utils.toString(RevokeActorTokenRequest.class, + "actorTokenId", actorTokenId); + } + + public final static class Builder { + + private String actorTokenId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the actor token to be revoked. + */ + public Builder actorTokenId(String actorTokenId) { + Utils.checkNotNull(actorTokenId, "actorTokenId"); + this.actorTokenId = actorTokenId; + return this; + } + + public RevokeActorTokenRequest build() { + return new RevokeActorTokenRequest( + actorTokenId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenRequestBuilder.java new file mode 100644 index 0000000..b6172b4 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class RevokeActorTokenRequestBuilder { + + private String actorTokenId; + private final SDKMethodInterfaces.MethodCallRevokeActorToken sdk; + + public RevokeActorTokenRequestBuilder(SDKMethodInterfaces.MethodCallRevokeActorToken sdk) { + this.sdk = sdk; + } + + public RevokeActorTokenRequestBuilder actorTokenId(String actorTokenId) { + Utils.checkNotNull(actorTokenId, "actorTokenId"); + this.actorTokenId = actorTokenId; + return this; + } + + public RevokeActorTokenResponse call() throws Exception { + + return sdk.revokeToken( + actorTokenId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenResponse.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenResponse.java new file mode 100644 index 0000000..0cc9342 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeActorTokenResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class RevokeActorTokenResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional actorToken; + + @JsonCreator + public RevokeActorTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional actorToken) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(actorToken, "actorToken"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.actorToken = actorToken; + } + + public RevokeActorTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional actorToken() { + return (Optional) actorToken; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RevokeActorTokenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RevokeActorTokenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RevokeActorTokenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public RevokeActorTokenResponse withActorToken(com.clerk.backend_api.models.components.ActorToken actorToken) { + Utils.checkNotNull(actorToken, "actorToken"); + this.actorToken = Optional.ofNullable(actorToken); + return this; + } + + /** + * Success + */ + public RevokeActorTokenResponse withActorToken(Optional actorToken) { + Utils.checkNotNull(actorToken, "actorToken"); + this.actorToken = actorToken; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeActorTokenResponse other = (RevokeActorTokenResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.actorToken, other.actorToken); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + actorToken); + } + + @Override + public String toString() { + return Utils.toString(RevokeActorTokenResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "actorToken", actorToken); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional actorToken = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder actorToken(com.clerk.backend_api.models.components.ActorToken actorToken) { + Utils.checkNotNull(actorToken, "actorToken"); + this.actorToken = Optional.ofNullable(actorToken); + return this; + } + + /** + * Success + */ + public Builder actorToken(Optional actorToken) { + Utils.checkNotNull(actorToken, "actorToken"); + this.actorToken = actorToken; + return this; + } + + public RevokeActorTokenResponse build() { + return new RevokeActorTokenResponse( + contentType, + statusCode, + rawResponse, + actorToken); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationRequest.java new file mode 100644 index 0000000..ff16219 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RevokeInvitationRequest { + + /** + * The ID of the invitation to be revoked + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=invitation_id") + private String invitationId; + + @JsonCreator + public RevokeInvitationRequest( + String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + } + + /** + * The ID of the invitation to be revoked + */ + @JsonIgnore + public String invitationId() { + return invitationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the invitation to be revoked + */ + public RevokeInvitationRequest withInvitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeInvitationRequest other = (RevokeInvitationRequest) o; + return + java.util.Objects.deepEquals(this.invitationId, other.invitationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + invitationId); + } + + @Override + public String toString() { + return Utils.toString(RevokeInvitationRequest.class, + "invitationId", invitationId); + } + + public final static class Builder { + + private String invitationId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the invitation to be revoked + */ + public Builder invitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + public RevokeInvitationRequest build() { + return new RevokeInvitationRequest( + invitationId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationRequestBuilder.java new file mode 100644 index 0000000..3977828 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class RevokeInvitationRequestBuilder { + + private String invitationId; + private final SDKMethodInterfaces.MethodCallRevokeInvitation sdk; + + public RevokeInvitationRequestBuilder(SDKMethodInterfaces.MethodCallRevokeInvitation sdk) { + this.sdk = sdk; + } + + public RevokeInvitationRequestBuilder invitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + public RevokeInvitationResponse call() throws Exception { + + return sdk.revoke( + invitationId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationResponse.java new file mode 100644 index 0000000..a701339 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeInvitationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class RevokeInvitationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional invitationRevoked; + + @JsonCreator + public RevokeInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional invitationRevoked) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(invitationRevoked, "invitationRevoked"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.invitationRevoked = invitationRevoked; + } + + public RevokeInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional invitationRevoked() { + return (Optional) invitationRevoked; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RevokeInvitationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RevokeInvitationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RevokeInvitationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public RevokeInvitationResponse withInvitationRevoked(com.clerk.backend_api.models.components.InvitationRevoked invitationRevoked) { + Utils.checkNotNull(invitationRevoked, "invitationRevoked"); + this.invitationRevoked = Optional.ofNullable(invitationRevoked); + return this; + } + + /** + * Success + */ + public RevokeInvitationResponse withInvitationRevoked(Optional invitationRevoked) { + Utils.checkNotNull(invitationRevoked, "invitationRevoked"); + this.invitationRevoked = invitationRevoked; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeInvitationResponse other = (RevokeInvitationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.invitationRevoked, other.invitationRevoked); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + invitationRevoked); + } + + @Override + public String toString() { + return Utils.toString(RevokeInvitationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "invitationRevoked", invitationRevoked); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional invitationRevoked = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder invitationRevoked(com.clerk.backend_api.models.components.InvitationRevoked invitationRevoked) { + Utils.checkNotNull(invitationRevoked, "invitationRevoked"); + this.invitationRevoked = Optional.ofNullable(invitationRevoked); + return this; + } + + /** + * Success + */ + public Builder invitationRevoked(Optional invitationRevoked) { + Utils.checkNotNull(invitationRevoked, "invitationRevoked"); + this.invitationRevoked = invitationRevoked; + return this; + } + + public RevokeInvitationResponse build() { + return new RevokeInvitationResponse( + contentType, + statusCode, + rawResponse, + invitationRevoked); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequest.java new file mode 100644 index 0000000..6dcd861 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequest.java @@ -0,0 +1,172 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RevokeOrganizationInvitationRequest { + + /** + * The organization ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + /** + * The organization invitation ID. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=invitation_id") + private String invitationId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private RevokeOrganizationInvitationRequestBody requestBody; + + @JsonCreator + public RevokeOrganizationInvitationRequest( + String organizationId, + String invitationId, + RevokeOrganizationInvitationRequestBody requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(invitationId, "invitationId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.invitationId = invitationId; + this.requestBody = requestBody; + } + + /** + * The organization ID. + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + /** + * The organization invitation ID. + */ + @JsonIgnore + public String invitationId() { + return invitationId; + } + + @JsonIgnore + public RevokeOrganizationInvitationRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The organization ID. + */ + public RevokeOrganizationInvitationRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The organization invitation ID. + */ + public RevokeOrganizationInvitationRequest withInvitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + public RevokeOrganizationInvitationRequest withRequestBody(RevokeOrganizationInvitationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeOrganizationInvitationRequest other = (RevokeOrganizationInvitationRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.invitationId, other.invitationId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + invitationId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(RevokeOrganizationInvitationRequest.class, + "organizationId", organizationId, + "invitationId", invitationId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private String invitationId; + + private RevokeOrganizationInvitationRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The organization ID. + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The organization invitation ID. + */ + public Builder invitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + public Builder requestBody(RevokeOrganizationInvitationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public RevokeOrganizationInvitationRequest build() { + return new RevokeOrganizationInvitationRequest( + organizationId, + invitationId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequestBody.java new file mode 100644 index 0000000..83ac3b9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequestBody.java @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RevokeOrganizationInvitationRequestBody { + + /** + * The ID of the user that revokes the invitation. + * Must be an administrator in the organization. + */ + @JsonProperty("requesting_user_id") + private String requestingUserId; + + @JsonCreator + public RevokeOrganizationInvitationRequestBody( + @JsonProperty("requesting_user_id") String requestingUserId) { + Utils.checkNotNull(requestingUserId, "requestingUserId"); + this.requestingUserId = requestingUserId; + } + + /** + * The ID of the user that revokes the invitation. + * Must be an administrator in the organization. + */ + @JsonIgnore + public String requestingUserId() { + return requestingUserId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user that revokes the invitation. + * Must be an administrator in the organization. + */ + public RevokeOrganizationInvitationRequestBody withRequestingUserId(String requestingUserId) { + Utils.checkNotNull(requestingUserId, "requestingUserId"); + this.requestingUserId = requestingUserId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeOrganizationInvitationRequestBody other = (RevokeOrganizationInvitationRequestBody) o; + return + java.util.Objects.deepEquals(this.requestingUserId, other.requestingUserId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + requestingUserId); + } + + @Override + public String toString() { + return Utils.toString(RevokeOrganizationInvitationRequestBody.class, + "requestingUserId", requestingUserId); + } + + public final static class Builder { + + private String requestingUserId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user that revokes the invitation. + * Must be an administrator in the organization. + */ + public Builder requestingUserId(String requestingUserId) { + Utils.checkNotNull(requestingUserId, "requestingUserId"); + this.requestingUserId = requestingUserId; + return this; + } + + public RevokeOrganizationInvitationRequestBody build() { + return new RevokeOrganizationInvitationRequestBody( + requestingUserId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequestBuilder.java new file mode 100644 index 0000000..0f5f1a1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationRequestBuilder.java @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class RevokeOrganizationInvitationRequestBuilder { + + private String organizationId; + private String invitationId; + private RevokeOrganizationInvitationRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallRevokeOrganizationInvitation sdk; + + public RevokeOrganizationInvitationRequestBuilder(SDKMethodInterfaces.MethodCallRevokeOrganizationInvitation sdk) { + this.sdk = sdk; + } + + public RevokeOrganizationInvitationRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public RevokeOrganizationInvitationRequestBuilder invitationId(String invitationId) { + Utils.checkNotNull(invitationId, "invitationId"); + this.invitationId = invitationId; + return this; + } + + public RevokeOrganizationInvitationRequestBuilder requestBody(RevokeOrganizationInvitationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public RevokeOrganizationInvitationResponse call() throws Exception { + + return sdk.revoke( + organizationId, + invitationId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationResponse.java new file mode 100644 index 0000000..1c8bfa1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeOrganizationInvitationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class RevokeOrganizationInvitationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization invitation + */ + private Optional organizationInvitation; + + @JsonCreator + public RevokeOrganizationInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationInvitation) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationInvitation = organizationInvitation; + } + + public RevokeOrganizationInvitationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization invitation + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationInvitation() { + return (Optional) organizationInvitation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RevokeOrganizationInvitationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RevokeOrganizationInvitationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RevokeOrganizationInvitationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization invitation + */ + public RevokeOrganizationInvitationResponse withOrganizationInvitation(com.clerk.backend_api.models.components.OrganizationInvitation organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = Optional.ofNullable(organizationInvitation); + return this; + } + + /** + * An organization invitation + */ + public RevokeOrganizationInvitationResponse withOrganizationInvitation(Optional organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = organizationInvitation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeOrganizationInvitationResponse other = (RevokeOrganizationInvitationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationInvitation, other.organizationInvitation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationInvitation); + } + + @Override + public String toString() { + return Utils.toString(RevokeOrganizationInvitationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationInvitation", organizationInvitation); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationInvitation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization invitation + */ + public Builder organizationInvitation(com.clerk.backend_api.models.components.OrganizationInvitation organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = Optional.ofNullable(organizationInvitation); + return this; + } + + /** + * An organization invitation + */ + public Builder organizationInvitation(Optional organizationInvitation) { + Utils.checkNotNull(organizationInvitation, "organizationInvitation"); + this.organizationInvitation = organizationInvitation; + return this; + } + + public RevokeOrganizationInvitationResponse build() { + return new RevokeOrganizationInvitationResponse( + contentType, + statusCode, + rawResponse, + organizationInvitation); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionRequest.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionRequest.java new file mode 100644 index 0000000..64a93b6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RevokeSessionRequest { + + /** + * The ID of the session + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=session_id") + private String sessionId; + + @JsonCreator + public RevokeSessionRequest( + String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + } + + /** + * The ID of the session + */ + @JsonIgnore + public String sessionId() { + return sessionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the session + */ + public RevokeSessionRequest withSessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeSessionRequest other = (RevokeSessionRequest) o; + return + java.util.Objects.deepEquals(this.sessionId, other.sessionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + sessionId); + } + + @Override + public String toString() { + return Utils.toString(RevokeSessionRequest.class, + "sessionId", sessionId); + } + + public final static class Builder { + + private String sessionId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the session + */ + public Builder sessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + public RevokeSessionRequest build() { + return new RevokeSessionRequest( + sessionId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionRequestBuilder.java new file mode 100644 index 0000000..861fc50 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class RevokeSessionRequestBuilder { + + private String sessionId; + private final SDKMethodInterfaces.MethodCallRevokeSession sdk; + + public RevokeSessionRequestBuilder(SDKMethodInterfaces.MethodCallRevokeSession sdk) { + this.sdk = sdk; + } + + public RevokeSessionRequestBuilder sessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + public RevokeSessionResponse call() throws Exception { + + return sdk.revoke( + sessionId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionResponse.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionResponse.java new file mode 100644 index 0000000..db4a2c9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeSessionResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class RevokeSessionResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional session; + + @JsonCreator + public RevokeSessionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional session) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(session, "session"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.session = session; + } + + public RevokeSessionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional session() { + return (Optional) session; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RevokeSessionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RevokeSessionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RevokeSessionResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public RevokeSessionResponse withSession(com.clerk.backend_api.models.components.Session session) { + Utils.checkNotNull(session, "session"); + this.session = Optional.ofNullable(session); + return this; + } + + /** + * Success + */ + public RevokeSessionResponse withSession(Optional session) { + Utils.checkNotNull(session, "session"); + this.session = session; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeSessionResponse other = (RevokeSessionResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.session, other.session); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + session); + } + + @Override + public String toString() { + return Utils.toString(RevokeSessionResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "session", session); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional session = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder session(com.clerk.backend_api.models.components.Session session) { + Utils.checkNotNull(session, "session"); + this.session = Optional.ofNullable(session); + return this; + } + + /** + * Success + */ + public Builder session(Optional session) { + Utils.checkNotNull(session, "session"); + this.session = session; + return this; + } + + public RevokeSessionResponse build() { + return new RevokeSessionResponse( + contentType, + statusCode, + rawResponse, + session); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenRequest.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenRequest.java new file mode 100644 index 0000000..5021b70 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RevokeSignInTokenRequest { + + /** + * The ID of the sign-in token to be revoked + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sign_in_token_id") + private String signInTokenId; + + @JsonCreator + public RevokeSignInTokenRequest( + String signInTokenId) { + Utils.checkNotNull(signInTokenId, "signInTokenId"); + this.signInTokenId = signInTokenId; + } + + /** + * The ID of the sign-in token to be revoked + */ + @JsonIgnore + public String signInTokenId() { + return signInTokenId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the sign-in token to be revoked + */ + public RevokeSignInTokenRequest withSignInTokenId(String signInTokenId) { + Utils.checkNotNull(signInTokenId, "signInTokenId"); + this.signInTokenId = signInTokenId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeSignInTokenRequest other = (RevokeSignInTokenRequest) o; + return + java.util.Objects.deepEquals(this.signInTokenId, other.signInTokenId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + signInTokenId); + } + + @Override + public String toString() { + return Utils.toString(RevokeSignInTokenRequest.class, + "signInTokenId", signInTokenId); + } + + public final static class Builder { + + private String signInTokenId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the sign-in token to be revoked + */ + public Builder signInTokenId(String signInTokenId) { + Utils.checkNotNull(signInTokenId, "signInTokenId"); + this.signInTokenId = signInTokenId; + return this; + } + + public RevokeSignInTokenRequest build() { + return new RevokeSignInTokenRequest( + signInTokenId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenRequestBuilder.java new file mode 100644 index 0000000..33cbe82 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class RevokeSignInTokenRequestBuilder { + + private String signInTokenId; + private final SDKMethodInterfaces.MethodCallRevokeSignInToken sdk; + + public RevokeSignInTokenRequestBuilder(SDKMethodInterfaces.MethodCallRevokeSignInToken sdk) { + this.sdk = sdk; + } + + public RevokeSignInTokenRequestBuilder signInTokenId(String signInTokenId) { + Utils.checkNotNull(signInTokenId, "signInTokenId"); + this.signInTokenId = signInTokenId; + return this; + } + + public RevokeSignInTokenResponse call() throws Exception { + + return sdk.revoke( + signInTokenId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenResponse.java b/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenResponse.java new file mode 100644 index 0000000..a143cb2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RevokeSignInTokenResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class RevokeSignInTokenResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional signInToken; + + @JsonCreator + public RevokeSignInTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional signInToken) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(signInToken, "signInToken"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.signInToken = signInToken; + } + + public RevokeSignInTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional signInToken() { + return (Optional) signInToken; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RevokeSignInTokenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RevokeSignInTokenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RevokeSignInTokenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public RevokeSignInTokenResponse withSignInToken(com.clerk.backend_api.models.components.SignInToken signInToken) { + Utils.checkNotNull(signInToken, "signInToken"); + this.signInToken = Optional.ofNullable(signInToken); + return this; + } + + /** + * Success + */ + public RevokeSignInTokenResponse withSignInToken(Optional signInToken) { + Utils.checkNotNull(signInToken, "signInToken"); + this.signInToken = signInToken; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokeSignInTokenResponse other = (RevokeSignInTokenResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.signInToken, other.signInToken); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + signInToken); + } + + @Override + public String toString() { + return Utils.toString(RevokeSignInTokenResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "signInToken", signInToken); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional signInToken = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder signInToken(com.clerk.backend_api.models.components.SignInToken signInToken) { + Utils.checkNotNull(signInToken, "signInToken"); + this.signInToken = Optional.ofNullable(signInToken); + return this; + } + + /** + * Success + */ + public Builder signInToken(Optional signInToken) { + Utils.checkNotNull(signInToken, "signInToken"); + this.signInToken = signInToken; + return this; + } + + public RevokeSignInTokenResponse build() { + return new RevokeSignInTokenResponse( + contentType, + statusCode, + rawResponse, + signInToken); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretRequest.java b/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretRequest.java new file mode 100644 index 0000000..f1e54be --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class RotateOAuthApplicationSecretRequest { + + /** + * The ID of the OAuth application for which to rotate the client secret + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=oauth_application_id") + private String oauthApplicationId; + + @JsonCreator + public RotateOAuthApplicationSecretRequest( + String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + } + + /** + * The ID of the OAuth application for which to rotate the client secret + */ + @JsonIgnore + public String oauthApplicationId() { + return oauthApplicationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the OAuth application for which to rotate the client secret + */ + public RotateOAuthApplicationSecretRequest withOauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RotateOAuthApplicationSecretRequest other = (RotateOAuthApplicationSecretRequest) o; + return + java.util.Objects.deepEquals(this.oauthApplicationId, other.oauthApplicationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + oauthApplicationId); + } + + @Override + public String toString() { + return Utils.toString(RotateOAuthApplicationSecretRequest.class, + "oauthApplicationId", oauthApplicationId); + } + + public final static class Builder { + + private String oauthApplicationId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the OAuth application for which to rotate the client secret + */ + public Builder oauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public RotateOAuthApplicationSecretRequest build() { + return new RotateOAuthApplicationSecretRequest( + oauthApplicationId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretRequestBuilder.java new file mode 100644 index 0000000..70c884e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class RotateOAuthApplicationSecretRequestBuilder { + + private String oauthApplicationId; + private final SDKMethodInterfaces.MethodCallRotateOAuthApplicationSecret sdk; + + public RotateOAuthApplicationSecretRequestBuilder(SDKMethodInterfaces.MethodCallRotateOAuthApplicationSecret sdk) { + this.sdk = sdk; + } + + public RotateOAuthApplicationSecretRequestBuilder oauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public RotateOAuthApplicationSecretResponse call() throws Exception { + + return sdk.rotateSecret( + oauthApplicationId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretResponse.java b/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretResponse.java new file mode 100644 index 0000000..7a51081 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/RotateOAuthApplicationSecretResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class RotateOAuthApplicationSecretResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An OAuth application with client secret + */ + private Optional oAuthApplicationWithSecret; + + @JsonCreator + public RotateOAuthApplicationSecretResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional oAuthApplicationWithSecret) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.oAuthApplicationWithSecret = oAuthApplicationWithSecret; + } + + public RotateOAuthApplicationSecretResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An OAuth application with client secret + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional oAuthApplicationWithSecret() { + return (Optional) oAuthApplicationWithSecret; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RotateOAuthApplicationSecretResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RotateOAuthApplicationSecretResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RotateOAuthApplicationSecretResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An OAuth application with client secret + */ + public RotateOAuthApplicationSecretResponse withOAuthApplicationWithSecret(com.clerk.backend_api.models.components.OAuthApplicationWithSecret oAuthApplicationWithSecret) { + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.oAuthApplicationWithSecret = Optional.ofNullable(oAuthApplicationWithSecret); + return this; + } + + /** + * An OAuth application with client secret + */ + public RotateOAuthApplicationSecretResponse withOAuthApplicationWithSecret(Optional oAuthApplicationWithSecret) { + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.oAuthApplicationWithSecret = oAuthApplicationWithSecret; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RotateOAuthApplicationSecretResponse other = (RotateOAuthApplicationSecretResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.oAuthApplicationWithSecret, other.oAuthApplicationWithSecret); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + oAuthApplicationWithSecret); + } + + @Override + public String toString() { + return Utils.toString(RotateOAuthApplicationSecretResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "oAuthApplicationWithSecret", oAuthApplicationWithSecret); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional oAuthApplicationWithSecret = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An OAuth application with client secret + */ + public Builder oAuthApplicationWithSecret(com.clerk.backend_api.models.components.OAuthApplicationWithSecret oAuthApplicationWithSecret) { + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.oAuthApplicationWithSecret = Optional.ofNullable(oAuthApplicationWithSecret); + return this; + } + + /** + * An OAuth application with client secret + */ + public Builder oAuthApplicationWithSecret(Optional oAuthApplicationWithSecret) { + Utils.checkNotNull(oAuthApplicationWithSecret, "oAuthApplicationWithSecret"); + this.oAuthApplicationWithSecret = oAuthApplicationWithSecret; + return this; + } + + public RotateOAuthApplicationSecretResponse build() { + return new RotateOAuthApplicationSecretResponse( + contentType, + statusCode, + rawResponse, + oAuthApplicationWithSecret); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/SDKMethodInterfaces.java b/src/main/java/com/clerk/backend_api/models/operations/SDKMethodInterfaces.java new file mode 100644 index 0000000..e46d6b5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/SDKMethodInterfaces.java @@ -0,0 +1,719 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class SDKMethodInterfaces { + + public interface MethodCallGetPublicInterstitial { + com.clerk.backend_api.models.operations.GetPublicInterstitialResponse getPublicInterstitial( + Optional frontendApi, + Optional publishableKey) throws Exception; + } + + + public interface MethodCallGetJWKS { + com.clerk.backend_api.models.operations.GetJWKSResponse getJWKSDirect() throws Exception; + } + + + public interface MethodCallGetClientList { + com.clerk.backend_api.models.operations.GetClientListResponse list( + Optional limit, + Optional offset) throws Exception; + } + + + public interface MethodCallVerifyClient { + com.clerk.backend_api.models.operations.VerifyClientResponse verify( + Optional request) throws Exception; + } + + + public interface MethodCallGetClient { + com.clerk.backend_api.models.operations.GetClientResponse get( + String clientId) throws Exception; + } + + + public interface MethodCallCreateEmailAddress { + com.clerk.backend_api.models.operations.CreateEmailAddressResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallGetEmailAddress { + com.clerk.backend_api.models.operations.GetEmailAddressResponse get( + String emailAddressId) throws Exception; + } + + + public interface MethodCallDeleteEmailAddress { + com.clerk.backend_api.models.operations.DeleteEmailAddressResponse delete( + String emailAddressId) throws Exception; + } + + + public interface MethodCallUpdateEmailAddress { + com.clerk.backend_api.models.operations.UpdateEmailAddressResponse update( + String emailAddressId, + Optional requestBody) throws Exception; + } + + + public interface MethodCallCreatePhoneNumber { + com.clerk.backend_api.models.operations.CreatePhoneNumberResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallGetPhoneNumber { + com.clerk.backend_api.models.operations.GetPhoneNumberResponse get( + String phoneNumberId) throws Exception; + } + + + public interface MethodCallDeletePhoneNumber { + com.clerk.backend_api.models.operations.DeletePhoneNumberResponse delete( + String phoneNumberId) throws Exception; + } + + + public interface MethodCallUpdatePhoneNumber { + com.clerk.backend_api.models.operations.UpdatePhoneNumberResponse update( + String phoneNumberId, + Optional requestBody) throws Exception; + } + + + public interface MethodCallGetSessionList { + com.clerk.backend_api.models.operations.GetSessionListResponse list( + com.clerk.backend_api.models.operations.GetSessionListRequest request) throws Exception; + } + + + public interface MethodCallGetSession { + com.clerk.backend_api.models.operations.GetSessionResponse get( + String sessionId) throws Exception; + } + + + public interface MethodCallRevokeSession { + com.clerk.backend_api.models.operations.RevokeSessionResponse revoke( + String sessionId) throws Exception; + } + + + public interface MethodCallVerifySession { + com.clerk.backend_api.models.operations.VerifySessionResponse verify( + String sessionId, + Optional requestBody) throws Exception; + } + + + public interface MethodCallCreateSessionTokenFromTemplate { + com.clerk.backend_api.models.operations.CreateSessionTokenFromTemplateResponse createTokenFromTemplate( + String sessionId, + String templateName) throws Exception; + } + + + public interface MethodCallGetTemplateList { + com.clerk.backend_api.models.operations.GetTemplateListResponse list( + com.clerk.backend_api.models.operations.TemplateType templateType) throws Exception; + } + + + public interface MethodCallGetTemplate { + com.clerk.backend_api.models.operations.GetTemplateResponse get( + com.clerk.backend_api.models.operations.PathParamTemplateType templateType, + String slug) throws Exception; + } + + + public interface MethodCallUpsertTemplate { + com.clerk.backend_api.models.operations.UpsertTemplateResponse upsert( + com.clerk.backend_api.models.operations.UpsertTemplatePathParamTemplateType templateType, + String slug, + Optional requestBody) throws Exception; + } + + + public interface MethodCallRevertTemplate { + com.clerk.backend_api.models.operations.RevertTemplateResponse revert( + com.clerk.backend_api.models.operations.RevertTemplatePathParamTemplateType templateType, + String slug) throws Exception; + } + + + public interface MethodCallPreviewTemplate { + com.clerk.backend_api.models.operations.PreviewTemplateResponse preview( + String templateType, + String slug, + Optional requestBody) throws Exception; + } + + + public interface MethodCallToggleTemplateDelivery { + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryResponse toggleDelivery( + com.clerk.backend_api.models.operations.ToggleTemplateDeliveryPathParamTemplateType templateType, + String slug, + Optional requestBody) throws Exception; + } + + + public interface MethodCallGetUserList { + com.clerk.backend_api.models.operations.GetUserListResponse list( + com.clerk.backend_api.models.operations.GetUserListRequest request) throws Exception; + } + + + public interface MethodCallCreateUser { + com.clerk.backend_api.models.operations.CreateUserResponse create( + com.clerk.backend_api.models.operations.CreateUserRequestBody request) throws Exception; + } + + + public interface MethodCallGetUsersCount { + com.clerk.backend_api.models.operations.GetUsersCountResponse count( + com.clerk.backend_api.models.operations.GetUsersCountRequest request) throws Exception; + } + + + public interface MethodCallGetUser { + com.clerk.backend_api.models.operations.GetUserResponse get( + String userId) throws Exception; + } + + + public interface MethodCallUpdateUser { + com.clerk.backend_api.models.operations.UpdateUserResponse update( + String userId, + com.clerk.backend_api.models.operations.UpdateUserRequestBody requestBody) throws Exception; + } + + + public interface MethodCallDeleteUser { + com.clerk.backend_api.models.operations.DeleteUserResponse delete( + String userId) throws Exception; + } + + + public interface MethodCallBanUser { + com.clerk.backend_api.models.operations.BanUserResponse ban( + String userId) throws Exception; + } + + + public interface MethodCallUnbanUser { + com.clerk.backend_api.models.operations.UnbanUserResponse unban( + String userId) throws Exception; + } + + + public interface MethodCallLockUser { + com.clerk.backend_api.models.operations.LockUserResponse lock( + String userId) throws Exception; + } + + + public interface MethodCallUnlockUser { + com.clerk.backend_api.models.operations.UnlockUserResponse unlock( + String userId) throws Exception; + } + + + public interface MethodCallSetUserProfileImage { + com.clerk.backend_api.models.operations.SetUserProfileImageResponse setProfileImage( + String userId, + com.clerk.backend_api.models.operations.SetUserProfileImageRequestBody requestBody) throws Exception; + } + + + public interface MethodCallDeleteUserProfileImage { + com.clerk.backend_api.models.operations.DeleteUserProfileImageResponse deleteProfileImage( + String userId) throws Exception; + } + + + public interface MethodCallUpdateUserMetadata { + com.clerk.backend_api.models.operations.UpdateUserMetadataResponse updateMetadata( + String userId, + Optional requestBody) throws Exception; + } + + + public interface MethodCallGetOAuthAccessToken { + com.clerk.backend_api.models.operations.GetOAuthAccessTokenResponse getOAuthAccessToken( + String userId, + String provider) throws Exception; + } + + + public interface MethodCallUsersGetOrganizationMemberships { + com.clerk.backend_api.models.operations.UsersGetOrganizationMembershipsResponse getOrganizationMemberships( + String userId, + Optional limit, + Optional offset) throws Exception; + } + + + public interface MethodCallVerifyPassword { + com.clerk.backend_api.models.operations.VerifyPasswordResponse verifyPassword( + String userId, + Optional requestBody) throws Exception; + } + + + public interface MethodCallVerifyTOTP { + com.clerk.backend_api.models.operations.VerifyTOTPResponse verifyTOTP( + String userId, + Optional requestBody) throws Exception; + } + + + public interface MethodCallDisableMFA { + com.clerk.backend_api.models.operations.DisableMFAResponse disableMFA( + String userId) throws Exception; + } + + + public interface MethodCallCreateInvitation { + com.clerk.backend_api.models.operations.CreateInvitationResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallListInvitations { + com.clerk.backend_api.models.operations.ListInvitationsResponse list( + Optional limit, + Optional offset, + Optional status) throws Exception; + } + + + public interface MethodCallRevokeInvitation { + com.clerk.backend_api.models.operations.RevokeInvitationResponse revoke( + String invitationId) throws Exception; + } + + + public interface MethodCallListAllowlistIdentifiers { + com.clerk.backend_api.models.operations.ListAllowlistIdentifiersResponse listDirect() throws Exception; + } + + + public interface MethodCallCreateAllowlistIdentifier { + com.clerk.backend_api.models.operations.CreateAllowlistIdentifierResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallDeleteAllowlistIdentifier { + com.clerk.backend_api.models.operations.DeleteAllowlistIdentifierResponse delete( + String identifierId) throws Exception; + } + + + public interface MethodCallListBlocklistIdentifiers { + com.clerk.backend_api.models.operations.ListBlocklistIdentifiersResponse listDirect() throws Exception; + } + + + public interface MethodCallCreateBlocklistIdentifier { + com.clerk.backend_api.models.operations.CreateBlocklistIdentifierResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallDeleteBlocklistIdentifier { + com.clerk.backend_api.models.operations.DeleteBlocklistIdentifierResponse delete( + String identifierId) throws Exception; + } + + + public interface MethodCallUpdateInstanceAuthConfig { + com.clerk.backend_api.models.operations.UpdateInstanceAuthConfigResponse updateAuthConfig( + Optional request) throws Exception; + } + + + public interface MethodCallUpdateProductionInstanceDomain { + com.clerk.backend_api.models.operations.UpdateProductionInstanceDomainResponse updateProductionDomain( + Optional request) throws Exception; + } + + + public interface MethodCallUpdateInstance { + com.clerk.backend_api.models.operations.UpdateInstanceResponse update( + Optional request) throws Exception; + } + + + public interface MethodCallUpdateInstanceRestrictions { + com.clerk.backend_api.models.operations.UpdateInstanceRestrictionsResponse updateRestrictions( + Optional request) throws Exception; + } + + + public interface MethodCallChangeProductionInstanceDomain { + com.clerk.backend_api.models.operations.ChangeProductionInstanceDomainResponse changeProductionDomain( + Optional request) throws Exception; + } + + + public interface MethodCallUpdateInstanceOrganizationSettings { + com.clerk.backend_api.models.operations.UpdateInstanceOrganizationSettingsResponse updateOrganizationSettings( + Optional request) throws Exception; + } + + + public interface MethodCallCreateActorToken { + com.clerk.backend_api.models.operations.CreateActorTokenResponse createToken( + Optional request) throws Exception; + } + + + public interface MethodCallRevokeActorToken { + com.clerk.backend_api.models.operations.RevokeActorTokenResponse revokeToken( + String actorTokenId) throws Exception; + } + + + public interface MethodCallListDomains { + com.clerk.backend_api.models.operations.ListDomainsResponse listDirect() throws Exception; + } + + + public interface MethodCallAddDomain { + com.clerk.backend_api.models.operations.AddDomainResponse add( + Optional request) throws Exception; + } + + + public interface MethodCallDeleteDomain { + com.clerk.backend_api.models.operations.DeleteDomainResponse delete( + String domainId) throws Exception; + } + + + public interface MethodCallUpdateDomain { + com.clerk.backend_api.models.operations.UpdateDomainResponse update( + String domainId, + com.clerk.backend_api.models.operations.UpdateDomainRequestBody requestBody) throws Exception; + } + + + public interface MethodCallCreateSvixApp { + com.clerk.backend_api.models.operations.CreateSvixAppResponse createSvixAppDirect() throws Exception; + } + + + public interface MethodCallDeleteSvixApp { + com.clerk.backend_api.models.operations.DeleteSvixAppResponse deleteSvixAppDirect() throws Exception; + } + + + public interface MethodCallGenerateSvixAuthURL { + com.clerk.backend_api.models.operations.GenerateSvixAuthURLResponse generateSvixAuthURLDirect() throws Exception; + } + + + public interface MethodCallListJWTTemplates { + com.clerk.backend_api.models.operations.ListJWTTemplatesResponse listDirect() throws Exception; + } + + + public interface MethodCallCreateJWTTemplate { + com.clerk.backend_api.models.operations.CreateJWTTemplateResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallGetJWTTemplate { + com.clerk.backend_api.models.operations.GetJWTTemplateResponse get( + String templateId) throws Exception; + } + + + public interface MethodCallUpdateJWTTemplate { + com.clerk.backend_api.models.operations.UpdateJWTTemplateResponse update( + String templateId, + Optional requestBody) throws Exception; + } + + + public interface MethodCallDeleteJWTTemplate { + com.clerk.backend_api.models.operations.DeleteJWTTemplateResponse delete( + String templateId) throws Exception; + } + + + public interface MethodCallListOrganizations { + com.clerk.backend_api.models.operations.ListOrganizationsResponse list( + com.clerk.backend_api.models.operations.ListOrganizationsRequest request) throws Exception; + } + + + public interface MethodCallCreateOrganization { + com.clerk.backend_api.models.operations.CreateOrganizationResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallGetOrganization { + com.clerk.backend_api.models.operations.GetOrganizationResponse get( + String organizationId) throws Exception; + } + + + public interface MethodCallUpdateOrganization { + com.clerk.backend_api.models.operations.UpdateOrganizationResponse update( + String organizationId, + com.clerk.backend_api.models.operations.UpdateOrganizationRequestBody requestBody) throws Exception; + } + + + public interface MethodCallDeleteOrganization { + com.clerk.backend_api.models.operations.DeleteOrganizationResponse delete( + String organizationId) throws Exception; + } + + + public interface MethodCallMergeOrganizationMetadata { + com.clerk.backend_api.models.operations.MergeOrganizationMetadataResponse mergeMetadata( + String organizationId, + com.clerk.backend_api.models.operations.MergeOrganizationMetadataRequestBody requestBody) throws Exception; + } + + + public interface MethodCallUploadOrganizationLogo { + com.clerk.backend_api.models.operations.UploadOrganizationLogoResponse uploadLogo( + String organizationId, + Optional requestBody) throws Exception; + } + + + public interface MethodCallDeleteOrganizationLogo { + com.clerk.backend_api.models.operations.DeleteOrganizationLogoResponse deleteLogo( + String organizationId) throws Exception; + } + + + public interface MethodCallCreateOrganizationInvitation { + com.clerk.backend_api.models.operations.CreateOrganizationInvitationResponse create( + String organizationId, + com.clerk.backend_api.models.operations.CreateOrganizationInvitationRequestBody requestBody) throws Exception; + } + + + public interface MethodCallListOrganizationInvitations { + com.clerk.backend_api.models.operations.ListOrganizationInvitationsResponse list( + String organizationId, + Optional limit, + Optional offset, + Optional status) throws Exception; + } + + + public interface MethodCallCreateOrganizationInvitationBulk { + com.clerk.backend_api.models.operations.CreateOrganizationInvitationBulkResponse createBulk( + String organizationId, + java.util.List requestBody) throws Exception; + } + + + public interface MethodCallListPendingOrganizationInvitations { + com.clerk.backend_api.models.operations.ListPendingOrganizationInvitationsResponse listPending( + String organizationId, + Optional limit, + Optional offset) throws Exception; + } + + + public interface MethodCallGetOrganizationInvitation { + com.clerk.backend_api.models.operations.GetOrganizationInvitationResponse get( + String organizationId, + String invitationId) throws Exception; + } + + + public interface MethodCallRevokeOrganizationInvitation { + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationResponse revoke( + String organizationId, + String invitationId, + com.clerk.backend_api.models.operations.RevokeOrganizationInvitationRequestBody requestBody) throws Exception; + } + + + public interface MethodCallCreateOrganizationMembership { + com.clerk.backend_api.models.operations.CreateOrganizationMembershipResponse create( + String organizationId, + com.clerk.backend_api.models.operations.CreateOrganizationMembershipRequestBody requestBody) throws Exception; + } + + + public interface MethodCallListOrganizationMemberships { + com.clerk.backend_api.models.operations.ListOrganizationMembershipsResponse list( + String organizationId, + Optional limit, + Optional offset, + Optional orderBy) throws Exception; + } + + + public interface MethodCallUpdateOrganizationMembership { + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipResponse update( + String organizationId, + String userId, + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipRequestBody requestBody) throws Exception; + } + + + public interface MethodCallDeleteOrganizationMembership { + com.clerk.backend_api.models.operations.DeleteOrganizationMembershipResponse delete( + String organizationId, + String userId) throws Exception; + } + + + public interface MethodCallUpdateOrganizationMembershipMetadata { + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataResponse updateMetadata( + String organizationId, + String userId, + com.clerk.backend_api.models.operations.UpdateOrganizationMembershipMetadataRequestBody requestBody) throws Exception; + } + + + public interface MethodCallVerifyDomainProxy { + com.clerk.backend_api.models.operations.VerifyDomainProxyResponse verifyDomain( + Optional request) throws Exception; + } + + + public interface MethodCallListRedirectURLs { + com.clerk.backend_api.models.operations.ListRedirectURLsResponse listDirect() throws Exception; + } + + + public interface MethodCallCreateRedirectURL { + com.clerk.backend_api.models.operations.CreateRedirectURLResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallGetRedirectURL { + com.clerk.backend_api.models.operations.GetRedirectURLResponse get( + String id) throws Exception; + } + + + public interface MethodCallDeleteRedirectURL { + com.clerk.backend_api.models.operations.DeleteRedirectURLResponse delete( + String id) throws Exception; + } + + + public interface MethodCallCreateSignInToken { + com.clerk.backend_api.models.operations.CreateSignInTokenResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallRevokeSignInToken { + com.clerk.backend_api.models.operations.RevokeSignInTokenResponse revoke( + String signInTokenId) throws Exception; + } + + + public interface MethodCallUpdateSignUp { + com.clerk.backend_api.models.operations.UpdateSignUpResponse update( + String id, + Optional requestBody) throws Exception; + } + + + public interface MethodCallListOAuthApplications { + com.clerk.backend_api.models.operations.ListOAuthApplicationsResponse list( + Optional limit, + Optional offset) throws Exception; + } + + + public interface MethodCallCreateOAuthApplication { + com.clerk.backend_api.models.operations.CreateOAuthApplicationResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallGetOAuthApplication { + com.clerk.backend_api.models.operations.GetOAuthApplicationResponse get( + String oauthApplicationId) throws Exception; + } + + + public interface MethodCallUpdateOAuthApplication { + com.clerk.backend_api.models.operations.UpdateOAuthApplicationResponse updateApplication( + String oauthApplicationId, + com.clerk.backend_api.models.operations.UpdateOAuthApplicationRequestBody requestBody) throws Exception; + } + + + public interface MethodCallDeleteOAuthApplication { + com.clerk.backend_api.models.operations.DeleteOAuthApplicationResponse delete( + String oauthApplicationId) throws Exception; + } + + + public interface MethodCallRotateOAuthApplicationSecret { + com.clerk.backend_api.models.operations.RotateOAuthApplicationSecretResponse rotateSecret( + String oauthApplicationId) throws Exception; + } + + + public interface MethodCallListSAMLConnections { + com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse list( + Optional limit, + Optional offset) throws Exception; + } + + + public interface MethodCallCreateSAMLConnection { + com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallGetSAMLConnection { + com.clerk.backend_api.models.operations.GetSAMLConnectionResponse get( + String samlConnectionId) throws Exception; + } + + + public interface MethodCallUpdateSAMLConnection { + com.clerk.backend_api.models.operations.UpdateSAMLConnectionResponse update( + String samlConnectionId, + com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBody requestBody) throws Exception; + } + + + public interface MethodCallDeleteSAMLConnection { + com.clerk.backend_api.models.operations.DeleteSAMLConnectionResponse delete( + String samlConnectionId) throws Exception; + } + + + public interface MethodCallCreateTestingToken { + com.clerk.backend_api.models.operations.CreateTestingTokenResponse createDirect() throws Exception; + } + +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequest.java b/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequest.java new file mode 100644 index 0000000..9989a16 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class SetUserProfileImageRequest { + + /** + * The ID of the user to update the profile image for + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @SpeakeasyMetadata("request:mediaType=multipart/form-data") + private SetUserProfileImageRequestBody requestBody; + + @JsonCreator + public SetUserProfileImageRequest( + String userId, + SetUserProfileImageRequestBody requestBody) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.userId = userId; + this.requestBody = requestBody; + } + + /** + * The ID of the user to update the profile image for + */ + @JsonIgnore + public String userId() { + return userId; + } + + @JsonIgnore + public SetUserProfileImageRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to update the profile image for + */ + public SetUserProfileImageRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public SetUserProfileImageRequest withRequestBody(SetUserProfileImageRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetUserProfileImageRequest other = (SetUserProfileImageRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(SetUserProfileImageRequest.class, + "userId", userId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String userId; + + private SetUserProfileImageRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to update the profile image for + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder requestBody(SetUserProfileImageRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public SetUserProfileImageRequest build() { + return new SetUserProfileImageRequest( + userId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequestBody.java new file mode 100644 index 0000000..9176cec --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequestBody.java @@ -0,0 +1,108 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class SetUserProfileImageRequestBody { + + @SpeakeasyMetadata("multipartForm:file") + private Optional file; + + @JsonCreator + public SetUserProfileImageRequestBody( + Optional file) { + Utils.checkNotNull(file, "file"); + this.file = file; + } + + public SetUserProfileImageRequestBody() { + this(Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional file() { + return (Optional) file; + } + + public final static Builder builder() { + return new Builder(); + } + + public SetUserProfileImageRequestBody withFile(File file) { + Utils.checkNotNull(file, "file"); + this.file = Optional.ofNullable(file); + return this; + } + + public SetUserProfileImageRequestBody withFile(Optional file) { + Utils.checkNotNull(file, "file"); + this.file = file; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetUserProfileImageRequestBody other = (SetUserProfileImageRequestBody) o; + return + java.util.Objects.deepEquals(this.file, other.file); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + file); + } + + @Override + public String toString() { + return Utils.toString(SetUserProfileImageRequestBody.class, + "file", file); + } + + public final static class Builder { + + private Optional file = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder file(File file) { + Utils.checkNotNull(file, "file"); + this.file = Optional.ofNullable(file); + return this; + } + + public Builder file(Optional file) { + Utils.checkNotNull(file, "file"); + this.file = file; + return this; + } + + public SetUserProfileImageRequestBody build() { + return new SetUserProfileImageRequestBody( + file); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequestBuilder.java new file mode 100644 index 0000000..7195f22 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class SetUserProfileImageRequestBuilder { + + private String userId; + private SetUserProfileImageRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallSetUserProfileImage sdk; + + public SetUserProfileImageRequestBuilder(SDKMethodInterfaces.MethodCallSetUserProfileImage sdk) { + this.sdk = sdk; + } + + public SetUserProfileImageRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public SetUserProfileImageRequestBuilder requestBody(SetUserProfileImageRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public SetUserProfileImageResponse call() throws Exception { + + return sdk.setProfileImage( + userId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageResponse.java b/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageResponse.java new file mode 100644 index 0000000..301d946 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/SetUserProfileImageResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class SetUserProfileImageResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public SetUserProfileImageResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public SetUserProfileImageResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public SetUserProfileImageResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public SetUserProfileImageResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public SetUserProfileImageResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public SetUserProfileImageResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public SetUserProfileImageResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetUserProfileImageResponse other = (SetUserProfileImageResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(SetUserProfileImageResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public SetUserProfileImageResponse build() { + return new SetUserProfileImageResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/Status.java b/src/main/java/com/clerk/backend_api/models/operations/Status.java new file mode 100644 index 0000000..cdade27 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/Status.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * Status - Filter sessions by the provided status + */ +public enum Status { + ABANDONED("abandoned"), + ACTIVE("active"), + ENDED("ended"), + EXPIRED("expired"), + REMOVED("removed"), + REPLACED("replaced"), + REVOKED("revoked"); + + @JsonValue + private final String value; + + private Status(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/TemplateType.java b/src/main/java/com/clerk/backend_api/models/operations/TemplateType.java new file mode 100644 index 0000000..ee9ef7f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/TemplateType.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * TemplateType - The type of templates to list (email or SMS) + */ +public enum TemplateType { + EMAIL("email"), + SMS("sms"); + + @JsonValue + private final String value; + + private TemplateType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryPathParamTemplateType.java b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryPathParamTemplateType.java new file mode 100644 index 0000000..253f49d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryPathParamTemplateType.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * ToggleTemplateDeliveryPathParamTemplateType - The type of template to toggle delivery for + */ +public enum ToggleTemplateDeliveryPathParamTemplateType { + EMAIL("email"), + SMS("sms"); + + @JsonValue + private final String value; + + private ToggleTemplateDeliveryPathParamTemplateType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequest.java b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequest.java new file mode 100644 index 0000000..3feade2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequest.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class ToggleTemplateDeliveryRequest { + + /** + * The type of template to toggle delivery for + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_type") + private ToggleTemplateDeliveryPathParamTemplateType templateType; + + /** + * The slug of the template for which to toggle delivery + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=slug") + private String slug; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public ToggleTemplateDeliveryRequest( + ToggleTemplateDeliveryPathParamTemplateType templateType, + String slug, + Optional requestBody) { + Utils.checkNotNull(templateType, "templateType"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(requestBody, "requestBody"); + this.templateType = templateType; + this.slug = slug; + this.requestBody = requestBody; + } + + public ToggleTemplateDeliveryRequest( + ToggleTemplateDeliveryPathParamTemplateType templateType, + String slug) { + this(templateType, slug, Optional.empty()); + } + + /** + * The type of template to toggle delivery for + */ + @JsonIgnore + public ToggleTemplateDeliveryPathParamTemplateType templateType() { + return templateType; + } + + /** + * The slug of the template for which to toggle delivery + */ + @JsonIgnore + public String slug() { + return slug; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The type of template to toggle delivery for + */ + public ToggleTemplateDeliveryRequest withTemplateType(ToggleTemplateDeliveryPathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug of the template for which to toggle delivery + */ + public ToggleTemplateDeliveryRequest withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public ToggleTemplateDeliveryRequest withRequestBody(ToggleTemplateDeliveryRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public ToggleTemplateDeliveryRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ToggleTemplateDeliveryRequest other = (ToggleTemplateDeliveryRequest) o; + return + java.util.Objects.deepEquals(this.templateType, other.templateType) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateType, + slug, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(ToggleTemplateDeliveryRequest.class, + "templateType", templateType, + "slug", slug, + "requestBody", requestBody); + } + + public final static class Builder { + + private ToggleTemplateDeliveryPathParamTemplateType templateType; + + private String slug; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The type of template to toggle delivery for + */ + public Builder templateType(ToggleTemplateDeliveryPathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug of the template for which to toggle delivery + */ + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder requestBody(ToggleTemplateDeliveryRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public ToggleTemplateDeliveryRequest build() { + return new ToggleTemplateDeliveryRequest( + templateType, + slug, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequestBody.java new file mode 100644 index 0000000..90128b6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequestBody.java @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ToggleTemplateDeliveryRequestBody { + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("delivered_by_clerk") + private JsonNullable deliveredByClerk; + + @JsonCreator + public ToggleTemplateDeliveryRequestBody( + @JsonProperty("delivered_by_clerk") JsonNullable deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = deliveredByClerk; + } + + public ToggleTemplateDeliveryRequestBody() { + this(JsonNullable.undefined()); + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable deliveredByClerk() { + return (JsonNullable) deliveredByClerk; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + public ToggleTemplateDeliveryRequestBody withDeliveredByClerk(boolean deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = JsonNullable.of(deliveredByClerk); + return this; + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + public ToggleTemplateDeliveryRequestBody withDeliveredByClerk(JsonNullable deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = deliveredByClerk; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ToggleTemplateDeliveryRequestBody other = (ToggleTemplateDeliveryRequestBody) o; + return + java.util.Objects.deepEquals(this.deliveredByClerk, other.deliveredByClerk); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + deliveredByClerk); + } + + @Override + public String toString() { + return Utils.toString(ToggleTemplateDeliveryRequestBody.class, + "deliveredByClerk", deliveredByClerk); + } + + public final static class Builder { + + private JsonNullable deliveredByClerk = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + public Builder deliveredByClerk(boolean deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = JsonNullable.of(deliveredByClerk); + return this; + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + public Builder deliveredByClerk(JsonNullable deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = deliveredByClerk; + return this; + } + + public ToggleTemplateDeliveryRequestBody build() { + return new ToggleTemplateDeliveryRequestBody( + deliveredByClerk); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequestBuilder.java new file mode 100644 index 0000000..6355541 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryRequestBuilder.java @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ToggleTemplateDeliveryRequestBuilder { + + private ToggleTemplateDeliveryPathParamTemplateType templateType; + private String slug; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallToggleTemplateDelivery sdk; + + public ToggleTemplateDeliveryRequestBuilder(SDKMethodInterfaces.MethodCallToggleTemplateDelivery sdk) { + this.sdk = sdk; + } + + public ToggleTemplateDeliveryRequestBuilder templateType(ToggleTemplateDeliveryPathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + public ToggleTemplateDeliveryRequestBuilder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public ToggleTemplateDeliveryRequestBuilder requestBody(ToggleTemplateDeliveryRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public ToggleTemplateDeliveryRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public ToggleTemplateDeliveryResponse call() throws Exception { + + return sdk.toggleDelivery( + templateType, + slug, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryResponse.java b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryResponse.java new file mode 100644 index 0000000..5c9e4f2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/ToggleTemplateDeliveryResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class ToggleTemplateDeliveryResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional template; + + @JsonCreator + public ToggleTemplateDeliveryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional template) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(template, "template"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.template = template; + } + + public ToggleTemplateDeliveryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional template() { + return (Optional) template; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ToggleTemplateDeliveryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ToggleTemplateDeliveryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ToggleTemplateDeliveryResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public ToggleTemplateDeliveryResponse withTemplate(com.clerk.backend_api.models.components.Template template) { + Utils.checkNotNull(template, "template"); + this.template = Optional.ofNullable(template); + return this; + } + + /** + * Success + */ + public ToggleTemplateDeliveryResponse withTemplate(Optional template) { + Utils.checkNotNull(template, "template"); + this.template = template; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ToggleTemplateDeliveryResponse other = (ToggleTemplateDeliveryResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.template, other.template); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + template); + } + + @Override + public String toString() { + return Utils.toString(ToggleTemplateDeliveryResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "template", template); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional template = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder template(com.clerk.backend_api.models.components.Template template) { + Utils.checkNotNull(template, "template"); + this.template = Optional.ofNullable(template); + return this; + } + + /** + * Success + */ + public Builder template(Optional template) { + Utils.checkNotNull(template, "template"); + this.template = template; + return this; + } + + public ToggleTemplateDeliveryResponse build() { + return new ToggleTemplateDeliveryResponse( + contentType, + statusCode, + rawResponse, + template); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UnbanUserRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UnbanUserRequest.java new file mode 100644 index 0000000..28075ca --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UnbanUserRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UnbanUserRequest { + + /** + * The ID of the user to unban + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public UnbanUserRequest( + String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + /** + * The ID of the user to unban + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to unban + */ + public UnbanUserRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnbanUserRequest other = (UnbanUserRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(UnbanUserRequest.class, + "userId", userId); + } + + public final static class Builder { + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to unban + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UnbanUserRequest build() { + return new UnbanUserRequest( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UnbanUserRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UnbanUserRequestBuilder.java new file mode 100644 index 0000000..a4bc3f8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UnbanUserRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UnbanUserRequestBuilder { + + private String userId; + private final SDKMethodInterfaces.MethodCallUnbanUser sdk; + + public UnbanUserRequestBuilder(SDKMethodInterfaces.MethodCallUnbanUser sdk) { + this.sdk = sdk; + } + + public UnbanUserRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UnbanUserResponse call() throws Exception { + + return sdk.unban( + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UnbanUserResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UnbanUserResponse.java new file mode 100644 index 0000000..dedc49b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UnbanUserResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UnbanUserResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public UnbanUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public UnbanUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UnbanUserResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UnbanUserResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UnbanUserResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UnbanUserResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public UnbanUserResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnbanUserResponse other = (UnbanUserResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(UnbanUserResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public UnbanUserResponse build() { + return new UnbanUserResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UnlockUserRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UnlockUserRequest.java new file mode 100644 index 0000000..1e4e504 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UnlockUserRequest.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UnlockUserRequest { + + /** + * The ID of the user to unlock + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @JsonCreator + public UnlockUserRequest( + String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + } + + /** + * The ID of the user to unlock + */ + @JsonIgnore + public String userId() { + return userId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to unlock + */ + public UnlockUserRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnlockUserRequest other = (UnlockUserRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId); + } + + @Override + public String toString() { + return Utils.toString(UnlockUserRequest.class, + "userId", userId); + } + + public final static class Builder { + + private String userId; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to unlock + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UnlockUserRequest build() { + return new UnlockUserRequest( + userId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UnlockUserRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UnlockUserRequestBuilder.java new file mode 100644 index 0000000..44eae8c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UnlockUserRequestBuilder.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UnlockUserRequestBuilder { + + private String userId; + private final SDKMethodInterfaces.MethodCallUnlockUser sdk; + + public UnlockUserRequestBuilder(SDKMethodInterfaces.MethodCallUnlockUser sdk) { + this.sdk = sdk; + } + + public UnlockUserRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UnlockUserResponse call() throws Exception { + + return sdk.unlock( + userId); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UnlockUserResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UnlockUserResponse.java new file mode 100644 index 0000000..623e71d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UnlockUserResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UnlockUserResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public UnlockUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public UnlockUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UnlockUserResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UnlockUserResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UnlockUserResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UnlockUserResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public UnlockUserResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnlockUserResponse other = (UnlockUserResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(UnlockUserResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public UnlockUserResponse build() { + return new UnlockUserResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UnsafeMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UnsafeMetadata.java new file mode 100644 index 0000000..d28beb7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UnsafeMetadata.java @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UnsafeMetadata - Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + +public class UnsafeMetadata { + + @JsonCreator + public UnsafeMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UnsafeMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UnsafeMetadata build() { + return new UnsafeMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequest.java new file mode 100644 index 0000000..b4b22d6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UpdateDomainRequest { + + /** + * The ID of the domain that will be updated. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=domain_id") + private String domainId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private UpdateDomainRequestBody requestBody; + + @JsonCreator + public UpdateDomainRequest( + String domainId, + UpdateDomainRequestBody requestBody) { + Utils.checkNotNull(domainId, "domainId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.domainId = domainId; + this.requestBody = requestBody; + } + + /** + * The ID of the domain that will be updated. + */ + @JsonIgnore + public String domainId() { + return domainId; + } + + @JsonIgnore + public UpdateDomainRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the domain that will be updated. + */ + public UpdateDomainRequest withDomainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + public UpdateDomainRequest withRequestBody(UpdateDomainRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDomainRequest other = (UpdateDomainRequest) o; + return + java.util.Objects.deepEquals(this.domainId, other.domainId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + domainId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateDomainRequest.class, + "domainId", domainId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String domainId; + + private UpdateDomainRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the domain that will be updated. + */ + public Builder domainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + public Builder requestBody(UpdateDomainRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateDomainRequest build() { + return new UpdateDomainRequest( + domainId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequestBody.java new file mode 100644 index 0000000..f385ea8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequestBody.java @@ -0,0 +1,208 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateDomainRequestBody { + + /** + * The new domain name. For development instances, can contain the port, + * i.e `myhostname:3000`. For production instances, must be a valid FQDN, + * i.e `mysite.com`. Cannot contain protocol scheme. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * The full URL of the proxy that will forward requests to Clerk's Frontend API. + * Can only be updated for production instances. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("proxy_url") + private JsonNullable proxyUrl; + + @JsonCreator + public UpdateDomainRequestBody( + @JsonProperty("name") JsonNullable name, + @JsonProperty("proxy_url") JsonNullable proxyUrl) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.name = name; + this.proxyUrl = proxyUrl; + } + + public UpdateDomainRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The new domain name. For development instances, can contain the port, + * i.e `myhostname:3000`. For production instances, must be a valid FQDN, + * i.e `mysite.com`. Cannot contain protocol scheme. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable name() { + return (JsonNullable) name; + } + + /** + * The full URL of the proxy that will forward requests to Clerk's Frontend API. + * Can only be updated for production instances. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable proxyUrl() { + return (JsonNullable) proxyUrl; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The new domain name. For development instances, can contain the port, + * i.e `myhostname:3000`. For production instances, must be a valid FQDN, + * i.e `mysite.com`. Cannot contain protocol scheme. + */ + public UpdateDomainRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The new domain name. For development instances, can contain the port, + * i.e `myhostname:3000`. For production instances, must be a valid FQDN, + * i.e `mysite.com`. Cannot contain protocol scheme. + */ + public UpdateDomainRequestBody withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The full URL of the proxy that will forward requests to Clerk's Frontend API. + * Can only be updated for production instances. + */ + public UpdateDomainRequestBody withProxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = JsonNullable.of(proxyUrl); + return this; + } + + /** + * The full URL of the proxy that will forward requests to Clerk's Frontend API. + * Can only be updated for production instances. + */ + public UpdateDomainRequestBody withProxyUrl(JsonNullable proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDomainRequestBody other = (UpdateDomainRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.proxyUrl, other.proxyUrl); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + proxyUrl); + } + + @Override + public String toString() { + return Utils.toString(UpdateDomainRequestBody.class, + "name", name, + "proxyUrl", proxyUrl); + } + + public final static class Builder { + + private JsonNullable name = JsonNullable.undefined(); + + private JsonNullable proxyUrl = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The new domain name. For development instances, can contain the port, + * i.e `myhostname:3000`. For production instances, must be a valid FQDN, + * i.e `mysite.com`. Cannot contain protocol scheme. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The new domain name. For development instances, can contain the port, + * i.e `myhostname:3000`. For production instances, must be a valid FQDN, + * i.e `mysite.com`. Cannot contain protocol scheme. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The full URL of the proxy that will forward requests to Clerk's Frontend API. + * Can only be updated for production instances. + */ + public Builder proxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = JsonNullable.of(proxyUrl); + return this; + } + + /** + * The full URL of the proxy that will forward requests to Clerk's Frontend API. + * Can only be updated for production instances. + */ + public Builder proxyUrl(JsonNullable proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + public UpdateDomainRequestBody build() { + return new UpdateDomainRequestBody( + name, + proxyUrl); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequestBuilder.java new file mode 100644 index 0000000..24396e2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateDomainRequestBuilder { + + private String domainId; + private UpdateDomainRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallUpdateDomain sdk; + + public UpdateDomainRequestBuilder(SDKMethodInterfaces.MethodCallUpdateDomain sdk) { + this.sdk = sdk; + } + + public UpdateDomainRequestBuilder domainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + public UpdateDomainRequestBuilder requestBody(UpdateDomainRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateDomainResponse call() throws Exception { + + return sdk.update( + domainId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainResponse.java new file mode 100644 index 0000000..a31f2a8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateDomainResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateDomainResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A domain + */ + private Optional domain; + + @JsonCreator + public UpdateDomainResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional domain) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(domain, "domain"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.domain = domain; + } + + public UpdateDomainResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A domain + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional domain() { + return (Optional) domain; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateDomainResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateDomainResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateDomainResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A domain + */ + public UpdateDomainResponse withDomain(com.clerk.backend_api.models.components.Domain domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = Optional.ofNullable(domain); + return this; + } + + /** + * A domain + */ + public UpdateDomainResponse withDomain(Optional domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDomainResponse other = (UpdateDomainResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.domain, other.domain); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + domain); + } + + @Override + public String toString() { + return Utils.toString(UpdateDomainResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "domain", domain); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional domain = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A domain + */ + public Builder domain(com.clerk.backend_api.models.components.Domain domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = Optional.ofNullable(domain); + return this; + } + + /** + * A domain + */ + public Builder domain(Optional domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + public UpdateDomainResponse build() { + return new UpdateDomainResponse( + contentType, + statusCode, + rawResponse, + domain); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequest.java new file mode 100644 index 0000000..a761246 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequest.java @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdateEmailAddressRequest { + + /** + * The ID of the email address to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=email_address_id") + private String emailAddressId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public UpdateEmailAddressRequest( + String emailAddressId, + Optional requestBody) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.emailAddressId = emailAddressId; + this.requestBody = requestBody; + } + + public UpdateEmailAddressRequest( + String emailAddressId) { + this(emailAddressId, Optional.empty()); + } + + /** + * The ID of the email address to update + */ + @JsonIgnore + public String emailAddressId() { + return emailAddressId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the email address to update + */ + public UpdateEmailAddressRequest withEmailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + public UpdateEmailAddressRequest withRequestBody(UpdateEmailAddressRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public UpdateEmailAddressRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEmailAddressRequest other = (UpdateEmailAddressRequest) o; + return + java.util.Objects.deepEquals(this.emailAddressId, other.emailAddressId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + emailAddressId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateEmailAddressRequest.class, + "emailAddressId", emailAddressId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String emailAddressId; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the email address to update + */ + public Builder emailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + public Builder requestBody(UpdateEmailAddressRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateEmailAddressRequest build() { + return new UpdateEmailAddressRequest( + emailAddressId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequestBody.java new file mode 100644 index 0000000..761db8c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequestBody.java @@ -0,0 +1,190 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateEmailAddressRequestBody { + + /** + * The email address will be marked as verified. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("verified") + private JsonNullable verified; + + /** + * Set this email address as the primary email address for the user. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary") + private JsonNullable primary; + + @JsonCreator + public UpdateEmailAddressRequestBody( + @JsonProperty("verified") JsonNullable verified, + @JsonProperty("primary") JsonNullable primary) { + Utils.checkNotNull(verified, "verified"); + Utils.checkNotNull(primary, "primary"); + this.verified = verified; + this.primary = primary; + } + + public UpdateEmailAddressRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The email address will be marked as verified. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable verified() { + return (JsonNullable) verified; + } + + /** + * Set this email address as the primary email address for the user. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable primary() { + return (JsonNullable) primary; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The email address will be marked as verified. + */ + public UpdateEmailAddressRequestBody withVerified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = JsonNullable.of(verified); + return this; + } + + /** + * The email address will be marked as verified. + */ + public UpdateEmailAddressRequestBody withVerified(JsonNullable verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + /** + * Set this email address as the primary email address for the user. + */ + public UpdateEmailAddressRequestBody withPrimary(boolean primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = JsonNullable.of(primary); + return this; + } + + /** + * Set this email address as the primary email address for the user. + */ + public UpdateEmailAddressRequestBody withPrimary(JsonNullable primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = primary; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEmailAddressRequestBody other = (UpdateEmailAddressRequestBody) o; + return + java.util.Objects.deepEquals(this.verified, other.verified) && + java.util.Objects.deepEquals(this.primary, other.primary); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + verified, + primary); + } + + @Override + public String toString() { + return Utils.toString(UpdateEmailAddressRequestBody.class, + "verified", verified, + "primary", primary); + } + + public final static class Builder { + + private JsonNullable verified = JsonNullable.undefined(); + + private JsonNullable primary = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The email address will be marked as verified. + */ + public Builder verified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = JsonNullable.of(verified); + return this; + } + + /** + * The email address will be marked as verified. + */ + public Builder verified(JsonNullable verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + /** + * Set this email address as the primary email address for the user. + */ + public Builder primary(boolean primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = JsonNullable.of(primary); + return this; + } + + /** + * Set this email address as the primary email address for the user. + */ + public Builder primary(JsonNullable primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = primary; + return this; + } + + public UpdateEmailAddressRequestBody build() { + return new UpdateEmailAddressRequestBody( + verified, + primary); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequestBuilder.java new file mode 100644 index 0000000..27aba5f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateEmailAddressRequestBuilder { + + private String emailAddressId; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateEmailAddress sdk; + + public UpdateEmailAddressRequestBuilder(SDKMethodInterfaces.MethodCallUpdateEmailAddress sdk) { + this.sdk = sdk; + } + + public UpdateEmailAddressRequestBuilder emailAddressId(String emailAddressId) { + Utils.checkNotNull(emailAddressId, "emailAddressId"); + this.emailAddressId = emailAddressId; + return this; + } + + public UpdateEmailAddressRequestBuilder requestBody(UpdateEmailAddressRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public UpdateEmailAddressRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateEmailAddressResponse call() throws Exception { + + return sdk.update( + emailAddressId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressResponse.java new file mode 100644 index 0000000..d8c0fff --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateEmailAddressResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateEmailAddressResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional emailAddress; + + @JsonCreator + public UpdateEmailAddressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional emailAddress) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(emailAddress, "emailAddress"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.emailAddress = emailAddress; + } + + public UpdateEmailAddressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional emailAddress() { + return (Optional) emailAddress; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateEmailAddressResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateEmailAddressResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateEmailAddressResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateEmailAddressResponse withEmailAddress(com.clerk.backend_api.models.components.EmailAddress emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Success + */ + public UpdateEmailAddressResponse withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEmailAddressResponse other = (UpdateEmailAddressResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + emailAddress); + } + + @Override + public String toString() { + return Utils.toString(UpdateEmailAddressResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "emailAddress", emailAddress); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional emailAddress = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder emailAddress(com.clerk.backend_api.models.components.EmailAddress emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Success + */ + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public UpdateEmailAddressResponse build() { + return new UpdateEmailAddressResponse( + contentType, + statusCode, + rawResponse, + emailAddress); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigRequestBody.java new file mode 100644 index 0000000..534266a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigRequestBody.java @@ -0,0 +1,468 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateInstanceAuthConfigRequestBody { + + /** + * Whether sign up is restricted to email addresses, phone numbers and usernames that are on the allowlist. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("restricted_to_allowlist") + private JsonNullable restrictedToAllowlist; + + /** + * The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent. + * Only alphanumeric values are allowed. + * Note that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("from_email_address") + private JsonNullable fromEmailAddress; + + /** + * Enable the Progressive Sign Up algorithm. Refer to the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) for more info. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("progressive_sign_up") + private JsonNullable progressiveSignUp; + + /** + * The name of the JWT Template used to augment your session tokens. To disable this, pass an empty string. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("session_token_template") + private JsonNullable sessionTokenTemplate; + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("enhanced_email_deliverability") + private JsonNullable enhancedEmailDeliverability; + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("test_mode") + private JsonNullable testMode; + + @JsonCreator + public UpdateInstanceAuthConfigRequestBody( + @JsonProperty("restricted_to_allowlist") JsonNullable restrictedToAllowlist, + @JsonProperty("from_email_address") JsonNullable fromEmailAddress, + @JsonProperty("progressive_sign_up") JsonNullable progressiveSignUp, + @JsonProperty("session_token_template") JsonNullable sessionTokenTemplate, + @JsonProperty("enhanced_email_deliverability") JsonNullable enhancedEmailDeliverability, + @JsonProperty("test_mode") JsonNullable testMode) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + Utils.checkNotNull(sessionTokenTemplate, "sessionTokenTemplate"); + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + Utils.checkNotNull(testMode, "testMode"); + this.restrictedToAllowlist = restrictedToAllowlist; + this.fromEmailAddress = fromEmailAddress; + this.progressiveSignUp = progressiveSignUp; + this.sessionTokenTemplate = sessionTokenTemplate; + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + this.testMode = testMode; + } + + public UpdateInstanceAuthConfigRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * Whether sign up is restricted to email addresses, phone numbers and usernames that are on the allowlist. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable restrictedToAllowlist() { + return (JsonNullable) restrictedToAllowlist; + } + + /** + * The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent. + * Only alphanumeric values are allowed. + * Note that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable fromEmailAddress() { + return (JsonNullable) fromEmailAddress; + } + + /** + * Enable the Progressive Sign Up algorithm. Refer to the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) for more info. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable progressiveSignUp() { + return (JsonNullable) progressiveSignUp; + } + + /** + * The name of the JWT Template used to augment your session tokens. To disable this, pass an empty string. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable sessionTokenTemplate() { + return (JsonNullable) sessionTokenTemplate; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable enhancedEmailDeliverability() { + return (JsonNullable) enhancedEmailDeliverability; + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable testMode() { + return (JsonNullable) testMode; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Whether sign up is restricted to email addresses, phone numbers and usernames that are on the allowlist. + */ + public UpdateInstanceAuthConfigRequestBody withRestrictedToAllowlist(boolean restrictedToAllowlist) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + this.restrictedToAllowlist = JsonNullable.of(restrictedToAllowlist); + return this; + } + + /** + * Whether sign up is restricted to email addresses, phone numbers and usernames that are on the allowlist. + */ + public UpdateInstanceAuthConfigRequestBody withRestrictedToAllowlist(JsonNullable restrictedToAllowlist) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + this.restrictedToAllowlist = restrictedToAllowlist; + return this; + } + + /** + * The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent. + * Only alphanumeric values are allowed. + * Note that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`). + */ + public UpdateInstanceAuthConfigRequestBody withFromEmailAddress(String fromEmailAddress) { + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + this.fromEmailAddress = JsonNullable.of(fromEmailAddress); + return this; + } + + /** + * The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent. + * Only alphanumeric values are allowed. + * Note that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`). + */ + public UpdateInstanceAuthConfigRequestBody withFromEmailAddress(JsonNullable fromEmailAddress) { + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + this.fromEmailAddress = fromEmailAddress; + return this; + } + + /** + * Enable the Progressive Sign Up algorithm. Refer to the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) for more info. + */ + public UpdateInstanceAuthConfigRequestBody withProgressiveSignUp(boolean progressiveSignUp) { + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + this.progressiveSignUp = JsonNullable.of(progressiveSignUp); + return this; + } + + /** + * Enable the Progressive Sign Up algorithm. Refer to the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) for more info. + */ + public UpdateInstanceAuthConfigRequestBody withProgressiveSignUp(JsonNullable progressiveSignUp) { + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + this.progressiveSignUp = progressiveSignUp; + return this; + } + + /** + * The name of the JWT Template used to augment your session tokens. To disable this, pass an empty string. + */ + public UpdateInstanceAuthConfigRequestBody withSessionTokenTemplate(String sessionTokenTemplate) { + Utils.checkNotNull(sessionTokenTemplate, "sessionTokenTemplate"); + this.sessionTokenTemplate = JsonNullable.of(sessionTokenTemplate); + return this; + } + + /** + * The name of the JWT Template used to augment your session tokens. To disable this, pass an empty string. + */ + public UpdateInstanceAuthConfigRequestBody withSessionTokenTemplate(JsonNullable sessionTokenTemplate) { + Utils.checkNotNull(sessionTokenTemplate, "sessionTokenTemplate"); + this.sessionTokenTemplate = sessionTokenTemplate; + return this; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + public UpdateInstanceAuthConfigRequestBody withEnhancedEmailDeliverability(boolean enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = JsonNullable.of(enhancedEmailDeliverability); + return this; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + public UpdateInstanceAuthConfigRequestBody withEnhancedEmailDeliverability(JsonNullable enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + return this; + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + public UpdateInstanceAuthConfigRequestBody withTestMode(boolean testMode) { + Utils.checkNotNull(testMode, "testMode"); + this.testMode = JsonNullable.of(testMode); + return this; + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + public UpdateInstanceAuthConfigRequestBody withTestMode(JsonNullable testMode) { + Utils.checkNotNull(testMode, "testMode"); + this.testMode = testMode; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInstanceAuthConfigRequestBody other = (UpdateInstanceAuthConfigRequestBody) o; + return + java.util.Objects.deepEquals(this.restrictedToAllowlist, other.restrictedToAllowlist) && + java.util.Objects.deepEquals(this.fromEmailAddress, other.fromEmailAddress) && + java.util.Objects.deepEquals(this.progressiveSignUp, other.progressiveSignUp) && + java.util.Objects.deepEquals(this.sessionTokenTemplate, other.sessionTokenTemplate) && + java.util.Objects.deepEquals(this.enhancedEmailDeliverability, other.enhancedEmailDeliverability) && + java.util.Objects.deepEquals(this.testMode, other.testMode); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + restrictedToAllowlist, + fromEmailAddress, + progressiveSignUp, + sessionTokenTemplate, + enhancedEmailDeliverability, + testMode); + } + + @Override + public String toString() { + return Utils.toString(UpdateInstanceAuthConfigRequestBody.class, + "restrictedToAllowlist", restrictedToAllowlist, + "fromEmailAddress", fromEmailAddress, + "progressiveSignUp", progressiveSignUp, + "sessionTokenTemplate", sessionTokenTemplate, + "enhancedEmailDeliverability", enhancedEmailDeliverability, + "testMode", testMode); + } + + public final static class Builder { + + private JsonNullable restrictedToAllowlist; + + private JsonNullable fromEmailAddress = JsonNullable.undefined(); + + private JsonNullable progressiveSignUp = JsonNullable.undefined(); + + private JsonNullable sessionTokenTemplate = JsonNullable.undefined(); + + private JsonNullable enhancedEmailDeliverability = JsonNullable.undefined(); + + private JsonNullable testMode = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Whether sign up is restricted to email addresses, phone numbers and usernames that are on the allowlist. + */ + public Builder restrictedToAllowlist(boolean restrictedToAllowlist) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + this.restrictedToAllowlist = JsonNullable.of(restrictedToAllowlist); + return this; + } + + /** + * Whether sign up is restricted to email addresses, phone numbers and usernames that are on the allowlist. + */ + public Builder restrictedToAllowlist(JsonNullable restrictedToAllowlist) { + Utils.checkNotNull(restrictedToAllowlist, "restrictedToAllowlist"); + this.restrictedToAllowlist = restrictedToAllowlist; + return this; + } + + /** + * The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent. + * Only alphanumeric values are allowed. + * Note that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`). + */ + public Builder fromEmailAddress(String fromEmailAddress) { + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + this.fromEmailAddress = JsonNullable.of(fromEmailAddress); + return this; + } + + /** + * The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent. + * Only alphanumeric values are allowed. + * Note that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`). + */ + public Builder fromEmailAddress(JsonNullable fromEmailAddress) { + Utils.checkNotNull(fromEmailAddress, "fromEmailAddress"); + this.fromEmailAddress = fromEmailAddress; + return this; + } + + /** + * Enable the Progressive Sign Up algorithm. Refer to the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) for more info. + */ + public Builder progressiveSignUp(boolean progressiveSignUp) { + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + this.progressiveSignUp = JsonNullable.of(progressiveSignUp); + return this; + } + + /** + * Enable the Progressive Sign Up algorithm. Refer to the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) for more info. + */ + public Builder progressiveSignUp(JsonNullable progressiveSignUp) { + Utils.checkNotNull(progressiveSignUp, "progressiveSignUp"); + this.progressiveSignUp = progressiveSignUp; + return this; + } + + /** + * The name of the JWT Template used to augment your session tokens. To disable this, pass an empty string. + */ + public Builder sessionTokenTemplate(String sessionTokenTemplate) { + Utils.checkNotNull(sessionTokenTemplate, "sessionTokenTemplate"); + this.sessionTokenTemplate = JsonNullable.of(sessionTokenTemplate); + return this; + } + + /** + * The name of the JWT Template used to augment your session tokens. To disable this, pass an empty string. + */ + public Builder sessionTokenTemplate(JsonNullable sessionTokenTemplate) { + Utils.checkNotNull(sessionTokenTemplate, "sessionTokenTemplate"); + this.sessionTokenTemplate = sessionTokenTemplate; + return this; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + public Builder enhancedEmailDeliverability(boolean enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = JsonNullable.of(enhancedEmailDeliverability); + return this; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + public Builder enhancedEmailDeliverability(JsonNullable enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + return this; + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + public Builder testMode(boolean testMode) { + Utils.checkNotNull(testMode, "testMode"); + this.testMode = JsonNullable.of(testMode); + return this; + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + public Builder testMode(JsonNullable testMode) { + Utils.checkNotNull(testMode, "testMode"); + this.testMode = testMode; + return this; + } + + public UpdateInstanceAuthConfigRequestBody build() { + if (restrictedToAllowlist == null) { + restrictedToAllowlist = _SINGLETON_VALUE_RestrictedToAllowlist.value(); + } + return new UpdateInstanceAuthConfigRequestBody( + restrictedToAllowlist, + fromEmailAddress, + progressiveSignUp, + sessionTokenTemplate, + enhancedEmailDeliverability, + testMode); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_RestrictedToAllowlist = + new LazySingletonValue<>( + "restricted_to_allowlist", + "false", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigRequestBuilder.java new file mode 100644 index 0000000..003f915 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateInstanceAuthConfigRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateInstanceAuthConfig sdk; + + public UpdateInstanceAuthConfigRequestBuilder(SDKMethodInterfaces.MethodCallUpdateInstanceAuthConfig sdk) { + this.sdk = sdk; + } + + public UpdateInstanceAuthConfigRequestBuilder request(UpdateInstanceAuthConfigRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public UpdateInstanceAuthConfigRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public UpdateInstanceAuthConfigResponse call() throws Exception { + + return sdk.updateAuthConfig( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigResponse.java new file mode 100644 index 0000000..deddb56 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceAuthConfigResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateInstanceAuthConfigResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * InstanceSettings Server API + */ + private Optional instanceSettings; + + @JsonCreator + public UpdateInstanceAuthConfigResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional instanceSettings) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(instanceSettings, "instanceSettings"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.instanceSettings = instanceSettings; + } + + public UpdateInstanceAuthConfigResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * InstanceSettings Server API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional instanceSettings() { + return (Optional) instanceSettings; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateInstanceAuthConfigResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateInstanceAuthConfigResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateInstanceAuthConfigResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * InstanceSettings Server API + */ + public UpdateInstanceAuthConfigResponse withInstanceSettings(com.clerk.backend_api.models.components.InstanceSettings instanceSettings) { + Utils.checkNotNull(instanceSettings, "instanceSettings"); + this.instanceSettings = Optional.ofNullable(instanceSettings); + return this; + } + + /** + * InstanceSettings Server API + */ + public UpdateInstanceAuthConfigResponse withInstanceSettings(Optional instanceSettings) { + Utils.checkNotNull(instanceSettings, "instanceSettings"); + this.instanceSettings = instanceSettings; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInstanceAuthConfigResponse other = (UpdateInstanceAuthConfigResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.instanceSettings, other.instanceSettings); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + instanceSettings); + } + + @Override + public String toString() { + return Utils.toString(UpdateInstanceAuthConfigResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "instanceSettings", instanceSettings); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional instanceSettings = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * InstanceSettings Server API + */ + public Builder instanceSettings(com.clerk.backend_api.models.components.InstanceSettings instanceSettings) { + Utils.checkNotNull(instanceSettings, "instanceSettings"); + this.instanceSettings = Optional.ofNullable(instanceSettings); + return this; + } + + /** + * InstanceSettings Server API + */ + public Builder instanceSettings(Optional instanceSettings) { + Utils.checkNotNull(instanceSettings, "instanceSettings"); + this.instanceSettings = instanceSettings; + return this; + } + + public UpdateInstanceAuthConfigResponse build() { + return new UpdateInstanceAuthConfigResponse( + contentType, + statusCode, + rawResponse, + instanceSettings); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsRequestBody.java new file mode 100644 index 0000000..19b2d42 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsRequestBody.java @@ -0,0 +1,430 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateInstanceOrganizationSettingsRequestBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("enabled") + private JsonNullable enabled; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("max_allowed_memberships") + private JsonNullable maxAllowedMemberships; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("admin_delete_enabled") + private JsonNullable adminDeleteEnabled; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("domains_enabled") + private JsonNullable domainsEnabled; + + /** + * Specify which enrollment modes to enable for your Organization Domains. + * Supported modes are 'automatic_invitation' & 'automatic_suggestion'. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("domains_enrollment_modes") + private Optional> domainsEnrollmentModes; + + /** + * Specify what the default organization role is for an organization creator. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("creator_role_id") + private Optional creatorRoleId; + + /** + * Specify what the default organization role is for the organization domains. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("domains_default_role_id") + private Optional domainsDefaultRoleId; + + @JsonCreator + public UpdateInstanceOrganizationSettingsRequestBody( + @JsonProperty("enabled") JsonNullable enabled, + @JsonProperty("max_allowed_memberships") JsonNullable maxAllowedMemberships, + @JsonProperty("admin_delete_enabled") JsonNullable adminDeleteEnabled, + @JsonProperty("domains_enabled") JsonNullable domainsEnabled, + @JsonProperty("domains_enrollment_modes") Optional> domainsEnrollmentModes, + @JsonProperty("creator_role_id") Optional creatorRoleId, + @JsonProperty("domains_default_role_id") Optional domainsDefaultRoleId) { + Utils.checkNotNull(enabled, "enabled"); + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + Utils.checkNotNull(domainsEnabled, "domainsEnabled"); + Utils.checkNotNull(domainsEnrollmentModes, "domainsEnrollmentModes"); + Utils.checkNotNull(creatorRoleId, "creatorRoleId"); + Utils.checkNotNull(domainsDefaultRoleId, "domainsDefaultRoleId"); + this.enabled = enabled; + this.maxAllowedMemberships = maxAllowedMemberships; + this.adminDeleteEnabled = adminDeleteEnabled; + this.domainsEnabled = domainsEnabled; + this.domainsEnrollmentModes = domainsEnrollmentModes; + this.creatorRoleId = creatorRoleId; + this.domainsDefaultRoleId = domainsDefaultRoleId; + } + + public UpdateInstanceOrganizationSettingsRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable enabled() { + return (JsonNullable) enabled; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable maxAllowedMemberships() { + return (JsonNullable) maxAllowedMemberships; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable adminDeleteEnabled() { + return (JsonNullable) adminDeleteEnabled; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable domainsEnabled() { + return (JsonNullable) domainsEnabled; + } + + /** + * Specify which enrollment modes to enable for your Organization Domains. + * Supported modes are 'automatic_invitation' & 'automatic_suggestion'. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> domainsEnrollmentModes() { + return (Optional>) domainsEnrollmentModes; + } + + /** + * Specify what the default organization role is for an organization creator. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional creatorRoleId() { + return (Optional) creatorRoleId; + } + + /** + * Specify what the default organization role is for the organization domains. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional domainsDefaultRoleId() { + return (Optional) domainsDefaultRoleId; + } + + public final static Builder builder() { + return new Builder(); + } + + public UpdateInstanceOrganizationSettingsRequestBody withEnabled(boolean enabled) { + Utils.checkNotNull(enabled, "enabled"); + this.enabled = JsonNullable.of(enabled); + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBody withEnabled(JsonNullable enabled) { + Utils.checkNotNull(enabled, "enabled"); + this.enabled = enabled; + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBody withMaxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = JsonNullable.of(maxAllowedMemberships); + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBody withMaxAllowedMemberships(JsonNullable maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBody withAdminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = JsonNullable.of(adminDeleteEnabled); + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBody withAdminDeleteEnabled(JsonNullable adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBody withDomainsEnabled(boolean domainsEnabled) { + Utils.checkNotNull(domainsEnabled, "domainsEnabled"); + this.domainsEnabled = JsonNullable.of(domainsEnabled); + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBody withDomainsEnabled(JsonNullable domainsEnabled) { + Utils.checkNotNull(domainsEnabled, "domainsEnabled"); + this.domainsEnabled = domainsEnabled; + return this; + } + + /** + * Specify which enrollment modes to enable for your Organization Domains. + * Supported modes are 'automatic_invitation' & 'automatic_suggestion'. + */ + public UpdateInstanceOrganizationSettingsRequestBody withDomainsEnrollmentModes(java.util.List domainsEnrollmentModes) { + Utils.checkNotNull(domainsEnrollmentModes, "domainsEnrollmentModes"); + this.domainsEnrollmentModes = Optional.ofNullable(domainsEnrollmentModes); + return this; + } + + /** + * Specify which enrollment modes to enable for your Organization Domains. + * Supported modes are 'automatic_invitation' & 'automatic_suggestion'. + */ + public UpdateInstanceOrganizationSettingsRequestBody withDomainsEnrollmentModes(Optional> domainsEnrollmentModes) { + Utils.checkNotNull(domainsEnrollmentModes, "domainsEnrollmentModes"); + this.domainsEnrollmentModes = domainsEnrollmentModes; + return this; + } + + /** + * Specify what the default organization role is for an organization creator. + */ + public UpdateInstanceOrganizationSettingsRequestBody withCreatorRoleId(String creatorRoleId) { + Utils.checkNotNull(creatorRoleId, "creatorRoleId"); + this.creatorRoleId = Optional.ofNullable(creatorRoleId); + return this; + } + + /** + * Specify what the default organization role is for an organization creator. + */ + public UpdateInstanceOrganizationSettingsRequestBody withCreatorRoleId(Optional creatorRoleId) { + Utils.checkNotNull(creatorRoleId, "creatorRoleId"); + this.creatorRoleId = creatorRoleId; + return this; + } + + /** + * Specify what the default organization role is for the organization domains. + */ + public UpdateInstanceOrganizationSettingsRequestBody withDomainsDefaultRoleId(String domainsDefaultRoleId) { + Utils.checkNotNull(domainsDefaultRoleId, "domainsDefaultRoleId"); + this.domainsDefaultRoleId = Optional.ofNullable(domainsDefaultRoleId); + return this; + } + + /** + * Specify what the default organization role is for the organization domains. + */ + public UpdateInstanceOrganizationSettingsRequestBody withDomainsDefaultRoleId(Optional domainsDefaultRoleId) { + Utils.checkNotNull(domainsDefaultRoleId, "domainsDefaultRoleId"); + this.domainsDefaultRoleId = domainsDefaultRoleId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInstanceOrganizationSettingsRequestBody other = (UpdateInstanceOrganizationSettingsRequestBody) o; + return + java.util.Objects.deepEquals(this.enabled, other.enabled) && + java.util.Objects.deepEquals(this.maxAllowedMemberships, other.maxAllowedMemberships) && + java.util.Objects.deepEquals(this.adminDeleteEnabled, other.adminDeleteEnabled) && + java.util.Objects.deepEquals(this.domainsEnabled, other.domainsEnabled) && + java.util.Objects.deepEquals(this.domainsEnrollmentModes, other.domainsEnrollmentModes) && + java.util.Objects.deepEquals(this.creatorRoleId, other.creatorRoleId) && + java.util.Objects.deepEquals(this.domainsDefaultRoleId, other.domainsDefaultRoleId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + enabled, + maxAllowedMemberships, + adminDeleteEnabled, + domainsEnabled, + domainsEnrollmentModes, + creatorRoleId, + domainsDefaultRoleId); + } + + @Override + public String toString() { + return Utils.toString(UpdateInstanceOrganizationSettingsRequestBody.class, + "enabled", enabled, + "maxAllowedMemberships", maxAllowedMemberships, + "adminDeleteEnabled", adminDeleteEnabled, + "domainsEnabled", domainsEnabled, + "domainsEnrollmentModes", domainsEnrollmentModes, + "creatorRoleId", creatorRoleId, + "domainsDefaultRoleId", domainsDefaultRoleId); + } + + public final static class Builder { + + private JsonNullable enabled = JsonNullable.undefined(); + + private JsonNullable maxAllowedMemberships = JsonNullable.undefined(); + + private JsonNullable adminDeleteEnabled = JsonNullable.undefined(); + + private JsonNullable domainsEnabled = JsonNullable.undefined(); + + private Optional> domainsEnrollmentModes = Optional.empty(); + + private Optional creatorRoleId = Optional.empty(); + + private Optional domainsDefaultRoleId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder enabled(boolean enabled) { + Utils.checkNotNull(enabled, "enabled"); + this.enabled = JsonNullable.of(enabled); + return this; + } + + public Builder enabled(JsonNullable enabled) { + Utils.checkNotNull(enabled, "enabled"); + this.enabled = enabled; + return this; + } + + public Builder maxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = JsonNullable.of(maxAllowedMemberships); + return this; + } + + public Builder maxAllowedMemberships(JsonNullable maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + public Builder adminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = JsonNullable.of(adminDeleteEnabled); + return this; + } + + public Builder adminDeleteEnabled(JsonNullable adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public Builder domainsEnabled(boolean domainsEnabled) { + Utils.checkNotNull(domainsEnabled, "domainsEnabled"); + this.domainsEnabled = JsonNullable.of(domainsEnabled); + return this; + } + + public Builder domainsEnabled(JsonNullable domainsEnabled) { + Utils.checkNotNull(domainsEnabled, "domainsEnabled"); + this.domainsEnabled = domainsEnabled; + return this; + } + + /** + * Specify which enrollment modes to enable for your Organization Domains. + * Supported modes are 'automatic_invitation' & 'automatic_suggestion'. + */ + public Builder domainsEnrollmentModes(java.util.List domainsEnrollmentModes) { + Utils.checkNotNull(domainsEnrollmentModes, "domainsEnrollmentModes"); + this.domainsEnrollmentModes = Optional.ofNullable(domainsEnrollmentModes); + return this; + } + + /** + * Specify which enrollment modes to enable for your Organization Domains. + * Supported modes are 'automatic_invitation' & 'automatic_suggestion'. + */ + public Builder domainsEnrollmentModes(Optional> domainsEnrollmentModes) { + Utils.checkNotNull(domainsEnrollmentModes, "domainsEnrollmentModes"); + this.domainsEnrollmentModes = domainsEnrollmentModes; + return this; + } + + /** + * Specify what the default organization role is for an organization creator. + */ + public Builder creatorRoleId(String creatorRoleId) { + Utils.checkNotNull(creatorRoleId, "creatorRoleId"); + this.creatorRoleId = Optional.ofNullable(creatorRoleId); + return this; + } + + /** + * Specify what the default organization role is for an organization creator. + */ + public Builder creatorRoleId(Optional creatorRoleId) { + Utils.checkNotNull(creatorRoleId, "creatorRoleId"); + this.creatorRoleId = creatorRoleId; + return this; + } + + /** + * Specify what the default organization role is for the organization domains. + */ + public Builder domainsDefaultRoleId(String domainsDefaultRoleId) { + Utils.checkNotNull(domainsDefaultRoleId, "domainsDefaultRoleId"); + this.domainsDefaultRoleId = Optional.ofNullable(domainsDefaultRoleId); + return this; + } + + /** + * Specify what the default organization role is for the organization domains. + */ + public Builder domainsDefaultRoleId(Optional domainsDefaultRoleId) { + Utils.checkNotNull(domainsDefaultRoleId, "domainsDefaultRoleId"); + this.domainsDefaultRoleId = domainsDefaultRoleId; + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBody build() { + return new UpdateInstanceOrganizationSettingsRequestBody( + enabled, + maxAllowedMemberships, + adminDeleteEnabled, + domainsEnabled, + domainsEnrollmentModes, + creatorRoleId, + domainsDefaultRoleId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsRequestBuilder.java new file mode 100644 index 0000000..f19396e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateInstanceOrganizationSettingsRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateInstanceOrganizationSettings sdk; + + public UpdateInstanceOrganizationSettingsRequestBuilder(SDKMethodInterfaces.MethodCallUpdateInstanceOrganizationSettings sdk) { + this.sdk = sdk; + } + + public UpdateInstanceOrganizationSettingsRequestBuilder request(UpdateInstanceOrganizationSettingsRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public UpdateInstanceOrganizationSettingsRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public UpdateInstanceOrganizationSettingsResponse call() throws Exception { + + return sdk.updateOrganizationSettings( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsResponse.java new file mode 100644 index 0000000..b50d640 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceOrganizationSettingsResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateInstanceOrganizationSettingsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional organizationSettings; + + @JsonCreator + public UpdateInstanceOrganizationSettingsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationSettings) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationSettings, "organizationSettings"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationSettings = organizationSettings; + } + + public UpdateInstanceOrganizationSettingsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationSettings() { + return (Optional) organizationSettings; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateInstanceOrganizationSettingsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateInstanceOrganizationSettingsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateInstanceOrganizationSettingsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateInstanceOrganizationSettingsResponse withOrganizationSettings(com.clerk.backend_api.models.components.OrganizationSettings organizationSettings) { + Utils.checkNotNull(organizationSettings, "organizationSettings"); + this.organizationSettings = Optional.ofNullable(organizationSettings); + return this; + } + + /** + * Success + */ + public UpdateInstanceOrganizationSettingsResponse withOrganizationSettings(Optional organizationSettings) { + Utils.checkNotNull(organizationSettings, "organizationSettings"); + this.organizationSettings = organizationSettings; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInstanceOrganizationSettingsResponse other = (UpdateInstanceOrganizationSettingsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationSettings, other.organizationSettings); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationSettings); + } + + @Override + public String toString() { + return Utils.toString(UpdateInstanceOrganizationSettingsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationSettings", organizationSettings); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationSettings = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder organizationSettings(com.clerk.backend_api.models.components.OrganizationSettings organizationSettings) { + Utils.checkNotNull(organizationSettings, "organizationSettings"); + this.organizationSettings = Optional.ofNullable(organizationSettings); + return this; + } + + /** + * Success + */ + public Builder organizationSettings(Optional organizationSettings) { + Utils.checkNotNull(organizationSettings, "organizationSettings"); + this.organizationSettings = organizationSettings; + return this; + } + + public UpdateInstanceOrganizationSettingsResponse build() { + return new UpdateInstanceOrganizationSettingsResponse( + contentType, + statusCode, + rawResponse, + organizationSettings); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRequestBody.java new file mode 100644 index 0000000..ba11ebd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRequestBody.java @@ -0,0 +1,601 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateInstanceRequestBody { + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("test_mode") + private JsonNullable testMode; + + /** + * Whether the instance should be using the HIBP service to check passwords for breaches + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hibp") + private JsonNullable hibp; + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("enhanced_email_deliverability") + private JsonNullable enhancedEmailDeliverability; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("support_email") + private JsonNullable supportEmail; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("clerk_js_version") + private JsonNullable clerkJsVersion; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("development_origin") + private JsonNullable developmentOrigin; + + /** + * For browser-like stacks such as browser extensions, Electron, or Capacitor.js the instance allowed origins need to be updated with the request origin value. + * For Chrome extensions popup, background, or service worker pages the origin is chrome-extension://extension_uiid. For Electron apps the default origin is http://localhost:3000. For Capacitor, the origin is capacitor://localhost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allowed_origins") + private Optional> allowedOrigins; + + /** + * Whether the instance should operate in cookieless development mode (i.e. without third-party cookies). + * Deprecated: Please use `url_based_session_syncing` instead. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("cookieless_dev") + @Deprecated + private Optional cookielessDev; + + /** + * Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("url_based_session_syncing") + private Optional urlBasedSessionSyncing; + + @JsonCreator + public UpdateInstanceRequestBody( + @JsonProperty("test_mode") JsonNullable testMode, + @JsonProperty("hibp") JsonNullable hibp, + @JsonProperty("enhanced_email_deliverability") JsonNullable enhancedEmailDeliverability, + @JsonProperty("support_email") JsonNullable supportEmail, + @JsonProperty("clerk_js_version") JsonNullable clerkJsVersion, + @JsonProperty("development_origin") JsonNullable developmentOrigin, + @JsonProperty("allowed_origins") Optional> allowedOrigins, + @JsonProperty("cookieless_dev") Optional cookielessDev, + @JsonProperty("url_based_session_syncing") Optional urlBasedSessionSyncing) { + Utils.checkNotNull(testMode, "testMode"); + Utils.checkNotNull(hibp, "hibp"); + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + Utils.checkNotNull(supportEmail, "supportEmail"); + Utils.checkNotNull(clerkJsVersion, "clerkJsVersion"); + Utils.checkNotNull(developmentOrigin, "developmentOrigin"); + Utils.checkNotNull(allowedOrigins, "allowedOrigins"); + Utils.checkNotNull(cookielessDev, "cookielessDev"); + Utils.checkNotNull(urlBasedSessionSyncing, "urlBasedSessionSyncing"); + this.testMode = testMode; + this.hibp = hibp; + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + this.supportEmail = supportEmail; + this.clerkJsVersion = clerkJsVersion; + this.developmentOrigin = developmentOrigin; + this.allowedOrigins = allowedOrigins; + this.cookielessDev = cookielessDev; + this.urlBasedSessionSyncing = urlBasedSessionSyncing; + } + + public UpdateInstanceRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable testMode() { + return (JsonNullable) testMode; + } + + /** + * Whether the instance should be using the HIBP service to check passwords for breaches + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable hibp() { + return (JsonNullable) hibp; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable enhancedEmailDeliverability() { + return (JsonNullable) enhancedEmailDeliverability; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable supportEmail() { + return (JsonNullable) supportEmail; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable clerkJsVersion() { + return (JsonNullable) clerkJsVersion; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable developmentOrigin() { + return (JsonNullable) developmentOrigin; + } + + /** + * For browser-like stacks such as browser extensions, Electron, or Capacitor.js the instance allowed origins need to be updated with the request origin value. + * For Chrome extensions popup, background, or service worker pages the origin is chrome-extension://extension_uiid. For Electron apps the default origin is http://localhost:3000. For Capacitor, the origin is capacitor://localhost. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> allowedOrigins() { + return (Optional>) allowedOrigins; + } + + /** + * Whether the instance should operate in cookieless development mode (i.e. without third-party cookies). + * Deprecated: Please use `url_based_session_syncing` instead. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional cookielessDev() { + return (Optional) cookielessDev; + } + + /** + * Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional urlBasedSessionSyncing() { + return (Optional) urlBasedSessionSyncing; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + public UpdateInstanceRequestBody withTestMode(boolean testMode) { + Utils.checkNotNull(testMode, "testMode"); + this.testMode = JsonNullable.of(testMode); + return this; + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + public UpdateInstanceRequestBody withTestMode(JsonNullable testMode) { + Utils.checkNotNull(testMode, "testMode"); + this.testMode = testMode; + return this; + } + + /** + * Whether the instance should be using the HIBP service to check passwords for breaches + */ + public UpdateInstanceRequestBody withHibp(boolean hibp) { + Utils.checkNotNull(hibp, "hibp"); + this.hibp = JsonNullable.of(hibp); + return this; + } + + /** + * Whether the instance should be using the HIBP service to check passwords for breaches + */ + public UpdateInstanceRequestBody withHibp(JsonNullable hibp) { + Utils.checkNotNull(hibp, "hibp"); + this.hibp = hibp; + return this; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + public UpdateInstanceRequestBody withEnhancedEmailDeliverability(boolean enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = JsonNullable.of(enhancedEmailDeliverability); + return this; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + public UpdateInstanceRequestBody withEnhancedEmailDeliverability(JsonNullable enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + return this; + } + + public UpdateInstanceRequestBody withSupportEmail(String supportEmail) { + Utils.checkNotNull(supportEmail, "supportEmail"); + this.supportEmail = JsonNullable.of(supportEmail); + return this; + } + + public UpdateInstanceRequestBody withSupportEmail(JsonNullable supportEmail) { + Utils.checkNotNull(supportEmail, "supportEmail"); + this.supportEmail = supportEmail; + return this; + } + + public UpdateInstanceRequestBody withClerkJsVersion(String clerkJsVersion) { + Utils.checkNotNull(clerkJsVersion, "clerkJsVersion"); + this.clerkJsVersion = JsonNullable.of(clerkJsVersion); + return this; + } + + public UpdateInstanceRequestBody withClerkJsVersion(JsonNullable clerkJsVersion) { + Utils.checkNotNull(clerkJsVersion, "clerkJsVersion"); + this.clerkJsVersion = clerkJsVersion; + return this; + } + + public UpdateInstanceRequestBody withDevelopmentOrigin(String developmentOrigin) { + Utils.checkNotNull(developmentOrigin, "developmentOrigin"); + this.developmentOrigin = JsonNullable.of(developmentOrigin); + return this; + } + + public UpdateInstanceRequestBody withDevelopmentOrigin(JsonNullable developmentOrigin) { + Utils.checkNotNull(developmentOrigin, "developmentOrigin"); + this.developmentOrigin = developmentOrigin; + return this; + } + + /** + * For browser-like stacks such as browser extensions, Electron, or Capacitor.js the instance allowed origins need to be updated with the request origin value. + * For Chrome extensions popup, background, or service worker pages the origin is chrome-extension://extension_uiid. For Electron apps the default origin is http://localhost:3000. For Capacitor, the origin is capacitor://localhost. + */ + public UpdateInstanceRequestBody withAllowedOrigins(java.util.List allowedOrigins) { + Utils.checkNotNull(allowedOrigins, "allowedOrigins"); + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + * For browser-like stacks such as browser extensions, Electron, or Capacitor.js the instance allowed origins need to be updated with the request origin value. + * For Chrome extensions popup, background, or service worker pages the origin is chrome-extension://extension_uiid. For Electron apps the default origin is http://localhost:3000. For Capacitor, the origin is capacitor://localhost. + */ + public UpdateInstanceRequestBody withAllowedOrigins(Optional> allowedOrigins) { + Utils.checkNotNull(allowedOrigins, "allowedOrigins"); + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Whether the instance should operate in cookieless development mode (i.e. without third-party cookies). + * Deprecated: Please use `url_based_session_syncing` instead. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public UpdateInstanceRequestBody withCookielessDev(boolean cookielessDev) { + Utils.checkNotNull(cookielessDev, "cookielessDev"); + this.cookielessDev = Optional.ofNullable(cookielessDev); + return this; + } + + /** + * Whether the instance should operate in cookieless development mode (i.e. without third-party cookies). + * Deprecated: Please use `url_based_session_syncing` instead. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public UpdateInstanceRequestBody withCookielessDev(Optional cookielessDev) { + Utils.checkNotNull(cookielessDev, "cookielessDev"); + this.cookielessDev = cookielessDev; + return this; + } + + /** + * Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies). + */ + public UpdateInstanceRequestBody withUrlBasedSessionSyncing(boolean urlBasedSessionSyncing) { + Utils.checkNotNull(urlBasedSessionSyncing, "urlBasedSessionSyncing"); + this.urlBasedSessionSyncing = Optional.ofNullable(urlBasedSessionSyncing); + return this; + } + + /** + * Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies). + */ + public UpdateInstanceRequestBody withUrlBasedSessionSyncing(Optional urlBasedSessionSyncing) { + Utils.checkNotNull(urlBasedSessionSyncing, "urlBasedSessionSyncing"); + this.urlBasedSessionSyncing = urlBasedSessionSyncing; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInstanceRequestBody other = (UpdateInstanceRequestBody) o; + return + java.util.Objects.deepEquals(this.testMode, other.testMode) && + java.util.Objects.deepEquals(this.hibp, other.hibp) && + java.util.Objects.deepEquals(this.enhancedEmailDeliverability, other.enhancedEmailDeliverability) && + java.util.Objects.deepEquals(this.supportEmail, other.supportEmail) && + java.util.Objects.deepEquals(this.clerkJsVersion, other.clerkJsVersion) && + java.util.Objects.deepEquals(this.developmentOrigin, other.developmentOrigin) && + java.util.Objects.deepEquals(this.allowedOrigins, other.allowedOrigins) && + java.util.Objects.deepEquals(this.cookielessDev, other.cookielessDev) && + java.util.Objects.deepEquals(this.urlBasedSessionSyncing, other.urlBasedSessionSyncing); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + testMode, + hibp, + enhancedEmailDeliverability, + supportEmail, + clerkJsVersion, + developmentOrigin, + allowedOrigins, + cookielessDev, + urlBasedSessionSyncing); + } + + @Override + public String toString() { + return Utils.toString(UpdateInstanceRequestBody.class, + "testMode", testMode, + "hibp", hibp, + "enhancedEmailDeliverability", enhancedEmailDeliverability, + "supportEmail", supportEmail, + "clerkJsVersion", clerkJsVersion, + "developmentOrigin", developmentOrigin, + "allowedOrigins", allowedOrigins, + "cookielessDev", cookielessDev, + "urlBasedSessionSyncing", urlBasedSessionSyncing); + } + + public final static class Builder { + + private JsonNullable testMode = JsonNullable.undefined(); + + private JsonNullable hibp = JsonNullable.undefined(); + + private JsonNullable enhancedEmailDeliverability = JsonNullable.undefined(); + + private JsonNullable supportEmail = JsonNullable.undefined(); + + private JsonNullable clerkJsVersion = JsonNullable.undefined(); + + private JsonNullable developmentOrigin = JsonNullable.undefined(); + + private Optional> allowedOrigins = Optional.empty(); + + @Deprecated + private Optional cookielessDev = Optional.empty(); + + private Optional urlBasedSessionSyncing = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + public Builder testMode(boolean testMode) { + Utils.checkNotNull(testMode, "testMode"); + this.testMode = JsonNullable.of(testMode); + return this; + } + + /** + * Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + * Defaults to true for development instances. + */ + public Builder testMode(JsonNullable testMode) { + Utils.checkNotNull(testMode, "testMode"); + this.testMode = testMode; + return this; + } + + /** + * Whether the instance should be using the HIBP service to check passwords for breaches + */ + public Builder hibp(boolean hibp) { + Utils.checkNotNull(hibp, "hibp"); + this.hibp = JsonNullable.of(hibp); + return this; + } + + /** + * Whether the instance should be using the HIBP service to check passwords for breaches + */ + public Builder hibp(JsonNullable hibp) { + Utils.checkNotNull(hibp, "hibp"); + this.hibp = hibp; + return this; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + public Builder enhancedEmailDeliverability(boolean enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = JsonNullable.of(enhancedEmailDeliverability); + return this; + } + + /** + * The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + * This can be helpful if you do not have a high domain reputation. + */ + public Builder enhancedEmailDeliverability(JsonNullable enhancedEmailDeliverability) { + Utils.checkNotNull(enhancedEmailDeliverability, "enhancedEmailDeliverability"); + this.enhancedEmailDeliverability = enhancedEmailDeliverability; + return this; + } + + public Builder supportEmail(String supportEmail) { + Utils.checkNotNull(supportEmail, "supportEmail"); + this.supportEmail = JsonNullable.of(supportEmail); + return this; + } + + public Builder supportEmail(JsonNullable supportEmail) { + Utils.checkNotNull(supportEmail, "supportEmail"); + this.supportEmail = supportEmail; + return this; + } + + public Builder clerkJsVersion(String clerkJsVersion) { + Utils.checkNotNull(clerkJsVersion, "clerkJsVersion"); + this.clerkJsVersion = JsonNullable.of(clerkJsVersion); + return this; + } + + public Builder clerkJsVersion(JsonNullable clerkJsVersion) { + Utils.checkNotNull(clerkJsVersion, "clerkJsVersion"); + this.clerkJsVersion = clerkJsVersion; + return this; + } + + public Builder developmentOrigin(String developmentOrigin) { + Utils.checkNotNull(developmentOrigin, "developmentOrigin"); + this.developmentOrigin = JsonNullable.of(developmentOrigin); + return this; + } + + public Builder developmentOrigin(JsonNullable developmentOrigin) { + Utils.checkNotNull(developmentOrigin, "developmentOrigin"); + this.developmentOrigin = developmentOrigin; + return this; + } + + /** + * For browser-like stacks such as browser extensions, Electron, or Capacitor.js the instance allowed origins need to be updated with the request origin value. + * For Chrome extensions popup, background, or service worker pages the origin is chrome-extension://extension_uiid. For Electron apps the default origin is http://localhost:3000. For Capacitor, the origin is capacitor://localhost. + */ + public Builder allowedOrigins(java.util.List allowedOrigins) { + Utils.checkNotNull(allowedOrigins, "allowedOrigins"); + this.allowedOrigins = Optional.ofNullable(allowedOrigins); + return this; + } + + /** + * For browser-like stacks such as browser extensions, Electron, or Capacitor.js the instance allowed origins need to be updated with the request origin value. + * For Chrome extensions popup, background, or service worker pages the origin is chrome-extension://extension_uiid. For Electron apps the default origin is http://localhost:3000. For Capacitor, the origin is capacitor://localhost. + */ + public Builder allowedOrigins(Optional> allowedOrigins) { + Utils.checkNotNull(allowedOrigins, "allowedOrigins"); + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Whether the instance should operate in cookieless development mode (i.e. without third-party cookies). + * Deprecated: Please use `url_based_session_syncing` instead. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder cookielessDev(boolean cookielessDev) { + Utils.checkNotNull(cookielessDev, "cookielessDev"); + this.cookielessDev = Optional.ofNullable(cookielessDev); + return this; + } + + /** + * Whether the instance should operate in cookieless development mode (i.e. without third-party cookies). + * Deprecated: Please use `url_based_session_syncing` instead. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder cookielessDev(Optional cookielessDev) { + Utils.checkNotNull(cookielessDev, "cookielessDev"); + this.cookielessDev = cookielessDev; + return this; + } + + /** + * Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies). + */ + public Builder urlBasedSessionSyncing(boolean urlBasedSessionSyncing) { + Utils.checkNotNull(urlBasedSessionSyncing, "urlBasedSessionSyncing"); + this.urlBasedSessionSyncing = Optional.ofNullable(urlBasedSessionSyncing); + return this; + } + + /** + * Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies). + */ + public Builder urlBasedSessionSyncing(Optional urlBasedSessionSyncing) { + Utils.checkNotNull(urlBasedSessionSyncing, "urlBasedSessionSyncing"); + this.urlBasedSessionSyncing = urlBasedSessionSyncing; + return this; + } + + public UpdateInstanceRequestBody build() { + return new UpdateInstanceRequestBody( + testMode, + hibp, + enhancedEmailDeliverability, + supportEmail, + clerkJsVersion, + developmentOrigin, + allowedOrigins, + cookielessDev, + urlBasedSessionSyncing); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRequestBuilder.java new file mode 100644 index 0000000..ac3c005 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateInstanceRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateInstance sdk; + + public UpdateInstanceRequestBuilder(SDKMethodInterfaces.MethodCallUpdateInstance sdk) { + this.sdk = sdk; + } + + public UpdateInstanceRequestBuilder request(UpdateInstanceRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public UpdateInstanceRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public UpdateInstanceResponse call() throws Exception { + + return sdk.update( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceResponse.java new file mode 100644 index 0000000..5a67861 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; + +public class UpdateInstanceResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public UpdateInstanceResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateInstanceResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateInstanceResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateInstanceResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInstanceResponse other = (UpdateInstanceResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdateInstanceResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UpdateInstanceResponse build() { + return new UpdateInstanceResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsRequestBody.java new file mode 100644 index 0000000..6ed0a9a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsRequestBody.java @@ -0,0 +1,283 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateInstanceRestrictionsRequestBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allowlist") + private JsonNullable allowlist; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("blocklist") + private JsonNullable blocklist; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("block_email_subaddresses") + private JsonNullable blockEmailSubaddresses; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("block_disposable_email_domains") + private JsonNullable blockDisposableEmailDomains; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ignore_dots_for_gmail_addresses") + private JsonNullable ignoreDotsForGmailAddresses; + + @JsonCreator + public UpdateInstanceRestrictionsRequestBody( + @JsonProperty("allowlist") JsonNullable allowlist, + @JsonProperty("blocklist") JsonNullable blocklist, + @JsonProperty("block_email_subaddresses") JsonNullable blockEmailSubaddresses, + @JsonProperty("block_disposable_email_domains") JsonNullable blockDisposableEmailDomains, + @JsonProperty("ignore_dots_for_gmail_addresses") JsonNullable ignoreDotsForGmailAddresses) { + Utils.checkNotNull(allowlist, "allowlist"); + Utils.checkNotNull(blocklist, "blocklist"); + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + Utils.checkNotNull(blockDisposableEmailDomains, "blockDisposableEmailDomains"); + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.allowlist = allowlist; + this.blocklist = blocklist; + this.blockEmailSubaddresses = blockEmailSubaddresses; + this.blockDisposableEmailDomains = blockDisposableEmailDomains; + this.ignoreDotsForGmailAddresses = ignoreDotsForGmailAddresses; + } + + public UpdateInstanceRestrictionsRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable allowlist() { + return (JsonNullable) allowlist; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable blocklist() { + return (JsonNullable) blocklist; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable blockEmailSubaddresses() { + return (JsonNullable) blockEmailSubaddresses; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable blockDisposableEmailDomains() { + return (JsonNullable) blockDisposableEmailDomains; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable ignoreDotsForGmailAddresses() { + return (JsonNullable) ignoreDotsForGmailAddresses; + } + + public final static Builder builder() { + return new Builder(); + } + + public UpdateInstanceRestrictionsRequestBody withAllowlist(boolean allowlist) { + Utils.checkNotNull(allowlist, "allowlist"); + this.allowlist = JsonNullable.of(allowlist); + return this; + } + + public UpdateInstanceRestrictionsRequestBody withAllowlist(JsonNullable allowlist) { + Utils.checkNotNull(allowlist, "allowlist"); + this.allowlist = allowlist; + return this; + } + + public UpdateInstanceRestrictionsRequestBody withBlocklist(boolean blocklist) { + Utils.checkNotNull(blocklist, "blocklist"); + this.blocklist = JsonNullable.of(blocklist); + return this; + } + + public UpdateInstanceRestrictionsRequestBody withBlocklist(JsonNullable blocklist) { + Utils.checkNotNull(blocklist, "blocklist"); + this.blocklist = blocklist; + return this; + } + + public UpdateInstanceRestrictionsRequestBody withBlockEmailSubaddresses(boolean blockEmailSubaddresses) { + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + this.blockEmailSubaddresses = JsonNullable.of(blockEmailSubaddresses); + return this; + } + + public UpdateInstanceRestrictionsRequestBody withBlockEmailSubaddresses(JsonNullable blockEmailSubaddresses) { + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + this.blockEmailSubaddresses = blockEmailSubaddresses; + return this; + } + + public UpdateInstanceRestrictionsRequestBody withBlockDisposableEmailDomains(boolean blockDisposableEmailDomains) { + Utils.checkNotNull(blockDisposableEmailDomains, "blockDisposableEmailDomains"); + this.blockDisposableEmailDomains = JsonNullable.of(blockDisposableEmailDomains); + return this; + } + + public UpdateInstanceRestrictionsRequestBody withBlockDisposableEmailDomains(JsonNullable blockDisposableEmailDomains) { + Utils.checkNotNull(blockDisposableEmailDomains, "blockDisposableEmailDomains"); + this.blockDisposableEmailDomains = blockDisposableEmailDomains; + return this; + } + + public UpdateInstanceRestrictionsRequestBody withIgnoreDotsForGmailAddresses(boolean ignoreDotsForGmailAddresses) { + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.ignoreDotsForGmailAddresses = JsonNullable.of(ignoreDotsForGmailAddresses); + return this; + } + + public UpdateInstanceRestrictionsRequestBody withIgnoreDotsForGmailAddresses(JsonNullable ignoreDotsForGmailAddresses) { + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.ignoreDotsForGmailAddresses = ignoreDotsForGmailAddresses; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInstanceRestrictionsRequestBody other = (UpdateInstanceRestrictionsRequestBody) o; + return + java.util.Objects.deepEquals(this.allowlist, other.allowlist) && + java.util.Objects.deepEquals(this.blocklist, other.blocklist) && + java.util.Objects.deepEquals(this.blockEmailSubaddresses, other.blockEmailSubaddresses) && + java.util.Objects.deepEquals(this.blockDisposableEmailDomains, other.blockDisposableEmailDomains) && + java.util.Objects.deepEquals(this.ignoreDotsForGmailAddresses, other.ignoreDotsForGmailAddresses); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + allowlist, + blocklist, + blockEmailSubaddresses, + blockDisposableEmailDomains, + ignoreDotsForGmailAddresses); + } + + @Override + public String toString() { + return Utils.toString(UpdateInstanceRestrictionsRequestBody.class, + "allowlist", allowlist, + "blocklist", blocklist, + "blockEmailSubaddresses", blockEmailSubaddresses, + "blockDisposableEmailDomains", blockDisposableEmailDomains, + "ignoreDotsForGmailAddresses", ignoreDotsForGmailAddresses); + } + + public final static class Builder { + + private JsonNullable allowlist = JsonNullable.undefined(); + + private JsonNullable blocklist = JsonNullable.undefined(); + + private JsonNullable blockEmailSubaddresses = JsonNullable.undefined(); + + private JsonNullable blockDisposableEmailDomains = JsonNullable.undefined(); + + private JsonNullable ignoreDotsForGmailAddresses = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder allowlist(boolean allowlist) { + Utils.checkNotNull(allowlist, "allowlist"); + this.allowlist = JsonNullable.of(allowlist); + return this; + } + + public Builder allowlist(JsonNullable allowlist) { + Utils.checkNotNull(allowlist, "allowlist"); + this.allowlist = allowlist; + return this; + } + + public Builder blocklist(boolean blocklist) { + Utils.checkNotNull(blocklist, "blocklist"); + this.blocklist = JsonNullable.of(blocklist); + return this; + } + + public Builder blocklist(JsonNullable blocklist) { + Utils.checkNotNull(blocklist, "blocklist"); + this.blocklist = blocklist; + return this; + } + + public Builder blockEmailSubaddresses(boolean blockEmailSubaddresses) { + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + this.blockEmailSubaddresses = JsonNullable.of(blockEmailSubaddresses); + return this; + } + + public Builder blockEmailSubaddresses(JsonNullable blockEmailSubaddresses) { + Utils.checkNotNull(blockEmailSubaddresses, "blockEmailSubaddresses"); + this.blockEmailSubaddresses = blockEmailSubaddresses; + return this; + } + + public Builder blockDisposableEmailDomains(boolean blockDisposableEmailDomains) { + Utils.checkNotNull(blockDisposableEmailDomains, "blockDisposableEmailDomains"); + this.blockDisposableEmailDomains = JsonNullable.of(blockDisposableEmailDomains); + return this; + } + + public Builder blockDisposableEmailDomains(JsonNullable blockDisposableEmailDomains) { + Utils.checkNotNull(blockDisposableEmailDomains, "blockDisposableEmailDomains"); + this.blockDisposableEmailDomains = blockDisposableEmailDomains; + return this; + } + + public Builder ignoreDotsForGmailAddresses(boolean ignoreDotsForGmailAddresses) { + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.ignoreDotsForGmailAddresses = JsonNullable.of(ignoreDotsForGmailAddresses); + return this; + } + + public Builder ignoreDotsForGmailAddresses(JsonNullable ignoreDotsForGmailAddresses) { + Utils.checkNotNull(ignoreDotsForGmailAddresses, "ignoreDotsForGmailAddresses"); + this.ignoreDotsForGmailAddresses = ignoreDotsForGmailAddresses; + return this; + } + + public UpdateInstanceRestrictionsRequestBody build() { + return new UpdateInstanceRestrictionsRequestBody( + allowlist, + blocklist, + blockEmailSubaddresses, + blockDisposableEmailDomains, + ignoreDotsForGmailAddresses); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsRequestBuilder.java new file mode 100644 index 0000000..89abffe --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateInstanceRestrictionsRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateInstanceRestrictions sdk; + + public UpdateInstanceRestrictionsRequestBuilder(SDKMethodInterfaces.MethodCallUpdateInstanceRestrictions sdk) { + this.sdk = sdk; + } + + public UpdateInstanceRestrictionsRequestBuilder request(UpdateInstanceRestrictionsRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public UpdateInstanceRestrictionsRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public UpdateInstanceRestrictionsResponse call() throws Exception { + + return sdk.updateRestrictions( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsResponse.java new file mode 100644 index 0000000..f7b8c9b --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateInstanceRestrictionsResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateInstanceRestrictionsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional instanceRestrictions; + + @JsonCreator + public UpdateInstanceRestrictionsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional instanceRestrictions) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(instanceRestrictions, "instanceRestrictions"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.instanceRestrictions = instanceRestrictions; + } + + public UpdateInstanceRestrictionsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional instanceRestrictions() { + return (Optional) instanceRestrictions; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateInstanceRestrictionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateInstanceRestrictionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateInstanceRestrictionsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateInstanceRestrictionsResponse withInstanceRestrictions(com.clerk.backend_api.models.components.InstanceRestrictions instanceRestrictions) { + Utils.checkNotNull(instanceRestrictions, "instanceRestrictions"); + this.instanceRestrictions = Optional.ofNullable(instanceRestrictions); + return this; + } + + /** + * Success + */ + public UpdateInstanceRestrictionsResponse withInstanceRestrictions(Optional instanceRestrictions) { + Utils.checkNotNull(instanceRestrictions, "instanceRestrictions"); + this.instanceRestrictions = instanceRestrictions; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInstanceRestrictionsResponse other = (UpdateInstanceRestrictionsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.instanceRestrictions, other.instanceRestrictions); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + instanceRestrictions); + } + + @Override + public String toString() { + return Utils.toString(UpdateInstanceRestrictionsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "instanceRestrictions", instanceRestrictions); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional instanceRestrictions = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder instanceRestrictions(com.clerk.backend_api.models.components.InstanceRestrictions instanceRestrictions) { + Utils.checkNotNull(instanceRestrictions, "instanceRestrictions"); + this.instanceRestrictions = Optional.ofNullable(instanceRestrictions); + return this; + } + + /** + * Success + */ + public Builder instanceRestrictions(Optional instanceRestrictions) { + Utils.checkNotNull(instanceRestrictions, "instanceRestrictions"); + this.instanceRestrictions = instanceRestrictions; + return this; + } + + public UpdateInstanceRestrictionsResponse build() { + return new UpdateInstanceRestrictionsResponse( + contentType, + statusCode, + rawResponse, + instanceRestrictions); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateClaims.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateClaims.java new file mode 100644 index 0000000..0242609 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateClaims.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateJWTTemplateClaims - JWT template claims in JSON format + */ + +public class UpdateJWTTemplateClaims { + + @JsonCreator + public UpdateJWTTemplateClaims() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateJWTTemplateClaims.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateJWTTemplateClaims build() { + return new UpdateJWTTemplateClaims( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequest.java new file mode 100644 index 0000000..ee99344 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequest.java @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdateJWTTemplateRequest { + + /** + * The ID of the JWT template to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_id") + private String templateId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public UpdateJWTTemplateRequest( + String templateId, + Optional requestBody) { + Utils.checkNotNull(templateId, "templateId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.templateId = templateId; + this.requestBody = requestBody; + } + + public UpdateJWTTemplateRequest( + String templateId) { + this(templateId, Optional.empty()); + } + + /** + * The ID of the JWT template to update + */ + @JsonIgnore + public String templateId() { + return templateId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the JWT template to update + */ + public UpdateJWTTemplateRequest withTemplateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + public UpdateJWTTemplateRequest withRequestBody(UpdateJWTTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public UpdateJWTTemplateRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateJWTTemplateRequest other = (UpdateJWTTemplateRequest) o; + return + java.util.Objects.deepEquals(this.templateId, other.templateId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateJWTTemplateRequest.class, + "templateId", templateId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String templateId; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the JWT template to update + */ + public Builder templateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + public Builder requestBody(UpdateJWTTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateJWTTemplateRequest build() { + return new UpdateJWTTemplateRequest( + templateId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequestBody.java new file mode 100644 index 0000000..1498549 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequestBody.java @@ -0,0 +1,496 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateJWTTemplateRequestBody { + + /** + * JWT template name + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + /** + * JWT template claims in JSON format + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("claims") + private Optional claims; + + /** + * JWT token lifetime + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lifetime") + private JsonNullable lifetime; + + /** + * JWT token allowed clock skew + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allowed_clock_skew") + private JsonNullable allowedClockSkew; + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_signing_key") + private Optional customSigningKey; + + /** + * The custom signing algorithm to use when minting JWTs + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signing_algorithm") + private JsonNullable signingAlgorithm; + + /** + * The custom signing private key to use when minting JWTs + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("signing_key") + private JsonNullable signingKey; + + @JsonCreator + public UpdateJWTTemplateRequestBody( + @JsonProperty("name") Optional name, + @JsonProperty("claims") Optional claims, + @JsonProperty("lifetime") JsonNullable lifetime, + @JsonProperty("allowed_clock_skew") JsonNullable allowedClockSkew, + @JsonProperty("custom_signing_key") Optional customSigningKey, + @JsonProperty("signing_algorithm") JsonNullable signingAlgorithm, + @JsonProperty("signing_key") JsonNullable signingKey) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(claims, "claims"); + Utils.checkNotNull(lifetime, "lifetime"); + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + Utils.checkNotNull(customSigningKey, "customSigningKey"); + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + Utils.checkNotNull(signingKey, "signingKey"); + this.name = name; + this.claims = claims; + this.lifetime = lifetime; + this.allowedClockSkew = allowedClockSkew; + this.customSigningKey = customSigningKey; + this.signingAlgorithm = signingAlgorithm; + this.signingKey = signingKey; + } + + public UpdateJWTTemplateRequestBody() { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * JWT template name + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; + } + + /** + * JWT template claims in JSON format + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional claims() { + return (Optional) claims; + } + + /** + * JWT token lifetime + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lifetime() { + return (JsonNullable) lifetime; + } + + /** + * JWT token allowed clock skew + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable allowedClockSkew() { + return (JsonNullable) allowedClockSkew; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional customSigningKey() { + return (Optional) customSigningKey; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable signingAlgorithm() { + return (JsonNullable) signingAlgorithm; + } + + /** + * The custom signing private key to use when minting JWTs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable signingKey() { + return (JsonNullable) signingKey; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * JWT template name + */ + public UpdateJWTTemplateRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * JWT template name + */ + public UpdateJWTTemplateRequestBody withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * JWT template claims in JSON format + */ + public UpdateJWTTemplateRequestBody withClaims(UpdateJWTTemplateClaims claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = Optional.ofNullable(claims); + return this; + } + + /** + * JWT template claims in JSON format + */ + public UpdateJWTTemplateRequestBody withClaims(Optional claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = claims; + return this; + } + + /** + * JWT token lifetime + */ + public UpdateJWTTemplateRequestBody withLifetime(double lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = JsonNullable.of(lifetime); + return this; + } + + /** + * JWT token lifetime + */ + public UpdateJWTTemplateRequestBody withLifetime(JsonNullable lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = lifetime; + return this; + } + + /** + * JWT token allowed clock skew + */ + public UpdateJWTTemplateRequestBody withAllowedClockSkew(double allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = JsonNullable.of(allowedClockSkew); + return this; + } + + /** + * JWT token allowed clock skew + */ + public UpdateJWTTemplateRequestBody withAllowedClockSkew(JsonNullable allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = allowedClockSkew; + return this; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + public UpdateJWTTemplateRequestBody withCustomSigningKey(boolean customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = Optional.ofNullable(customSigningKey); + return this; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + public UpdateJWTTemplateRequestBody withCustomSigningKey(Optional customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = customSigningKey; + return this; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + public UpdateJWTTemplateRequestBody withSigningAlgorithm(String signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = JsonNullable.of(signingAlgorithm); + return this; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + public UpdateJWTTemplateRequestBody withSigningAlgorithm(JsonNullable signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = signingAlgorithm; + return this; + } + + /** + * The custom signing private key to use when minting JWTs + */ + public UpdateJWTTemplateRequestBody withSigningKey(String signingKey) { + Utils.checkNotNull(signingKey, "signingKey"); + this.signingKey = JsonNullable.of(signingKey); + return this; + } + + /** + * The custom signing private key to use when minting JWTs + */ + public UpdateJWTTemplateRequestBody withSigningKey(JsonNullable signingKey) { + Utils.checkNotNull(signingKey, "signingKey"); + this.signingKey = signingKey; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateJWTTemplateRequestBody other = (UpdateJWTTemplateRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.claims, other.claims) && + java.util.Objects.deepEquals(this.lifetime, other.lifetime) && + java.util.Objects.deepEquals(this.allowedClockSkew, other.allowedClockSkew) && + java.util.Objects.deepEquals(this.customSigningKey, other.customSigningKey) && + java.util.Objects.deepEquals(this.signingAlgorithm, other.signingAlgorithm) && + java.util.Objects.deepEquals(this.signingKey, other.signingKey); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + claims, + lifetime, + allowedClockSkew, + customSigningKey, + signingAlgorithm, + signingKey); + } + + @Override + public String toString() { + return Utils.toString(UpdateJWTTemplateRequestBody.class, + "name", name, + "claims", claims, + "lifetime", lifetime, + "allowedClockSkew", allowedClockSkew, + "customSigningKey", customSigningKey, + "signingAlgorithm", signingAlgorithm, + "signingKey", signingKey); + } + + public final static class Builder { + + private Optional name = Optional.empty(); + + private Optional claims = Optional.empty(); + + private JsonNullable lifetime = JsonNullable.undefined(); + + private JsonNullable allowedClockSkew = JsonNullable.undefined(); + + private Optional customSigningKey = Optional.empty(); + + private JsonNullable signingAlgorithm = JsonNullable.undefined(); + + private JsonNullable signingKey = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * JWT template name + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * JWT template name + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * JWT template claims in JSON format + */ + public Builder claims(UpdateJWTTemplateClaims claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = Optional.ofNullable(claims); + return this; + } + + /** + * JWT template claims in JSON format + */ + public Builder claims(Optional claims) { + Utils.checkNotNull(claims, "claims"); + this.claims = claims; + return this; + } + + /** + * JWT token lifetime + */ + public Builder lifetime(double lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = JsonNullable.of(lifetime); + return this; + } + + /** + * JWT token lifetime + */ + public Builder lifetime(JsonNullable lifetime) { + Utils.checkNotNull(lifetime, "lifetime"); + this.lifetime = lifetime; + return this; + } + + /** + * JWT token allowed clock skew + */ + public Builder allowedClockSkew(double allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = JsonNullable.of(allowedClockSkew); + return this; + } + + /** + * JWT token allowed clock skew + */ + public Builder allowedClockSkew(JsonNullable allowedClockSkew) { + Utils.checkNotNull(allowedClockSkew, "allowedClockSkew"); + this.allowedClockSkew = allowedClockSkew; + return this; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + public Builder customSigningKey(boolean customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = Optional.ofNullable(customSigningKey); + return this; + } + + /** + * Whether a custom signing key/algorithm is also provided for this template + */ + public Builder customSigningKey(Optional customSigningKey) { + Utils.checkNotNull(customSigningKey, "customSigningKey"); + this.customSigningKey = customSigningKey; + return this; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + public Builder signingAlgorithm(String signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = JsonNullable.of(signingAlgorithm); + return this; + } + + /** + * The custom signing algorithm to use when minting JWTs + */ + public Builder signingAlgorithm(JsonNullable signingAlgorithm) { + Utils.checkNotNull(signingAlgorithm, "signingAlgorithm"); + this.signingAlgorithm = signingAlgorithm; + return this; + } + + /** + * The custom signing private key to use when minting JWTs + */ + public Builder signingKey(String signingKey) { + Utils.checkNotNull(signingKey, "signingKey"); + this.signingKey = JsonNullable.of(signingKey); + return this; + } + + /** + * The custom signing private key to use when minting JWTs + */ + public Builder signingKey(JsonNullable signingKey) { + Utils.checkNotNull(signingKey, "signingKey"); + this.signingKey = signingKey; + return this; + } + + public UpdateJWTTemplateRequestBody build() { + return new UpdateJWTTemplateRequestBody( + name, + claims, + lifetime, + allowedClockSkew, + customSigningKey, + signingAlgorithm, + signingKey); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequestBuilder.java new file mode 100644 index 0000000..b0e2fa6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateJWTTemplateRequestBuilder { + + private String templateId; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateJWTTemplate sdk; + + public UpdateJWTTemplateRequestBuilder(SDKMethodInterfaces.MethodCallUpdateJWTTemplate sdk) { + this.sdk = sdk; + } + + public UpdateJWTTemplateRequestBuilder templateId(String templateId) { + Utils.checkNotNull(templateId, "templateId"); + this.templateId = templateId; + return this; + } + + public UpdateJWTTemplateRequestBuilder requestBody(UpdateJWTTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public UpdateJWTTemplateRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateJWTTemplateResponse call() throws Exception { + + return sdk.update( + templateId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateResponse.java new file mode 100644 index 0000000..3adef16 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateJWTTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateJWTTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional jwtTemplate; + + @JsonCreator + public UpdateJWTTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional jwtTemplate) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.jwtTemplate = jwtTemplate; + } + + public UpdateJWTTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional jwtTemplate() { + return (Optional) jwtTemplate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateJWTTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateJWTTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateJWTTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateJWTTemplateResponse withJWTTemplate(com.clerk.backend_api.models.components.JWTTemplate jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = Optional.ofNullable(jwtTemplate); + return this; + } + + /** + * Success + */ + public UpdateJWTTemplateResponse withJWTTemplate(Optional jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = jwtTemplate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateJWTTemplateResponse other = (UpdateJWTTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.jwtTemplate, other.jwtTemplate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + jwtTemplate); + } + + @Override + public String toString() { + return Utils.toString(UpdateJWTTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "jwtTemplate", jwtTemplate); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional jwtTemplate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder jwtTemplate(com.clerk.backend_api.models.components.JWTTemplate jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = Optional.ofNullable(jwtTemplate); + return this; + } + + /** + * Success + */ + public Builder jwtTemplate(Optional jwtTemplate) { + Utils.checkNotNull(jwtTemplate, "jwtTemplate"); + this.jwtTemplate = jwtTemplate; + return this; + } + + public UpdateJWTTemplateResponse build() { + return new UpdateJWTTemplateResponse( + contentType, + statusCode, + rawResponse, + jwtTemplate); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequest.java new file mode 100644 index 0000000..ef0e2b3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UpdateOAuthApplicationRequest { + + /** + * The ID of the OAuth application to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=oauth_application_id") + private String oauthApplicationId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private UpdateOAuthApplicationRequestBody requestBody; + + @JsonCreator + public UpdateOAuthApplicationRequest( + String oauthApplicationId, + UpdateOAuthApplicationRequestBody requestBody) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.oauthApplicationId = oauthApplicationId; + this.requestBody = requestBody; + } + + /** + * The ID of the OAuth application to update + */ + @JsonIgnore + public String oauthApplicationId() { + return oauthApplicationId; + } + + @JsonIgnore + public UpdateOAuthApplicationRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the OAuth application to update + */ + public UpdateOAuthApplicationRequest withOauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public UpdateOAuthApplicationRequest withRequestBody(UpdateOAuthApplicationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOAuthApplicationRequest other = (UpdateOAuthApplicationRequest) o; + return + java.util.Objects.deepEquals(this.oauthApplicationId, other.oauthApplicationId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + oauthApplicationId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateOAuthApplicationRequest.class, + "oauthApplicationId", oauthApplicationId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String oauthApplicationId; + + private UpdateOAuthApplicationRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the OAuth application to update + */ + public Builder oauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public Builder requestBody(UpdateOAuthApplicationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateOAuthApplicationRequest build() { + return new UpdateOAuthApplicationRequest( + oauthApplicationId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequestBody.java new file mode 100644 index 0000000..5d48d29 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequestBody.java @@ -0,0 +1,261 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdateOAuthApplicationRequestBody { + + /** + * The new name of the OAuth application + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + /** + * The new callback URL of the OAuth application + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("callback_url") + private Optional callbackUrl; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("scopes") + private Optional scopes; + + @JsonCreator + public UpdateOAuthApplicationRequestBody( + @JsonProperty("name") Optional name, + @JsonProperty("callback_url") Optional callbackUrl, + @JsonProperty("scopes") Optional scopes) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(callbackUrl, "callbackUrl"); + Utils.checkNotNull(scopes, "scopes"); + this.name = name; + this.callbackUrl = callbackUrl; + this.scopes = scopes; + } + + public UpdateOAuthApplicationRequestBody() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * The new name of the OAuth application + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; + } + + /** + * The new callback URL of the OAuth application + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional callbackUrl() { + return (Optional) callbackUrl; + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional scopes() { + return (Optional) scopes; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The new name of the OAuth application + */ + public UpdateOAuthApplicationRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The new name of the OAuth application + */ + public UpdateOAuthApplicationRequestBody withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The new callback URL of the OAuth application + */ + public UpdateOAuthApplicationRequestBody withCallbackUrl(String callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = Optional.ofNullable(callbackUrl); + return this; + } + + /** + * The new callback URL of the OAuth application + */ + public UpdateOAuthApplicationRequestBody withCallbackUrl(Optional callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = callbackUrl; + return this; + } + + /** + * 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. + */ + public UpdateOAuthApplicationRequestBody withScopes(String scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * 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. + */ + public UpdateOAuthApplicationRequestBody withScopes(Optional scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOAuthApplicationRequestBody other = (UpdateOAuthApplicationRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.callbackUrl, other.callbackUrl) && + java.util.Objects.deepEquals(this.scopes, other.scopes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + callbackUrl, + scopes); + } + + @Override + public String toString() { + return Utils.toString(UpdateOAuthApplicationRequestBody.class, + "name", name, + "callbackUrl", callbackUrl, + "scopes", scopes); + } + + public final static class Builder { + + private Optional name = Optional.empty(); + + private Optional callbackUrl = Optional.empty(); + + private Optional scopes; + + private Builder() { + // force use of static builder() method + } + + /** + * The new name of the OAuth application + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The new name of the OAuth application + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The new callback URL of the OAuth application + */ + public Builder callbackUrl(String callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = Optional.ofNullable(callbackUrl); + return this; + } + + /** + * The new callback URL of the OAuth application + */ + public Builder callbackUrl(Optional callbackUrl) { + Utils.checkNotNull(callbackUrl, "callbackUrl"); + this.callbackUrl = callbackUrl; + return this; + } + + /** + * 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. + */ + public Builder scopes(String scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = Optional.ofNullable(scopes); + return this; + } + + /** + * 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. + */ + public Builder scopes(Optional scopes) { + Utils.checkNotNull(scopes, "scopes"); + this.scopes = scopes; + return this; + } + + public UpdateOAuthApplicationRequestBody build() { + if (scopes == null) { + scopes = _SINGLETON_VALUE_Scopes.value(); + } + return new UpdateOAuthApplicationRequestBody( + name, + callbackUrl, + scopes); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Scopes = + new LazySingletonValue<>( + "scopes", + "\"profile email\"", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequestBuilder.java new file mode 100644 index 0000000..abd94b5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateOAuthApplicationRequestBuilder { + + private String oauthApplicationId; + private UpdateOAuthApplicationRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallUpdateOAuthApplication sdk; + + public UpdateOAuthApplicationRequestBuilder(SDKMethodInterfaces.MethodCallUpdateOAuthApplication sdk) { + this.sdk = sdk; + } + + public UpdateOAuthApplicationRequestBuilder oauthApplicationId(String oauthApplicationId) { + Utils.checkNotNull(oauthApplicationId, "oauthApplicationId"); + this.oauthApplicationId = oauthApplicationId; + return this; + } + + public UpdateOAuthApplicationRequestBuilder requestBody(UpdateOAuthApplicationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateOAuthApplicationResponse call() throws Exception { + + return sdk.updateApplication( + oauthApplicationId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationResponse.java new file mode 100644 index 0000000..aa9dfe9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOAuthApplicationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateOAuthApplicationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An OAuth application + */ + private Optional oAuthApplication; + + @JsonCreator + public UpdateOAuthApplicationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional oAuthApplication) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.oAuthApplication = oAuthApplication; + } + + public UpdateOAuthApplicationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An OAuth application + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional oAuthApplication() { + return (Optional) oAuthApplication; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateOAuthApplicationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateOAuthApplicationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateOAuthApplicationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An OAuth application + */ + public UpdateOAuthApplicationResponse withOAuthApplication(com.clerk.backend_api.models.components.OAuthApplication oAuthApplication) { + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.oAuthApplication = Optional.ofNullable(oAuthApplication); + return this; + } + + /** + * An OAuth application + */ + public UpdateOAuthApplicationResponse withOAuthApplication(Optional oAuthApplication) { + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.oAuthApplication = oAuthApplication; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOAuthApplicationResponse other = (UpdateOAuthApplicationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.oAuthApplication, other.oAuthApplication); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + oAuthApplication); + } + + @Override + public String toString() { + return Utils.toString(UpdateOAuthApplicationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "oAuthApplication", oAuthApplication); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional oAuthApplication = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An OAuth application + */ + public Builder oAuthApplication(com.clerk.backend_api.models.components.OAuthApplication oAuthApplication) { + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.oAuthApplication = Optional.ofNullable(oAuthApplication); + return this; + } + + /** + * An OAuth application + */ + public Builder oAuthApplication(Optional oAuthApplication) { + Utils.checkNotNull(oAuthApplication, "oAuthApplication"); + this.oAuthApplication = oAuthApplication; + return this; + } + + public UpdateOAuthApplicationResponse build() { + return new UpdateOAuthApplicationResponse( + contentType, + statusCode, + rawResponse, + oAuthApplication); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.java new file mode 100644 index 0000000..1ed9aa0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataPrivateMetadata.java @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateOrganizationMembershipMetadataPrivateMetadata - Metadata saved on the organization membership that is only visible to your backend. + * The new object will be merged with the existing value. + */ + +public class UpdateOrganizationMembershipMetadataPrivateMetadata { + + @JsonCreator + public UpdateOrganizationMembershipMetadataPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationMembershipMetadataPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateOrganizationMembershipMetadataPrivateMetadata build() { + return new UpdateOrganizationMembershipMetadataPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.java new file mode 100644 index 0000000..050610e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataPublicMetadata.java @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateOrganizationMembershipMetadataPublicMetadata - Metadata saved on the organization membership, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + +public class UpdateOrganizationMembershipMetadataPublicMetadata { + + @JsonCreator + public UpdateOrganizationMembershipMetadataPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationMembershipMetadataPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateOrganizationMembershipMetadataPublicMetadata build() { + return new UpdateOrganizationMembershipMetadataPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequest.java new file mode 100644 index 0000000..0166eff --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequest.java @@ -0,0 +1,172 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UpdateOrganizationMembershipMetadataRequest { + + /** + * The ID of the organization the membership belongs to + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + /** + * The ID of the user that this membership belongs to + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private UpdateOrganizationMembershipMetadataRequestBody requestBody; + + @JsonCreator + public UpdateOrganizationMembershipMetadataRequest( + String organizationId, + String userId, + UpdateOrganizationMembershipMetadataRequestBody requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.userId = userId; + this.requestBody = requestBody; + } + + /** + * The ID of the organization the membership belongs to + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + /** + * The ID of the user that this membership belongs to + */ + @JsonIgnore + public String userId() { + return userId; + } + + @JsonIgnore + public UpdateOrganizationMembershipMetadataRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization the membership belongs to + */ + public UpdateOrganizationMembershipMetadataRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The ID of the user that this membership belongs to + */ + public UpdateOrganizationMembershipMetadataRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateOrganizationMembershipMetadataRequest withRequestBody(UpdateOrganizationMembershipMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationMembershipMetadataRequest other = (UpdateOrganizationMembershipMetadataRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + userId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationMembershipMetadataRequest.class, + "organizationId", organizationId, + "userId", userId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private String userId; + + private UpdateOrganizationMembershipMetadataRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization the membership belongs to + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The ID of the user that this membership belongs to + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder requestBody(UpdateOrganizationMembershipMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateOrganizationMembershipMetadataRequest build() { + return new UpdateOrganizationMembershipMetadataRequest( + organizationId, + userId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequestBody.java new file mode 100644 index 0000000..c202010 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequestBody.java @@ -0,0 +1,202 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdateOrganizationMembershipMetadataRequestBody { + + /** + * Metadata saved on the organization membership, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the organization membership that is only visible to your backend. + * The new object will be merged with the existing value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + @JsonCreator + public UpdateOrganizationMembershipMetadataRequestBody( + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + } + + public UpdateOrganizationMembershipMetadataRequestBody() { + this(Optional.empty(), Optional.empty()); + } + + /** + * Metadata saved on the organization membership, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the organization membership that is only visible to your backend. + * The new object will be merged with the existing value. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Metadata saved on the organization membership, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public UpdateOrganizationMembershipMetadataRequestBody withPublicMetadata(UpdateOrganizationMembershipMetadataPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization membership, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public UpdateOrganizationMembershipMetadataRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization membership that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public UpdateOrganizationMembershipMetadataRequestBody withPrivateMetadata(UpdateOrganizationMembershipMetadataPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization membership that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public UpdateOrganizationMembershipMetadataRequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationMembershipMetadataRequestBody other = (UpdateOrganizationMembershipMetadataRequestBody) o; + return + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + publicMetadata, + privateMetadata); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationMembershipMetadataRequestBody.class, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata); + } + + public final static class Builder { + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Metadata saved on the organization membership, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public Builder publicMetadata(UpdateOrganizationMembershipMetadataPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization membership, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization membership that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public Builder privateMetadata(UpdateOrganizationMembershipMetadataPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization membership that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + public UpdateOrganizationMembershipMetadataRequestBody build() { + return new UpdateOrganizationMembershipMetadataRequestBody( + publicMetadata, + privateMetadata); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequestBuilder.java new file mode 100644 index 0000000..ebf7353 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataRequestBuilder.java @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateOrganizationMembershipMetadataRequestBuilder { + + private String organizationId; + private String userId; + private UpdateOrganizationMembershipMetadataRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallUpdateOrganizationMembershipMetadata sdk; + + public UpdateOrganizationMembershipMetadataRequestBuilder(SDKMethodInterfaces.MethodCallUpdateOrganizationMembershipMetadata sdk) { + this.sdk = sdk; + } + + public UpdateOrganizationMembershipMetadataRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public UpdateOrganizationMembershipMetadataRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateOrganizationMembershipMetadataRequestBuilder requestBody(UpdateOrganizationMembershipMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateOrganizationMembershipMetadataResponse call() throws Exception { + + return sdk.updateMetadata( + organizationId, + userId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataResponse.java new file mode 100644 index 0000000..8716ee3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipMetadataResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateOrganizationMembershipMetadataResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional organizationMembership; + + @JsonCreator + public UpdateOrganizationMembershipMetadataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationMembership) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationMembership = organizationMembership; + } + + public UpdateOrganizationMembershipMetadataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationMembership() { + return (Optional) organizationMembership; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateOrganizationMembershipMetadataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateOrganizationMembershipMetadataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateOrganizationMembershipMetadataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateOrganizationMembershipMetadataResponse withOrganizationMembership(com.clerk.backend_api.models.components.OrganizationMembership organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = Optional.ofNullable(organizationMembership); + return this; + } + + /** + * Success + */ + public UpdateOrganizationMembershipMetadataResponse withOrganizationMembership(Optional organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = organizationMembership; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationMembershipMetadataResponse other = (UpdateOrganizationMembershipMetadataResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationMembership, other.organizationMembership); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationMembership); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationMembershipMetadataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationMembership", organizationMembership); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationMembership = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder organizationMembership(com.clerk.backend_api.models.components.OrganizationMembership organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = Optional.ofNullable(organizationMembership); + return this; + } + + /** + * Success + */ + public Builder organizationMembership(Optional organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = organizationMembership; + return this; + } + + public UpdateOrganizationMembershipMetadataResponse build() { + return new UpdateOrganizationMembershipMetadataResponse( + contentType, + statusCode, + rawResponse, + organizationMembership); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequest.java new file mode 100644 index 0000000..030eeef --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequest.java @@ -0,0 +1,172 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UpdateOrganizationMembershipRequest { + + /** + * The ID of the organization the membership belongs to + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + /** + * The ID of the user that this membership belongs to + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private UpdateOrganizationMembershipRequestBody requestBody; + + @JsonCreator + public UpdateOrganizationMembershipRequest( + String organizationId, + String userId, + UpdateOrganizationMembershipRequestBody requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.userId = userId; + this.requestBody = requestBody; + } + + /** + * The ID of the organization the membership belongs to + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + /** + * The ID of the user that this membership belongs to + */ + @JsonIgnore + public String userId() { + return userId; + } + + @JsonIgnore + public UpdateOrganizationMembershipRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization the membership belongs to + */ + public UpdateOrganizationMembershipRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The ID of the user that this membership belongs to + */ + public UpdateOrganizationMembershipRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateOrganizationMembershipRequest withRequestBody(UpdateOrganizationMembershipRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationMembershipRequest other = (UpdateOrganizationMembershipRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + userId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationMembershipRequest.class, + "organizationId", organizationId, + "userId", userId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private String userId; + + private UpdateOrganizationMembershipRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization the membership belongs to + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + /** + * The ID of the user that this membership belongs to + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder requestBody(UpdateOrganizationMembershipRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateOrganizationMembershipRequest build() { + return new UpdateOrganizationMembershipRequest( + organizationId, + userId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequestBody.java new file mode 100644 index 0000000..d982e45 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequestBody.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UpdateOrganizationMembershipRequestBody { + + /** + * The new role of the given membership. + */ + @JsonProperty("role") + private String role; + + @JsonCreator + public UpdateOrganizationMembershipRequestBody( + @JsonProperty("role") String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + } + + /** + * The new role of the given membership. + */ + @JsonIgnore + public String role() { + return role; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The new role of the given membership. + */ + public UpdateOrganizationMembershipRequestBody withRole(String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationMembershipRequestBody other = (UpdateOrganizationMembershipRequestBody) o; + return + java.util.Objects.deepEquals(this.role, other.role); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + role); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationMembershipRequestBody.class, + "role", role); + } + + public final static class Builder { + + private String role; + + private Builder() { + // force use of static builder() method + } + + /** + * The new role of the given membership. + */ + public Builder role(String role) { + Utils.checkNotNull(role, "role"); + this.role = role; + return this; + } + + public UpdateOrganizationMembershipRequestBody build() { + return new UpdateOrganizationMembershipRequestBody( + role); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequestBuilder.java new file mode 100644 index 0000000..6abde77 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipRequestBuilder.java @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateOrganizationMembershipRequestBuilder { + + private String organizationId; + private String userId; + private UpdateOrganizationMembershipRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallUpdateOrganizationMembership sdk; + + public UpdateOrganizationMembershipRequestBuilder(SDKMethodInterfaces.MethodCallUpdateOrganizationMembership sdk) { + this.sdk = sdk; + } + + public UpdateOrganizationMembershipRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public UpdateOrganizationMembershipRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateOrganizationMembershipRequestBuilder requestBody(UpdateOrganizationMembershipRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateOrganizationMembershipResponse call() throws Exception { + + return sdk.update( + organizationId, + userId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipResponse.java new file mode 100644 index 0000000..fe6909a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationMembershipResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateOrganizationMembershipResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional organizationMembership; + + @JsonCreator + public UpdateOrganizationMembershipResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationMembership) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationMembership = organizationMembership; + } + + public UpdateOrganizationMembershipResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationMembership() { + return (Optional) organizationMembership; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateOrganizationMembershipResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateOrganizationMembershipResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateOrganizationMembershipResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateOrganizationMembershipResponse withOrganizationMembership(com.clerk.backend_api.models.components.OrganizationMembership organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = Optional.ofNullable(organizationMembership); + return this; + } + + /** + * Success + */ + public UpdateOrganizationMembershipResponse withOrganizationMembership(Optional organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = organizationMembership; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationMembershipResponse other = (UpdateOrganizationMembershipResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationMembership, other.organizationMembership); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationMembership); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationMembershipResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationMembership", organizationMembership); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationMembership = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder organizationMembership(com.clerk.backend_api.models.components.OrganizationMembership organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = Optional.ofNullable(organizationMembership); + return this; + } + + /** + * Success + */ + public Builder organizationMembership(Optional organizationMembership) { + Utils.checkNotNull(organizationMembership, "organizationMembership"); + this.organizationMembership = organizationMembership; + return this; + } + + public UpdateOrganizationMembershipResponse build() { + return new UpdateOrganizationMembershipResponse( + contentType, + statusCode, + rawResponse, + organizationMembership); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationPrivateMetadata.java new file mode 100644 index 0000000..1bbae08 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationPrivateMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateOrganizationPrivateMetadata - Metadata saved on the organization that is only visible to your backend. + */ + +public class UpdateOrganizationPrivateMetadata { + + @JsonCreator + public UpdateOrganizationPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateOrganizationPrivateMetadata build() { + return new UpdateOrganizationPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationPublicMetadata.java new file mode 100644 index 0000000..f4161df --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationPublicMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateOrganizationPublicMetadata - Metadata saved on the organization, that is visible to both your frontend and backend. + */ + +public class UpdateOrganizationPublicMetadata { + + @JsonCreator + public UpdateOrganizationPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateOrganizationPublicMetadata build() { + return new UpdateOrganizationPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequest.java new file mode 100644 index 0000000..f0300ef --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UpdateOrganizationRequest { + + /** + * The ID of the organization to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private UpdateOrganizationRequestBody requestBody; + + @JsonCreator + public UpdateOrganizationRequest( + String organizationId, + UpdateOrganizationRequestBody requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.requestBody = requestBody; + } + + /** + * The ID of the organization to update + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + @JsonIgnore + public UpdateOrganizationRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization to update + */ + public UpdateOrganizationRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public UpdateOrganizationRequest withRequestBody(UpdateOrganizationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationRequest other = (UpdateOrganizationRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationRequest.class, + "organizationId", organizationId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private UpdateOrganizationRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization to update + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public Builder requestBody(UpdateOrganizationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateOrganizationRequest build() { + return new UpdateOrganizationRequest( + organizationId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequestBody.java new file mode 100644 index 0000000..b565d9e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequestBody.java @@ -0,0 +1,435 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateOrganizationRequestBody { + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the organization that is only visible to your backend. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + /** + * The new name of the organization + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * The new slug of the organization, which needs to be unique in the instance + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("slug") + private JsonNullable slug; + + /** + * The maximum number of memberships allowed for this organization + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("max_allowed_memberships") + private JsonNullable maxAllowedMemberships; + + /** + * If true, an admin can delete this organization with the Frontend API. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("admin_delete_enabled") + private JsonNullable adminDeleteEnabled; + + @JsonCreator + public UpdateOrganizationRequestBody( + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("name") JsonNullable name, + @JsonProperty("slug") JsonNullable slug, + @JsonProperty("max_allowed_memberships") JsonNullable maxAllowedMemberships, + @JsonProperty("admin_delete_enabled") JsonNullable adminDeleteEnabled) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.name = name; + this.slug = slug; + this.maxAllowedMemberships = maxAllowedMemberships; + this.adminDeleteEnabled = adminDeleteEnabled; + } + + public UpdateOrganizationRequestBody() { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + /** + * The new name of the organization + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable name() { + return (JsonNullable) name; + } + + /** + * The new slug of the organization, which needs to be unique in the instance + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable slug() { + return (JsonNullable) slug; + } + + /** + * The maximum number of memberships allowed for this organization + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable maxAllowedMemberships() { + return (JsonNullable) maxAllowedMemberships; + } + + /** + * If true, an admin can delete this organization with the Frontend API. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable adminDeleteEnabled() { + return (JsonNullable) adminDeleteEnabled; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + */ + public UpdateOrganizationRequestBody withPublicMetadata(UpdateOrganizationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + */ + public UpdateOrganizationRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + */ + public UpdateOrganizationRequestBody withPrivateMetadata(UpdateOrganizationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + */ + public UpdateOrganizationRequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * The new name of the organization + */ + public UpdateOrganizationRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The new name of the organization + */ + public UpdateOrganizationRequestBody withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The new slug of the organization, which needs to be unique in the instance + */ + public UpdateOrganizationRequestBody withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = JsonNullable.of(slug); + return this; + } + + /** + * The new slug of the organization, which needs to be unique in the instance + */ + public UpdateOrganizationRequestBody withSlug(JsonNullable slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + /** + * The maximum number of memberships allowed for this organization + */ + public UpdateOrganizationRequestBody withMaxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = JsonNullable.of(maxAllowedMemberships); + return this; + } + + /** + * The maximum number of memberships allowed for this organization + */ + public UpdateOrganizationRequestBody withMaxAllowedMemberships(JsonNullable maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + /** + * If true, an admin can delete this organization with the Frontend API. + */ + public UpdateOrganizationRequestBody withAdminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = JsonNullable.of(adminDeleteEnabled); + return this; + } + + /** + * If true, an admin can delete this organization with the Frontend API. + */ + public UpdateOrganizationRequestBody withAdminDeleteEnabled(JsonNullable adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationRequestBody other = (UpdateOrganizationRequestBody) o; + return + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.maxAllowedMemberships, other.maxAllowedMemberships) && + java.util.Objects.deepEquals(this.adminDeleteEnabled, other.adminDeleteEnabled); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + publicMetadata, + privateMetadata, + name, + slug, + maxAllowedMemberships, + adminDeleteEnabled); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationRequestBody.class, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "name", name, + "slug", slug, + "maxAllowedMemberships", maxAllowedMemberships, + "adminDeleteEnabled", adminDeleteEnabled); + } + + public final static class Builder { + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private JsonNullable slug = JsonNullable.undefined(); + + private JsonNullable maxAllowedMemberships = JsonNullable.undefined(); + + private JsonNullable adminDeleteEnabled = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + */ + public Builder publicMetadata(UpdateOrganizationPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the organization, that is visible to both your frontend and backend. + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + */ + public Builder privateMetadata(UpdateOrganizationPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the organization that is only visible to your backend. + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * The new name of the organization + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The new name of the organization + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The new slug of the organization, which needs to be unique in the instance + */ + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = JsonNullable.of(slug); + return this; + } + + /** + * The new slug of the organization, which needs to be unique in the instance + */ + public Builder slug(JsonNullable slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + /** + * The maximum number of memberships allowed for this organization + */ + public Builder maxAllowedMemberships(long maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = JsonNullable.of(maxAllowedMemberships); + return this; + } + + /** + * The maximum number of memberships allowed for this organization + */ + public Builder maxAllowedMemberships(JsonNullable maxAllowedMemberships) { + Utils.checkNotNull(maxAllowedMemberships, "maxAllowedMemberships"); + this.maxAllowedMemberships = maxAllowedMemberships; + return this; + } + + /** + * If true, an admin can delete this organization with the Frontend API. + */ + public Builder adminDeleteEnabled(boolean adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = JsonNullable.of(adminDeleteEnabled); + return this; + } + + /** + * If true, an admin can delete this organization with the Frontend API. + */ + public Builder adminDeleteEnabled(JsonNullable adminDeleteEnabled) { + Utils.checkNotNull(adminDeleteEnabled, "adminDeleteEnabled"); + this.adminDeleteEnabled = adminDeleteEnabled; + return this; + } + + public UpdateOrganizationRequestBody build() { + return new UpdateOrganizationRequestBody( + publicMetadata, + privateMetadata, + name, + slug, + maxAllowedMemberships, + adminDeleteEnabled); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequestBuilder.java new file mode 100644 index 0000000..bc5bb65 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateOrganizationRequestBuilder { + + private String organizationId; + private UpdateOrganizationRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallUpdateOrganization sdk; + + public UpdateOrganizationRequestBuilder(SDKMethodInterfaces.MethodCallUpdateOrganization sdk) { + this.sdk = sdk; + } + + public UpdateOrganizationRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public UpdateOrganizationRequestBuilder requestBody(UpdateOrganizationRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateOrganizationResponse call() throws Exception { + + return sdk.update( + organizationId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationResponse.java new file mode 100644 index 0000000..f6ad733 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateOrganizationResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateOrganizationResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization + */ + private Optional organization; + + @JsonCreator + public UpdateOrganizationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organization) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organization, "organization"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organization = organization; + } + + public UpdateOrganizationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organization() { + return (Optional) organization; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateOrganizationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateOrganizationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateOrganizationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public UpdateOrganizationResponse withOrganization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public UpdateOrganizationResponse withOrganization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationResponse other = (UpdateOrganizationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organization, other.organization); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organization); + } + + @Override + public String toString() { + return Utils.toString(UpdateOrganizationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organization", organization); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organization = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization + */ + public Builder organization(com.clerk.backend_api.models.components.Organization organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = Optional.ofNullable(organization); + return this; + } + + /** + * An organization + */ + public Builder organization(Optional organization) { + Utils.checkNotNull(organization, "organization"); + this.organization = organization; + return this; + } + + public UpdateOrganizationResponse build() { + return new UpdateOrganizationResponse( + contentType, + statusCode, + rawResponse, + organization); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequest.java new file mode 100644 index 0000000..7354202 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequest.java @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdatePhoneNumberRequest { + + /** + * The ID of the phone number to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=phone_number_id") + private String phoneNumberId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public UpdatePhoneNumberRequest( + String phoneNumberId, + Optional requestBody) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.phoneNumberId = phoneNumberId; + this.requestBody = requestBody; + } + + public UpdatePhoneNumberRequest( + String phoneNumberId) { + this(phoneNumberId, Optional.empty()); + } + + /** + * The ID of the phone number to update + */ + @JsonIgnore + public String phoneNumberId() { + return phoneNumberId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the phone number to update + */ + public UpdatePhoneNumberRequest withPhoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + public UpdatePhoneNumberRequest withRequestBody(UpdatePhoneNumberRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public UpdatePhoneNumberRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePhoneNumberRequest other = (UpdatePhoneNumberRequest) o; + return + java.util.Objects.deepEquals(this.phoneNumberId, other.phoneNumberId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + phoneNumberId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdatePhoneNumberRequest.class, + "phoneNumberId", phoneNumberId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String phoneNumberId; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the phone number to update + */ + public Builder phoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + public Builder requestBody(UpdatePhoneNumberRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdatePhoneNumberRequest build() { + return new UpdatePhoneNumberRequest( + phoneNumberId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequestBody.java new file mode 100644 index 0000000..7d2793a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequestBody.java @@ -0,0 +1,263 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdatePhoneNumberRequestBody { + + /** + * The phone number will be marked as verified. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("verified") + private JsonNullable verified; + + /** + * Set this phone number as the primary phone number for the user. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary") + private JsonNullable primary; + + /** + * Set this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reserved_for_second_factor") + private JsonNullable reservedForSecondFactor; + + @JsonCreator + public UpdatePhoneNumberRequestBody( + @JsonProperty("verified") JsonNullable verified, + @JsonProperty("primary") JsonNullable primary, + @JsonProperty("reserved_for_second_factor") JsonNullable reservedForSecondFactor) { + Utils.checkNotNull(verified, "verified"); + Utils.checkNotNull(primary, "primary"); + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.verified = verified; + this.primary = primary; + this.reservedForSecondFactor = reservedForSecondFactor; + } + + public UpdatePhoneNumberRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The phone number will be marked as verified. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable verified() { + return (JsonNullable) verified; + } + + /** + * Set this phone number as the primary phone number for the user. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable primary() { + return (JsonNullable) primary; + } + + /** + * Set this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable reservedForSecondFactor() { + return (JsonNullable) reservedForSecondFactor; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The phone number will be marked as verified. + */ + public UpdatePhoneNumberRequestBody withVerified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = JsonNullable.of(verified); + return this; + } + + /** + * The phone number will be marked as verified. + */ + public UpdatePhoneNumberRequestBody withVerified(JsonNullable verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + /** + * Set this phone number as the primary phone number for the user. + */ + public UpdatePhoneNumberRequestBody withPrimary(boolean primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = JsonNullable.of(primary); + return this; + } + + /** + * Set this phone number as the primary phone number for the user. + */ + public UpdatePhoneNumberRequestBody withPrimary(JsonNullable primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = primary; + return this; + } + + /** + * Set this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + public UpdatePhoneNumberRequestBody withReservedForSecondFactor(boolean reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = JsonNullable.of(reservedForSecondFactor); + return this; + } + + /** + * Set this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + public UpdatePhoneNumberRequestBody withReservedForSecondFactor(JsonNullable reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = reservedForSecondFactor; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePhoneNumberRequestBody other = (UpdatePhoneNumberRequestBody) o; + return + java.util.Objects.deepEquals(this.verified, other.verified) && + java.util.Objects.deepEquals(this.primary, other.primary) && + java.util.Objects.deepEquals(this.reservedForSecondFactor, other.reservedForSecondFactor); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + verified, + primary, + reservedForSecondFactor); + } + + @Override + public String toString() { + return Utils.toString(UpdatePhoneNumberRequestBody.class, + "verified", verified, + "primary", primary, + "reservedForSecondFactor", reservedForSecondFactor); + } + + public final static class Builder { + + private JsonNullable verified = JsonNullable.undefined(); + + private JsonNullable primary = JsonNullable.undefined(); + + private JsonNullable reservedForSecondFactor = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The phone number will be marked as verified. + */ + public Builder verified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = JsonNullable.of(verified); + return this; + } + + /** + * The phone number will be marked as verified. + */ + public Builder verified(JsonNullable verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + /** + * Set this phone number as the primary phone number for the user. + */ + public Builder primary(boolean primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = JsonNullable.of(primary); + return this; + } + + /** + * Set this phone number as the primary phone number for the user. + */ + public Builder primary(JsonNullable primary) { + Utils.checkNotNull(primary, "primary"); + this.primary = primary; + return this; + } + + /** + * Set this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + public Builder reservedForSecondFactor(boolean reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = JsonNullable.of(reservedForSecondFactor); + return this; + } + + /** + * Set this phone number as reserved for multi-factor authentication. + * The phone number must also be verified. + * If there are no other reserved second factors, the phone number will be set as the default second factor. + */ + public Builder reservedForSecondFactor(JsonNullable reservedForSecondFactor) { + Utils.checkNotNull(reservedForSecondFactor, "reservedForSecondFactor"); + this.reservedForSecondFactor = reservedForSecondFactor; + return this; + } + + public UpdatePhoneNumberRequestBody build() { + return new UpdatePhoneNumberRequestBody( + verified, + primary, + reservedForSecondFactor); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequestBuilder.java new file mode 100644 index 0000000..3d04f10 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdatePhoneNumberRequestBuilder { + + private String phoneNumberId; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdatePhoneNumber sdk; + + public UpdatePhoneNumberRequestBuilder(SDKMethodInterfaces.MethodCallUpdatePhoneNumber sdk) { + this.sdk = sdk; + } + + public UpdatePhoneNumberRequestBuilder phoneNumberId(String phoneNumberId) { + Utils.checkNotNull(phoneNumberId, "phoneNumberId"); + this.phoneNumberId = phoneNumberId; + return this; + } + + public UpdatePhoneNumberRequestBuilder requestBody(UpdatePhoneNumberRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public UpdatePhoneNumberRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdatePhoneNumberResponse call() throws Exception { + + return sdk.update( + phoneNumberId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberResponse.java new file mode 100644 index 0000000..2931b80 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdatePhoneNumberResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdatePhoneNumberResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional phoneNumber; + + @JsonCreator + public UpdatePhoneNumberResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional phoneNumber) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.phoneNumber = phoneNumber; + } + + public UpdatePhoneNumberResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional phoneNumber() { + return (Optional) phoneNumber; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdatePhoneNumberResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdatePhoneNumberResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePhoneNumberResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdatePhoneNumberResponse withPhoneNumber(com.clerk.backend_api.models.components.PhoneNumber phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Success + */ + public UpdatePhoneNumberResponse withPhoneNumber(Optional phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePhoneNumberResponse other = (UpdatePhoneNumberResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.phoneNumber, other.phoneNumber); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + phoneNumber); + } + + @Override + public String toString() { + return Utils.toString(UpdatePhoneNumberResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "phoneNumber", phoneNumber); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional phoneNumber = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder phoneNumber(com.clerk.backend_api.models.components.PhoneNumber phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + * Success + */ + public Builder phoneNumber(Optional phoneNumber) { + Utils.checkNotNull(phoneNumber, "phoneNumber"); + this.phoneNumber = phoneNumber; + return this; + } + + public UpdatePhoneNumberResponse build() { + return new UpdatePhoneNumberResponse( + contentType, + statusCode, + rawResponse, + phoneNumber); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainRequestBody.java new file mode 100644 index 0000000..b33bdea --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainRequestBody.java @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdateProductionInstanceDomainRequestBody { + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("home_url") + private Optional homeUrl; + + @JsonCreator + public UpdateProductionInstanceDomainRequestBody( + @JsonProperty("home_url") Optional homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = homeUrl; + } + + public UpdateProductionInstanceDomainRequestBody() { + this(Optional.empty()); + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional homeUrl() { + return (Optional) homeUrl; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + public UpdateProductionInstanceDomainRequestBody withHomeUrl(String homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = Optional.ofNullable(homeUrl); + return this; + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + public UpdateProductionInstanceDomainRequestBody withHomeUrl(Optional homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = homeUrl; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateProductionInstanceDomainRequestBody other = (UpdateProductionInstanceDomainRequestBody) o; + return + java.util.Objects.deepEquals(this.homeUrl, other.homeUrl); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + homeUrl); + } + + @Override + public String toString() { + return Utils.toString(UpdateProductionInstanceDomainRequestBody.class, + "homeUrl", homeUrl); + } + + public final static class Builder { + + private Optional homeUrl = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + public Builder homeUrl(String homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = Optional.ofNullable(homeUrl); + return this; + } + + /** + * The new home URL of the production instance e.g. https://www.example.com + */ + public Builder homeUrl(Optional homeUrl) { + Utils.checkNotNull(homeUrl, "homeUrl"); + this.homeUrl = homeUrl; + return this; + } + + public UpdateProductionInstanceDomainRequestBody build() { + return new UpdateProductionInstanceDomainRequestBody( + homeUrl); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainRequestBuilder.java new file mode 100644 index 0000000..5866f34 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateProductionInstanceDomainRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateProductionInstanceDomain sdk; + + public UpdateProductionInstanceDomainRequestBuilder(SDKMethodInterfaces.MethodCallUpdateProductionInstanceDomain sdk) { + this.sdk = sdk; + } + + public UpdateProductionInstanceDomainRequestBuilder request(UpdateProductionInstanceDomainRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public UpdateProductionInstanceDomainRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public UpdateProductionInstanceDomainResponse call() throws Exception { + + return sdk.updateProductionDomain( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainResponse.java new file mode 100644 index 0000000..455b110 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateProductionInstanceDomainResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; + +public class UpdateProductionInstanceDomainResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public UpdateProductionInstanceDomainResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateProductionInstanceDomainResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateProductionInstanceDomainResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateProductionInstanceDomainResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateProductionInstanceDomainResponse other = (UpdateProductionInstanceDomainResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdateProductionInstanceDomainResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UpdateProductionInstanceDomainResponse build() { + return new UpdateProductionInstanceDomainResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionAttributeMapping.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionAttributeMapping.java new file mode 100644 index 0000000..0533c3d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionAttributeMapping.java @@ -0,0 +1,243 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * UpdateSAMLConnectionAttributeMapping - Define the atrtibute name mapping between Identity Provider and Clerk's user properties + */ + +public class UpdateSAMLConnectionAttributeMapping { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("user_id") + private Optional userId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email_address") + private Optional emailAddress; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private Optional firstName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private Optional lastName; + + @JsonCreator + public UpdateSAMLConnectionAttributeMapping( + @JsonProperty("user_id") Optional userId, + @JsonProperty("email_address") Optional emailAddress, + @JsonProperty("first_name") Optional firstName, + @JsonProperty("last_name") Optional lastName) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + this.userId = userId; + this.emailAddress = emailAddress; + this.firstName = firstName; + this.lastName = lastName; + } + + public UpdateSAMLConnectionAttributeMapping() { + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userId() { + return (Optional) userId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional emailAddress() { + return (Optional) emailAddress; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional firstName() { + return (Optional) firstName; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional lastName() { + return (Optional) lastName; + } + + public final static Builder builder() { + return new Builder(); + } + + public UpdateSAMLConnectionAttributeMapping withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public UpdateSAMLConnectionAttributeMapping withUserId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateSAMLConnectionAttributeMapping withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + public UpdateSAMLConnectionAttributeMapping withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public UpdateSAMLConnectionAttributeMapping withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = Optional.ofNullable(firstName); + return this; + } + + public UpdateSAMLConnectionAttributeMapping withFirstName(Optional firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public UpdateSAMLConnectionAttributeMapping withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = Optional.ofNullable(lastName); + return this; + } + + public UpdateSAMLConnectionAttributeMapping withLastName(Optional lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSAMLConnectionAttributeMapping other = (UpdateSAMLConnectionAttributeMapping) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + emailAddress, + firstName, + lastName); + } + + @Override + public String toString() { + return Utils.toString(UpdateSAMLConnectionAttributeMapping.class, + "userId", userId, + "emailAddress", emailAddress, + "firstName", firstName, + "lastName", lastName); + } + + public final static class Builder { + + private Optional userId = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = Optional.ofNullable(userId); + return this; + } + + public Builder userId(Optional userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = Optional.ofNullable(firstName); + return this; + } + + public Builder firstName(Optional firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = Optional.ofNullable(lastName); + return this; + } + + public Builder lastName(Optional lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + public UpdateSAMLConnectionAttributeMapping build() { + return new UpdateSAMLConnectionAttributeMapping( + userId, + emailAddress, + firstName, + lastName); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequest.java new file mode 100644 index 0000000..7253f7e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UpdateSAMLConnectionRequest { + + /** + * The ID of the SAML Connection to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=saml_connection_id") + private String samlConnectionId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private UpdateSAMLConnectionRequestBody requestBody; + + @JsonCreator + public UpdateSAMLConnectionRequest( + String samlConnectionId, + UpdateSAMLConnectionRequestBody requestBody) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.samlConnectionId = samlConnectionId; + this.requestBody = requestBody; + } + + /** + * The ID of the SAML Connection to update + */ + @JsonIgnore + public String samlConnectionId() { + return samlConnectionId; + } + + @JsonIgnore + public UpdateSAMLConnectionRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the SAML Connection to update + */ + public UpdateSAMLConnectionRequest withSamlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + public UpdateSAMLConnectionRequest withRequestBody(UpdateSAMLConnectionRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSAMLConnectionRequest other = (UpdateSAMLConnectionRequest) o; + return + java.util.Objects.deepEquals(this.samlConnectionId, other.samlConnectionId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + samlConnectionId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateSAMLConnectionRequest.class, + "samlConnectionId", samlConnectionId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String samlConnectionId; + + private UpdateSAMLConnectionRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the SAML Connection to update + */ + public Builder samlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + public Builder requestBody(UpdateSAMLConnectionRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateSAMLConnectionRequest build() { + return new UpdateSAMLConnectionRequest( + samlConnectionId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequestBody.java new file mode 100644 index 0000000..24b7263 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequestBody.java @@ -0,0 +1,800 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateSAMLConnectionRequestBody { + + /** + * The name of the new SAML Connection + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * The domain to use for the new SAML Connection + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("domain") + private JsonNullable domain; + + /** + * The entity id as provided by the IdP + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_entity_id") + private JsonNullable idpEntityId; + + /** + * The SSO url as provided by the IdP + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_sso_url") + private JsonNullable idpSsoUrl; + + /** + * The x509 certificated as provided by the IdP + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_certificate") + private JsonNullable idpCertificate; + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_metadata_url") + private JsonNullable idpMetadataUrl; + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("idp_metadata") + private JsonNullable idpMetadata; + + /** + * Define the atrtibute name mapping between Identity Provider and Clerk's user properties + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attribute_mapping") + private JsonNullable attributeMapping; + + /** + * Activate or de-activate the SAML Connection + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("active") + private JsonNullable active; + + /** + * Controls whether to update the user's attributes in each sign-in + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sync_user_attributes") + private JsonNullable syncUserAttributes; + + /** + * Allow users with an email address subdomain to use this connection in order to authenticate + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allow_subdomains") + private JsonNullable allowSubdomains; + + /** + * Enable or deactivate IdP-initiated flows + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allow_idp_initiated") + private JsonNullable allowIdpInitiated; + + @JsonCreator + public UpdateSAMLConnectionRequestBody( + @JsonProperty("name") JsonNullable name, + @JsonProperty("domain") JsonNullable domain, + @JsonProperty("idp_entity_id") JsonNullable idpEntityId, + @JsonProperty("idp_sso_url") JsonNullable idpSsoUrl, + @JsonProperty("idp_certificate") JsonNullable idpCertificate, + @JsonProperty("idp_metadata_url") JsonNullable idpMetadataUrl, + @JsonProperty("idp_metadata") JsonNullable idpMetadata, + @JsonProperty("attribute_mapping") JsonNullable attributeMapping, + @JsonProperty("active") JsonNullable active, + @JsonProperty("sync_user_attributes") JsonNullable syncUserAttributes, + @JsonProperty("allow_subdomains") JsonNullable allowSubdomains, + @JsonProperty("allow_idp_initiated") JsonNullable allowIdpInitiated) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(domain, "domain"); + Utils.checkNotNull(idpEntityId, "idpEntityId"); + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + Utils.checkNotNull(idpCertificate, "idpCertificate"); + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + Utils.checkNotNull(idpMetadata, "idpMetadata"); + Utils.checkNotNull(attributeMapping, "attributeMapping"); + Utils.checkNotNull(active, "active"); + Utils.checkNotNull(syncUserAttributes, "syncUserAttributes"); + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.name = name; + this.domain = domain; + this.idpEntityId = idpEntityId; + this.idpSsoUrl = idpSsoUrl; + this.idpCertificate = idpCertificate; + this.idpMetadataUrl = idpMetadataUrl; + this.idpMetadata = idpMetadata; + this.attributeMapping = attributeMapping; + this.active = active; + this.syncUserAttributes = syncUserAttributes; + this.allowSubdomains = allowSubdomains; + this.allowIdpInitiated = allowIdpInitiated; + } + + public UpdateSAMLConnectionRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The name of the new SAML Connection + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable name() { + return (JsonNullable) name; + } + + /** + * The domain to use for the new SAML Connection + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable domain() { + return (JsonNullable) domain; + } + + /** + * The entity id as provided by the IdP + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpEntityId() { + return (JsonNullable) idpEntityId; + } + + /** + * The SSO url as provided by the IdP + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpSsoUrl() { + return (JsonNullable) idpSsoUrl; + } + + /** + * The x509 certificated as provided by the IdP + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpCertificate() { + return (JsonNullable) idpCertificate; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpMetadataUrl() { + return (JsonNullable) idpMetadataUrl; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable idpMetadata() { + return (JsonNullable) idpMetadata; + } + + /** + * Define the atrtibute name mapping between Identity Provider and Clerk's user properties + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable attributeMapping() { + return (JsonNullable) attributeMapping; + } + + /** + * Activate or de-activate the SAML Connection + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable active() { + return (JsonNullable) active; + } + + /** + * Controls whether to update the user's attributes in each sign-in + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable syncUserAttributes() { + return (JsonNullable) syncUserAttributes; + } + + /** + * Allow users with an email address subdomain to use this connection in order to authenticate + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable allowSubdomains() { + return (JsonNullable) allowSubdomains; + } + + /** + * Enable or deactivate IdP-initiated flows + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable allowIdpInitiated() { + return (JsonNullable) allowIdpInitiated; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The name of the new SAML Connection + */ + public UpdateSAMLConnectionRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the new SAML Connection + */ + public UpdateSAMLConnectionRequestBody withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The domain to use for the new SAML Connection + */ + public UpdateSAMLConnectionRequestBody withDomain(String domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = JsonNullable.of(domain); + return this; + } + + /** + * The domain to use for the new SAML Connection + */ + public UpdateSAMLConnectionRequestBody withDomain(JsonNullable domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + /** + * The entity id as provided by the IdP + */ + public UpdateSAMLConnectionRequestBody withIdpEntityId(String idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = JsonNullable.of(idpEntityId); + return this; + } + + /** + * The entity id as provided by the IdP + */ + public UpdateSAMLConnectionRequestBody withIdpEntityId(JsonNullable idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = idpEntityId; + return this; + } + + /** + * The SSO url as provided by the IdP + */ + public UpdateSAMLConnectionRequestBody withIdpSsoUrl(String idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = JsonNullable.of(idpSsoUrl); + return this; + } + + /** + * The SSO url as provided by the IdP + */ + public UpdateSAMLConnectionRequestBody withIdpSsoUrl(JsonNullable idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = idpSsoUrl; + return this; + } + + /** + * The x509 certificated as provided by the IdP + */ + public UpdateSAMLConnectionRequestBody withIdpCertificate(String idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = JsonNullable.of(idpCertificate); + return this; + } + + /** + * The x509 certificated as provided by the IdP + */ + public UpdateSAMLConnectionRequestBody withIdpCertificate(JsonNullable idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = idpCertificate; + return this; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them + */ + public UpdateSAMLConnectionRequestBody withIdpMetadataUrl(String idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = JsonNullable.of(idpMetadataUrl); + return this; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them + */ + public UpdateSAMLConnectionRequestBody withIdpMetadataUrl(JsonNullable idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = idpMetadataUrl; + return this; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + public UpdateSAMLConnectionRequestBody withIdpMetadata(String idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = JsonNullable.of(idpMetadata); + return this; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + public UpdateSAMLConnectionRequestBody withIdpMetadata(JsonNullable idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = idpMetadata; + return this; + } + + /** + * Define the atrtibute name mapping between Identity Provider and Clerk's user properties + */ + public UpdateSAMLConnectionRequestBody withAttributeMapping(UpdateSAMLConnectionAttributeMapping attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = JsonNullable.of(attributeMapping); + return this; + } + + /** + * Define the atrtibute name mapping between Identity Provider and Clerk's user properties + */ + public UpdateSAMLConnectionRequestBody withAttributeMapping(JsonNullable attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = attributeMapping; + return this; + } + + /** + * Activate or de-activate the SAML Connection + */ + public UpdateSAMLConnectionRequestBody withActive(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = JsonNullable.of(active); + return this; + } + + /** + * Activate or de-activate the SAML Connection + */ + public UpdateSAMLConnectionRequestBody withActive(JsonNullable active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + /** + * Controls whether to update the user's attributes in each sign-in + */ + public UpdateSAMLConnectionRequestBody withSyncUserAttributes(boolean syncUserAttributes) { + Utils.checkNotNull(syncUserAttributes, "syncUserAttributes"); + this.syncUserAttributes = JsonNullable.of(syncUserAttributes); + return this; + } + + /** + * Controls whether to update the user's attributes in each sign-in + */ + public UpdateSAMLConnectionRequestBody withSyncUserAttributes(JsonNullable syncUserAttributes) { + Utils.checkNotNull(syncUserAttributes, "syncUserAttributes"); + this.syncUserAttributes = syncUserAttributes; + return this; + } + + /** + * Allow users with an email address subdomain to use this connection in order to authenticate + */ + public UpdateSAMLConnectionRequestBody withAllowSubdomains(boolean allowSubdomains) { + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + this.allowSubdomains = JsonNullable.of(allowSubdomains); + return this; + } + + /** + * Allow users with an email address subdomain to use this connection in order to authenticate + */ + public UpdateSAMLConnectionRequestBody withAllowSubdomains(JsonNullable allowSubdomains) { + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + this.allowSubdomains = allowSubdomains; + return this; + } + + /** + * Enable or deactivate IdP-initiated flows + */ + public UpdateSAMLConnectionRequestBody withAllowIdpInitiated(boolean allowIdpInitiated) { + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.allowIdpInitiated = JsonNullable.of(allowIdpInitiated); + return this; + } + + /** + * Enable or deactivate IdP-initiated flows + */ + public UpdateSAMLConnectionRequestBody withAllowIdpInitiated(JsonNullable allowIdpInitiated) { + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.allowIdpInitiated = allowIdpInitiated; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSAMLConnectionRequestBody other = (UpdateSAMLConnectionRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.domain, other.domain) && + java.util.Objects.deepEquals(this.idpEntityId, other.idpEntityId) && + java.util.Objects.deepEquals(this.idpSsoUrl, other.idpSsoUrl) && + java.util.Objects.deepEquals(this.idpCertificate, other.idpCertificate) && + java.util.Objects.deepEquals(this.idpMetadataUrl, other.idpMetadataUrl) && + java.util.Objects.deepEquals(this.idpMetadata, other.idpMetadata) && + java.util.Objects.deepEquals(this.attributeMapping, other.attributeMapping) && + java.util.Objects.deepEquals(this.active, other.active) && + java.util.Objects.deepEquals(this.syncUserAttributes, other.syncUserAttributes) && + java.util.Objects.deepEquals(this.allowSubdomains, other.allowSubdomains) && + java.util.Objects.deepEquals(this.allowIdpInitiated, other.allowIdpInitiated); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + domain, + idpEntityId, + idpSsoUrl, + idpCertificate, + idpMetadataUrl, + idpMetadata, + attributeMapping, + active, + syncUserAttributes, + allowSubdomains, + allowIdpInitiated); + } + + @Override + public String toString() { + return Utils.toString(UpdateSAMLConnectionRequestBody.class, + "name", name, + "domain", domain, + "idpEntityId", idpEntityId, + "idpSsoUrl", idpSsoUrl, + "idpCertificate", idpCertificate, + "idpMetadataUrl", idpMetadataUrl, + "idpMetadata", idpMetadata, + "attributeMapping", attributeMapping, + "active", active, + "syncUserAttributes", syncUserAttributes, + "allowSubdomains", allowSubdomains, + "allowIdpInitiated", allowIdpInitiated); + } + + public final static class Builder { + + private JsonNullable name = JsonNullable.undefined(); + + private JsonNullable domain = JsonNullable.undefined(); + + private JsonNullable idpEntityId = JsonNullable.undefined(); + + private JsonNullable idpSsoUrl = JsonNullable.undefined(); + + private JsonNullable idpCertificate = JsonNullable.undefined(); + + private JsonNullable idpMetadataUrl = JsonNullable.undefined(); + + private JsonNullable idpMetadata = JsonNullable.undefined(); + + private JsonNullable attributeMapping = JsonNullable.undefined(); + + private JsonNullable active = JsonNullable.undefined(); + + private JsonNullable syncUserAttributes = JsonNullable.undefined(); + + private JsonNullable allowSubdomains = JsonNullable.undefined(); + + private JsonNullable allowIdpInitiated = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The name of the new SAML Connection + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the new SAML Connection + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The domain to use for the new SAML Connection + */ + public Builder domain(String domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = JsonNullable.of(domain); + return this; + } + + /** + * The domain to use for the new SAML Connection + */ + public Builder domain(JsonNullable domain) { + Utils.checkNotNull(domain, "domain"); + this.domain = domain; + return this; + } + + /** + * The entity id as provided by the IdP + */ + public Builder idpEntityId(String idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = JsonNullable.of(idpEntityId); + return this; + } + + /** + * The entity id as provided by the IdP + */ + public Builder idpEntityId(JsonNullable idpEntityId) { + Utils.checkNotNull(idpEntityId, "idpEntityId"); + this.idpEntityId = idpEntityId; + return this; + } + + /** + * The SSO url as provided by the IdP + */ + public Builder idpSsoUrl(String idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = JsonNullable.of(idpSsoUrl); + return this; + } + + /** + * The SSO url as provided by the IdP + */ + public Builder idpSsoUrl(JsonNullable idpSsoUrl) { + Utils.checkNotNull(idpSsoUrl, "idpSsoUrl"); + this.idpSsoUrl = idpSsoUrl; + return this; + } + + /** + * The x509 certificated as provided by the IdP + */ + public Builder idpCertificate(String idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = JsonNullable.of(idpCertificate); + return this; + } + + /** + * The x509 certificated as provided by the IdP + */ + public Builder idpCertificate(JsonNullable idpCertificate) { + Utils.checkNotNull(idpCertificate, "idpCertificate"); + this.idpCertificate = idpCertificate; + return this; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them + */ + public Builder idpMetadataUrl(String idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = JsonNullable.of(idpMetadataUrl); + return this; + } + + /** + * The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties and replaces them + */ + public Builder idpMetadataUrl(JsonNullable idpMetadataUrl) { + Utils.checkNotNull(idpMetadataUrl, "idpMetadataUrl"); + this.idpMetadataUrl = idpMetadataUrl; + return this; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + public Builder idpMetadata(String idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = JsonNullable.of(idpMetadata); + return this; + } + + /** + * The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties + */ + public Builder idpMetadata(JsonNullable idpMetadata) { + Utils.checkNotNull(idpMetadata, "idpMetadata"); + this.idpMetadata = idpMetadata; + return this; + } + + /** + * Define the atrtibute name mapping between Identity Provider and Clerk's user properties + */ + public Builder attributeMapping(UpdateSAMLConnectionAttributeMapping attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = JsonNullable.of(attributeMapping); + return this; + } + + /** + * Define the atrtibute name mapping between Identity Provider and Clerk's user properties + */ + public Builder attributeMapping(JsonNullable attributeMapping) { + Utils.checkNotNull(attributeMapping, "attributeMapping"); + this.attributeMapping = attributeMapping; + return this; + } + + /** + * Activate or de-activate the SAML Connection + */ + public Builder active(boolean active) { + Utils.checkNotNull(active, "active"); + this.active = JsonNullable.of(active); + return this; + } + + /** + * Activate or de-activate the SAML Connection + */ + public Builder active(JsonNullable active) { + Utils.checkNotNull(active, "active"); + this.active = active; + return this; + } + + /** + * Controls whether to update the user's attributes in each sign-in + */ + public Builder syncUserAttributes(boolean syncUserAttributes) { + Utils.checkNotNull(syncUserAttributes, "syncUserAttributes"); + this.syncUserAttributes = JsonNullable.of(syncUserAttributes); + return this; + } + + /** + * Controls whether to update the user's attributes in each sign-in + */ + public Builder syncUserAttributes(JsonNullable syncUserAttributes) { + Utils.checkNotNull(syncUserAttributes, "syncUserAttributes"); + this.syncUserAttributes = syncUserAttributes; + return this; + } + + /** + * Allow users with an email address subdomain to use this connection in order to authenticate + */ + public Builder allowSubdomains(boolean allowSubdomains) { + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + this.allowSubdomains = JsonNullable.of(allowSubdomains); + return this; + } + + /** + * Allow users with an email address subdomain to use this connection in order to authenticate + */ + public Builder allowSubdomains(JsonNullable allowSubdomains) { + Utils.checkNotNull(allowSubdomains, "allowSubdomains"); + this.allowSubdomains = allowSubdomains; + return this; + } + + /** + * Enable or deactivate IdP-initiated flows + */ + public Builder allowIdpInitiated(boolean allowIdpInitiated) { + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.allowIdpInitiated = JsonNullable.of(allowIdpInitiated); + return this; + } + + /** + * Enable or deactivate IdP-initiated flows + */ + public Builder allowIdpInitiated(JsonNullable allowIdpInitiated) { + Utils.checkNotNull(allowIdpInitiated, "allowIdpInitiated"); + this.allowIdpInitiated = allowIdpInitiated; + return this; + } + + public UpdateSAMLConnectionRequestBody build() { + return new UpdateSAMLConnectionRequestBody( + name, + domain, + idpEntityId, + idpSsoUrl, + idpCertificate, + idpMetadataUrl, + idpMetadata, + attributeMapping, + active, + syncUserAttributes, + allowSubdomains, + allowIdpInitiated); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequestBuilder.java new file mode 100644 index 0000000..9313b51 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateSAMLConnectionRequestBuilder { + + private String samlConnectionId; + private UpdateSAMLConnectionRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallUpdateSAMLConnection sdk; + + public UpdateSAMLConnectionRequestBuilder(SDKMethodInterfaces.MethodCallUpdateSAMLConnection sdk) { + this.sdk = sdk; + } + + public UpdateSAMLConnectionRequestBuilder samlConnectionId(String samlConnectionId) { + Utils.checkNotNull(samlConnectionId, "samlConnectionId"); + this.samlConnectionId = samlConnectionId; + return this; + } + + public UpdateSAMLConnectionRequestBuilder requestBody(UpdateSAMLConnectionRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateSAMLConnectionResponse call() throws Exception { + + return sdk.update( + samlConnectionId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionResponse.java new file mode 100644 index 0000000..8af205e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSAMLConnectionResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateSAMLConnectionResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A SAML Connection + */ + private Optional samlConnection; + + @JsonCreator + public UpdateSAMLConnectionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional samlConnection) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(samlConnection, "samlConnection"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.samlConnection = samlConnection; + } + + public UpdateSAMLConnectionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A SAML Connection + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional samlConnection() { + return (Optional) samlConnection; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateSAMLConnectionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateSAMLConnectionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateSAMLConnectionResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A SAML Connection + */ + public UpdateSAMLConnectionResponse withSAMLConnection(com.clerk.backend_api.models.components.SAMLConnection samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = Optional.ofNullable(samlConnection); + return this; + } + + /** + * A SAML Connection + */ + public UpdateSAMLConnectionResponse withSAMLConnection(Optional samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = samlConnection; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSAMLConnectionResponse other = (UpdateSAMLConnectionResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.samlConnection, other.samlConnection); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + samlConnection); + } + + @Override + public String toString() { + return Utils.toString(UpdateSAMLConnectionResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "samlConnection", samlConnection); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional samlConnection = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A SAML Connection + */ + public Builder samlConnection(com.clerk.backend_api.models.components.SAMLConnection samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = Optional.ofNullable(samlConnection); + return this; + } + + /** + * A SAML Connection + */ + public Builder samlConnection(Optional samlConnection) { + Utils.checkNotNull(samlConnection, "samlConnection"); + this.samlConnection = samlConnection; + return this; + } + + public UpdateSAMLConnectionResponse build() { + return new UpdateSAMLConnectionResponse( + contentType, + statusCode, + rawResponse, + samlConnection); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequest.java new file mode 100644 index 0000000..6a0ae75 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequest.java @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdateSignUpRequest { + + /** + * The ID of the sign-up to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public UpdateSignUpRequest( + String id, + Optional requestBody) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(requestBody, "requestBody"); + this.id = id; + this.requestBody = requestBody; + } + + public UpdateSignUpRequest( + String id) { + this(id, Optional.empty()); + } + + /** + * The ID of the sign-up to update + */ + @JsonIgnore + public String id() { + return id; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the sign-up to update + */ + public UpdateSignUpRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public UpdateSignUpRequest withRequestBody(UpdateSignUpRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public UpdateSignUpRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSignUpRequest other = (UpdateSignUpRequest) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateSignUpRequest.class, + "id", id, + "requestBody", requestBody); + } + + public final static class Builder { + + private String id; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the sign-up to update + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder requestBody(UpdateSignUpRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateSignUpRequest build() { + return new UpdateSignUpRequest( + id, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequestBody.java new file mode 100644 index 0000000..bdad57e --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequestBody.java @@ -0,0 +1,209 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateSignUpRequestBody { + + /** + * Specifies whether a custom action has run for this sign-up attempt. + * This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. + * After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_action") + private Optional customAction; + + /** + * The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. + * This will be copied to the resulting user when the sign-up is completed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_id") + private JsonNullable externalId; + + @JsonCreator + public UpdateSignUpRequestBody( + @JsonProperty("custom_action") Optional customAction, + @JsonProperty("external_id") JsonNullable externalId) { + Utils.checkNotNull(customAction, "customAction"); + Utils.checkNotNull(externalId, "externalId"); + this.customAction = customAction; + this.externalId = externalId; + } + + public UpdateSignUpRequestBody() { + this(Optional.empty(), JsonNullable.undefined()); + } + + /** + * Specifies whether a custom action has run for this sign-up attempt. + * This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. + * After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional customAction() { + return (Optional) customAction; + } + + /** + * The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. + * This will be copied to the resulting user when the sign-up is completed. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable externalId() { + return (JsonNullable) externalId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Specifies whether a custom action has run for this sign-up attempt. + * This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. + * After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. + */ + public UpdateSignUpRequestBody withCustomAction(boolean customAction) { + Utils.checkNotNull(customAction, "customAction"); + this.customAction = Optional.ofNullable(customAction); + return this; + } + + /** + * Specifies whether a custom action has run for this sign-up attempt. + * This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. + * After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. + */ + public UpdateSignUpRequestBody withCustomAction(Optional customAction) { + Utils.checkNotNull(customAction, "customAction"); + this.customAction = customAction; + return this; + } + + /** + * The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. + * This will be copied to the resulting user when the sign-up is completed. + */ + public UpdateSignUpRequestBody withExternalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + /** + * The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. + * This will be copied to the resulting user when the sign-up is completed. + */ + public UpdateSignUpRequestBody withExternalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSignUpRequestBody other = (UpdateSignUpRequestBody) o; + return + java.util.Objects.deepEquals(this.customAction, other.customAction) && + java.util.Objects.deepEquals(this.externalId, other.externalId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + customAction, + externalId); + } + + @Override + public String toString() { + return Utils.toString(UpdateSignUpRequestBody.class, + "customAction", customAction, + "externalId", externalId); + } + + public final static class Builder { + + private Optional customAction = Optional.empty(); + + private JsonNullable externalId = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Specifies whether a custom action has run for this sign-up attempt. + * This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. + * After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. + */ + public Builder customAction(boolean customAction) { + Utils.checkNotNull(customAction, "customAction"); + this.customAction = Optional.ofNullable(customAction); + return this; + } + + /** + * Specifies whether a custom action has run for this sign-up attempt. + * This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. + * After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. + */ + public Builder customAction(Optional customAction) { + Utils.checkNotNull(customAction, "customAction"); + this.customAction = customAction; + return this; + } + + /** + * The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. + * This will be copied to the resulting user when the sign-up is completed. + */ + public Builder externalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + /** + * The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. + * This will be copied to the resulting user when the sign-up is completed. + */ + public Builder externalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + public UpdateSignUpRequestBody build() { + return new UpdateSignUpRequestBody( + customAction, + externalId); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequestBuilder.java new file mode 100644 index 0000000..99b00f8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateSignUpRequestBuilder { + + private String id; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateSignUp sdk; + + public UpdateSignUpRequestBuilder(SDKMethodInterfaces.MethodCallUpdateSignUp sdk) { + this.sdk = sdk; + } + + public UpdateSignUpRequestBuilder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public UpdateSignUpRequestBuilder requestBody(UpdateSignUpRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public UpdateSignUpRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateSignUpResponse call() throws Exception { + + return sdk.update( + id, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpResponse.java new file mode 100644 index 0000000..aa7a8f0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateSignUpResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateSignUpResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional signUp; + + @JsonCreator + public UpdateSignUpResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional signUp) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(signUp, "signUp"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.signUp = signUp; + } + + public UpdateSignUpResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional signUp() { + return (Optional) signUp; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateSignUpResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateSignUpResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateSignUpResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateSignUpResponse withSignUp(com.clerk.backend_api.models.components.SignUp signUp) { + Utils.checkNotNull(signUp, "signUp"); + this.signUp = Optional.ofNullable(signUp); + return this; + } + + /** + * Success + */ + public UpdateSignUpResponse withSignUp(Optional signUp) { + Utils.checkNotNull(signUp, "signUp"); + this.signUp = signUp; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSignUpResponse other = (UpdateSignUpResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.signUp, other.signUp); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + signUp); + } + + @Override + public String toString() { + return Utils.toString(UpdateSignUpResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "signUp", signUp); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional signUp = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder signUp(com.clerk.backend_api.models.components.SignUp signUp) { + Utils.checkNotNull(signUp, "signUp"); + this.signUp = Optional.ofNullable(signUp); + return this; + } + + /** + * Success + */ + public Builder signUp(Optional signUp) { + Utils.checkNotNull(signUp, "signUp"); + this.signUp = signUp; + return this; + } + + public UpdateSignUpResponse build() { + return new UpdateSignUpResponse( + contentType, + statusCode, + rawResponse, + signUp); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataPrivateMetadata.java new file mode 100644 index 0000000..03a896f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataPrivateMetadata.java @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateUserMetadataPrivateMetadata - Metadata saved on the user that is only visible to your backend. + * The new object will be merged with the existing value. + */ + +public class UpdateUserMetadataPrivateMetadata { + + @JsonCreator + public UpdateUserMetadataPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserMetadataPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateUserMetadataPrivateMetadata build() { + return new UpdateUserMetadataPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataPublicMetadata.java new file mode 100644 index 0000000..b8a4dc3 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataPublicMetadata.java @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateUserMetadataPublicMetadata - Metadata saved on the user, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + +public class UpdateUserMetadataPublicMetadata { + + @JsonCreator + public UpdateUserMetadataPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserMetadataPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateUserMetadataPublicMetadata build() { + return new UpdateUserMetadataPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequest.java new file mode 100644 index 0000000..897d5d5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequest.java @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdateUserMetadataRequest { + + /** + * The ID of the user whose metadata will be updated and merged + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public UpdateUserMetadataRequest( + String userId, + Optional requestBody) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.userId = userId; + this.requestBody = requestBody; + } + + public UpdateUserMetadataRequest( + String userId) { + this(userId, Optional.empty()); + } + + /** + * The ID of the user whose metadata will be updated and merged + */ + @JsonIgnore + public String userId() { + return userId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user whose metadata will be updated and merged + */ + public UpdateUserMetadataRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateUserMetadataRequest withRequestBody(UpdateUserMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public UpdateUserMetadataRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserMetadataRequest other = (UpdateUserMetadataRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserMetadataRequest.class, + "userId", userId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String userId; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user whose metadata will be updated and merged + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder requestBody(UpdateUserMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateUserMetadataRequest build() { + return new UpdateUserMetadataRequest( + userId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequestBody.java new file mode 100644 index 0000000..68824fd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequestBody.java @@ -0,0 +1,281 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpdateUserMetadataRequestBody { + + /** + * Metadata saved on the user, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the user that is only visible to your backend. + * The new object will be merged with the existing value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * The new object will be merged with the existing value. + * + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unsafe_metadata") + private Optional unsafeMetadata; + + @JsonCreator + public UpdateUserMetadataRequestBody( + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("unsafe_metadata") Optional unsafeMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.unsafeMetadata = unsafeMetadata; + } + + public UpdateUserMetadataRequestBody() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + /** + * Metadata saved on the user, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the user that is only visible to your backend. + * The new object will be merged with the existing value. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * The new object will be merged with the existing value. + * + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unsafeMetadata() { + return (Optional) unsafeMetadata; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Metadata saved on the user, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public UpdateUserMetadataRequestBody withPublicMetadata(UpdateUserMetadataPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the user, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public UpdateUserMetadataRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the user that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public UpdateUserMetadataRequestBody withPrivateMetadata(UpdateUserMetadataPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the user that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public UpdateUserMetadataRequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * The new object will be merged with the existing value. + * + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public UpdateUserMetadataRequestBody withUnsafeMetadata(UpdateUserMetadataUnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * The new object will be merged with the existing value. + * + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public UpdateUserMetadataRequestBody withUnsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserMetadataRequestBody other = (UpdateUserMetadataRequestBody) o; + return + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.unsafeMetadata, other.unsafeMetadata); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + publicMetadata, + privateMetadata, + unsafeMetadata); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserMetadataRequestBody.class, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "unsafeMetadata", unsafeMetadata); + } + + public final static class Builder { + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Optional unsafeMetadata = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Metadata saved on the user, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public Builder publicMetadata(UpdateUserMetadataPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the user, that is visible to both your frontend and backend. + * The new object will be merged with the existing value. + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the user that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public Builder privateMetadata(UpdateUserMetadataPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the user that is only visible to your backend. + * The new object will be merged with the existing value. + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * The new object will be merged with the existing value. + * + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public Builder unsafeMetadata(UpdateUserMetadataUnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * The new object will be merged with the existing value. + * + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public Builder unsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + public UpdateUserMetadataRequestBody build() { + return new UpdateUserMetadataRequestBody( + publicMetadata, + privateMetadata, + unsafeMetadata); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequestBuilder.java new file mode 100644 index 0000000..77e22fe --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateUserMetadataRequestBuilder { + + private String userId; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpdateUserMetadata sdk; + + public UpdateUserMetadataRequestBuilder(SDKMethodInterfaces.MethodCallUpdateUserMetadata sdk) { + this.sdk = sdk; + } + + public UpdateUserMetadataRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateUserMetadataRequestBuilder requestBody(UpdateUserMetadataRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public UpdateUserMetadataRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateUserMetadataResponse call() throws Exception { + + return sdk.updateMetadata( + userId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataResponse.java new file mode 100644 index 0000000..c13b041 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateUserMetadataResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public UpdateUserMetadataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public UpdateUserMetadataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateUserMetadataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateUserMetadataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateUserMetadataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateUserMetadataResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public UpdateUserMetadataResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserMetadataResponse other = (UpdateUserMetadataResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserMetadataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public UpdateUserMetadataResponse build() { + return new UpdateUserMetadataResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataUnsafeMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataUnsafeMetadata.java new file mode 100644 index 0000000..ccaf847 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserMetadataUnsafeMetadata.java @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateUserMetadataUnsafeMetadata - Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * The new object will be merged with the existing value. + * + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + +public class UpdateUserMetadataUnsafeMetadata { + + @JsonCreator + public UpdateUserMetadataUnsafeMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserMetadataUnsafeMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateUserMetadataUnsafeMetadata build() { + return new UpdateUserMetadataUnsafeMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPasswordHasher.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPasswordHasher.java new file mode 100644 index 0000000..191ee9a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPasswordHasher.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * UpdateUserPasswordHasher - The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + */ +public enum UpdateUserPasswordHasher { + ARGON2I("argon2i"), + ARGON2ID("argon2id"), + BCRYPT("bcrypt"), + BCRYPT_SHA256_DJANGO("bcrypt_sha256_django"), + MD5("md5"), + PBKDF2_SHA256("pbkdf2_sha256"), + PBKDF2_SHA512("pbkdf2_sha512"), + PBKDF2_SHA256_DJANGO("pbkdf2_sha256_django"), + PBKDF2_SHA1("pbkdf2_sha1"), + PHPASS("phpass"), + SCRYPT_FIREBASE("scrypt_firebase"), + SCRYPT_WERKZEUG("scrypt_werkzeug"), + SHA256("sha256"); + + @JsonValue + private final String value; + + private UpdateUserPasswordHasher(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPrivateMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPrivateMetadata.java new file mode 100644 index 0000000..858cfdf --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPrivateMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateUserPrivateMetadata - Metadata saved on the user, that is only visible to your Backend API + */ + +public class UpdateUserPrivateMetadata { + + @JsonCreator + public UpdateUserPrivateMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserPrivateMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateUserPrivateMetadata build() { + return new UpdateUserPrivateMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPublicMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPublicMetadata.java new file mode 100644 index 0000000..c0cf868 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserPublicMetadata.java @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateUserPublicMetadata - Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + +public class UpdateUserPublicMetadata { + + @JsonCreator + public UpdateUserPublicMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserPublicMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateUserPublicMetadata build() { + return new UpdateUserPublicMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequest.java new file mode 100644 index 0000000..860c6d1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequest.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UpdateUserRequest { + + /** + * The ID of the user to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private UpdateUserRequestBody requestBody; + + @JsonCreator + public UpdateUserRequest( + String userId, + UpdateUserRequestBody requestBody) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.userId = userId; + this.requestBody = requestBody; + } + + /** + * The ID of the user to update + */ + @JsonIgnore + public String userId() { + return userId; + } + + @JsonIgnore + public UpdateUserRequestBody requestBody() { + return requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user to update + */ + public UpdateUserRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateUserRequest withRequestBody(UpdateUserRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserRequest other = (UpdateUserRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserRequest.class, + "userId", userId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String userId; + + private UpdateUserRequestBody requestBody; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user to update + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder requestBody(UpdateUserRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateUserRequest build() { + return new UpdateUserRequest( + userId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequestBody.java new file mode 100644 index 0000000..1514f28 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequestBody.java @@ -0,0 +1,2189 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpdateUserRequestBody { + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("external_id") + private JsonNullable externalId; + + /** + * The first name to assign to the user + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private JsonNullable firstName; + + /** + * The last name to assign to the user + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private JsonNullable lastName; + + /** + * The ID of the email address to set as primary. + * It must be verified, and present on the current user. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary_email_address_id") + private Optional primaryEmailAddressId; + + /** + * If set to `true`, the user will be notified that their primary email address has changed. + * By default, no notification is sent. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("notify_primary_email_address_changed") + private Optional notifyPrimaryEmailAddressChanged; + + /** + * The ID of the phone number to set as primary. + * It must be verified, and present on the current user. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary_phone_number_id") + private Optional primaryPhoneNumberId; + + /** + * The ID of the web3 wallets to set as primary. + * It must be verified, and present on the current user. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("primary_web3_wallet_id") + private Optional primaryWeb3WalletId; + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("username") + private JsonNullable username; + + /** + * The ID of the image to set as the user's profile image + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("profile_image_id") + private JsonNullable profileImageId; + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("password") + private JsonNullable password; + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("password_digest") + private Optional passwordDigest; + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("password_hasher") + private Optional passwordHasher; + + /** + * Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("skip_password_checks") + private JsonNullable skipPasswordChecks; + + /** + * Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sign_out_of_other_sessions") + private JsonNullable signOutOfOtherSessions; + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totp_secret") + private Optional totpSecret; + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("backup_codes") + private Optional> backupCodes; + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("public_metadata") + private Optional publicMetadata; + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("private_metadata") + private Optional privateMetadata; + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unsafe_metadata") + private Optional unsafeMetadata; + + /** + * If true, the user can delete themselves with the Frontend API. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("delete_self_enabled") + private JsonNullable deleteSelfEnabled; + + /** + * If true, the user can create organizations with the Frontend API. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("create_organization_enabled") + private JsonNullable createOrganizationEnabled; + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private Optional createdAt; + + @JsonCreator + public UpdateUserRequestBody( + @JsonProperty("external_id") JsonNullable externalId, + @JsonProperty("first_name") JsonNullable firstName, + @JsonProperty("last_name") JsonNullable lastName, + @JsonProperty("primary_email_address_id") Optional primaryEmailAddressId, + @JsonProperty("notify_primary_email_address_changed") Optional notifyPrimaryEmailAddressChanged, + @JsonProperty("primary_phone_number_id") Optional primaryPhoneNumberId, + @JsonProperty("primary_web3_wallet_id") Optional primaryWeb3WalletId, + @JsonProperty("username") JsonNullable username, + @JsonProperty("profile_image_id") JsonNullable profileImageId, + @JsonProperty("password") JsonNullable password, + @JsonProperty("password_digest") Optional passwordDigest, + @JsonProperty("password_hasher") Optional passwordHasher, + @JsonProperty("skip_password_checks") JsonNullable skipPasswordChecks, + @JsonProperty("sign_out_of_other_sessions") JsonNullable signOutOfOtherSessions, + @JsonProperty("totp_secret") Optional totpSecret, + @JsonProperty("backup_codes") Optional> backupCodes, + @JsonProperty("public_metadata") Optional publicMetadata, + @JsonProperty("private_metadata") Optional privateMetadata, + @JsonProperty("unsafe_metadata") Optional unsafeMetadata, + @JsonProperty("delete_self_enabled") JsonNullable deleteSelfEnabled, + @JsonProperty("create_organization_enabled") JsonNullable createOrganizationEnabled, + @JsonProperty("created_at") Optional createdAt) { + Utils.checkNotNull(externalId, "externalId"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + Utils.checkNotNull(notifyPrimaryEmailAddressChanged, "notifyPrimaryEmailAddressChanged"); + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + Utils.checkNotNull(username, "username"); + Utils.checkNotNull(profileImageId, "profileImageId"); + Utils.checkNotNull(password, "password"); + Utils.checkNotNull(passwordDigest, "passwordDigest"); + Utils.checkNotNull(passwordHasher, "passwordHasher"); + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + Utils.checkNotNull(signOutOfOtherSessions, "signOutOfOtherSessions"); + Utils.checkNotNull(totpSecret, "totpSecret"); + Utils.checkNotNull(backupCodes, "backupCodes"); + Utils.checkNotNull(publicMetadata, "publicMetadata"); + Utils.checkNotNull(privateMetadata, "privateMetadata"); + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + Utils.checkNotNull(createdAt, "createdAt"); + this.externalId = externalId; + this.firstName = firstName; + this.lastName = lastName; + this.primaryEmailAddressId = primaryEmailAddressId; + this.notifyPrimaryEmailAddressChanged = notifyPrimaryEmailAddressChanged; + this.primaryPhoneNumberId = primaryPhoneNumberId; + this.primaryWeb3WalletId = primaryWeb3WalletId; + this.username = username; + this.profileImageId = profileImageId; + this.password = password; + this.passwordDigest = passwordDigest; + this.passwordHasher = passwordHasher; + this.skipPasswordChecks = skipPasswordChecks; + this.signOutOfOtherSessions = signOutOfOtherSessions; + this.totpSecret = totpSecret; + this.backupCodes = backupCodes; + this.publicMetadata = publicMetadata; + this.privateMetadata = privateMetadata; + this.unsafeMetadata = unsafeMetadata; + this.deleteSelfEnabled = deleteSelfEnabled; + this.createOrganizationEnabled = createOrganizationEnabled; + this.createdAt = createdAt; + } + + public UpdateUserRequestBody() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable externalId() { + return (JsonNullable) externalId; + } + + /** + * The first name to assign to the user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable firstName() { + return (JsonNullable) firstName; + } + + /** + * The last name to assign to the user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable lastName() { + return (JsonNullable) lastName; + } + + /** + * The ID of the email address to set as primary. + * It must be verified, and present on the current user. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional primaryEmailAddressId() { + return (Optional) primaryEmailAddressId; + } + + /** + * If set to `true`, the user will be notified that their primary email address has changed. + * By default, no notification is sent. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional notifyPrimaryEmailAddressChanged() { + return (Optional) notifyPrimaryEmailAddressChanged; + } + + /** + * The ID of the phone number to set as primary. + * It must be verified, and present on the current user. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional primaryPhoneNumberId() { + return (Optional) primaryPhoneNumberId; + } + + /** + * The ID of the web3 wallets to set as primary. + * It must be verified, and present on the current user. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional primaryWeb3WalletId() { + return (Optional) primaryWeb3WalletId; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable username() { + return (JsonNullable) username; + } + + /** + * The ID of the image to set as the user's profile image + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable profileImageId() { + return (JsonNullable) profileImageId; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable password() { + return (JsonNullable) password; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional passwordDigest() { + return (Optional) passwordDigest; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional passwordHasher() { + return (Optional) passwordHasher; + } + + /** + * Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable skipPasswordChecks() { + return (JsonNullable) skipPasswordChecks; + } + + /** + * Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable signOutOfOtherSessions() { + return (JsonNullable) signOutOfOtherSessions; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional totpSecret() { + return (Optional) totpSecret; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> backupCodes() { + return (Optional>) backupCodes; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional publicMetadata() { + return (Optional) publicMetadata; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional privateMetadata() { + return (Optional) privateMetadata; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unsafeMetadata() { + return (Optional) unsafeMetadata; + } + + /** + * If true, the user can delete themselves with the Frontend API. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable deleteSelfEnabled() { + return (JsonNullable) deleteSelfEnabled; + } + + /** + * If true, the user can create organizations with the Frontend API. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable createOrganizationEnabled() { + return (JsonNullable) createOrganizationEnabled; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createdAt() { + return (Optional) createdAt; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + public UpdateUserRequestBody withExternalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + public UpdateUserRequestBody withExternalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + /** + * The first name to assign to the user + */ + public UpdateUserRequestBody withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + /** + * The first name to assign to the user + */ + public UpdateUserRequestBody withFirstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + /** + * The last name to assign to the user + */ + public UpdateUserRequestBody withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + /** + * The last name to assign to the user + */ + public UpdateUserRequestBody withLastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * The ID of the email address to set as primary. + * It must be verified, and present on the current user. + */ + public UpdateUserRequestBody withPrimaryEmailAddressId(String primaryEmailAddressId) { + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + this.primaryEmailAddressId = Optional.ofNullable(primaryEmailAddressId); + return this; + } + + /** + * The ID of the email address to set as primary. + * It must be verified, and present on the current user. + */ + public UpdateUserRequestBody withPrimaryEmailAddressId(Optional primaryEmailAddressId) { + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + this.primaryEmailAddressId = primaryEmailAddressId; + return this; + } + + /** + * If set to `true`, the user will be notified that their primary email address has changed. + * By default, no notification is sent. + */ + public UpdateUserRequestBody withNotifyPrimaryEmailAddressChanged(boolean notifyPrimaryEmailAddressChanged) { + Utils.checkNotNull(notifyPrimaryEmailAddressChanged, "notifyPrimaryEmailAddressChanged"); + this.notifyPrimaryEmailAddressChanged = Optional.ofNullable(notifyPrimaryEmailAddressChanged); + return this; + } + + /** + * If set to `true`, the user will be notified that their primary email address has changed. + * By default, no notification is sent. + */ + public UpdateUserRequestBody withNotifyPrimaryEmailAddressChanged(Optional notifyPrimaryEmailAddressChanged) { + Utils.checkNotNull(notifyPrimaryEmailAddressChanged, "notifyPrimaryEmailAddressChanged"); + this.notifyPrimaryEmailAddressChanged = notifyPrimaryEmailAddressChanged; + return this; + } + + /** + * The ID of the phone number to set as primary. + * It must be verified, and present on the current user. + */ + public UpdateUserRequestBody withPrimaryPhoneNumberId(String primaryPhoneNumberId) { + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + this.primaryPhoneNumberId = Optional.ofNullable(primaryPhoneNumberId); + return this; + } + + /** + * The ID of the phone number to set as primary. + * It must be verified, and present on the current user. + */ + public UpdateUserRequestBody withPrimaryPhoneNumberId(Optional primaryPhoneNumberId) { + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + this.primaryPhoneNumberId = primaryPhoneNumberId; + return this; + } + + /** + * The ID of the web3 wallets to set as primary. + * It must be verified, and present on the current user. + */ + public UpdateUserRequestBody withPrimaryWeb3WalletId(String primaryWeb3WalletId) { + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + this.primaryWeb3WalletId = Optional.ofNullable(primaryWeb3WalletId); + return this; + } + + /** + * The ID of the web3 wallets to set as primary. + * It must be verified, and present on the current user. + */ + public UpdateUserRequestBody withPrimaryWeb3WalletId(Optional primaryWeb3WalletId) { + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + this.primaryWeb3WalletId = primaryWeb3WalletId; + return this; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + public UpdateUserRequestBody withUsername(String username) { + Utils.checkNotNull(username, "username"); + this.username = JsonNullable.of(username); + return this; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + public UpdateUserRequestBody withUsername(JsonNullable username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + /** + * The ID of the image to set as the user's profile image + */ + public UpdateUserRequestBody withProfileImageId(String profileImageId) { + Utils.checkNotNull(profileImageId, "profileImageId"); + this.profileImageId = JsonNullable.of(profileImageId); + return this; + } + + /** + * The ID of the image to set as the user's profile image + */ + public UpdateUserRequestBody withProfileImageId(JsonNullable profileImageId) { + Utils.checkNotNull(profileImageId, "profileImageId"); + this.profileImageId = profileImageId; + return this; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + public UpdateUserRequestBody withPassword(String password) { + Utils.checkNotNull(password, "password"); + this.password = JsonNullable.of(password); + return this; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + public UpdateUserRequestBody withPassword(JsonNullable password) { + Utils.checkNotNull(password, "password"); + this.password = password; + return this; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + public UpdateUserRequestBody withPasswordDigest(String passwordDigest) { + Utils.checkNotNull(passwordDigest, "passwordDigest"); + this.passwordDigest = Optional.ofNullable(passwordDigest); + return this; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + public UpdateUserRequestBody withPasswordDigest(Optional passwordDigest) { + Utils.checkNotNull(passwordDigest, "passwordDigest"); + this.passwordDigest = passwordDigest; + return this; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + */ + public UpdateUserRequestBody withPasswordHasher(UpdateUserPasswordHasher passwordHasher) { + Utils.checkNotNull(passwordHasher, "passwordHasher"); + this.passwordHasher = Optional.ofNullable(passwordHasher); + return this; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + */ + public UpdateUserRequestBody withPasswordHasher(Optional passwordHasher) { + Utils.checkNotNull(passwordHasher, "passwordHasher"); + this.passwordHasher = passwordHasher; + return this; + } + + /** + * Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. + */ + public UpdateUserRequestBody withSkipPasswordChecks(boolean skipPasswordChecks) { + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + this.skipPasswordChecks = JsonNullable.of(skipPasswordChecks); + return this; + } + + /** + * Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. + */ + public UpdateUserRequestBody withSkipPasswordChecks(JsonNullable skipPasswordChecks) { + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + this.skipPasswordChecks = skipPasswordChecks; + return this; + } + + /** + * Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. + */ + public UpdateUserRequestBody withSignOutOfOtherSessions(boolean signOutOfOtherSessions) { + Utils.checkNotNull(signOutOfOtherSessions, "signOutOfOtherSessions"); + this.signOutOfOtherSessions = JsonNullable.of(signOutOfOtherSessions); + return this; + } + + /** + * Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. + */ + public UpdateUserRequestBody withSignOutOfOtherSessions(JsonNullable signOutOfOtherSessions) { + Utils.checkNotNull(signOutOfOtherSessions, "signOutOfOtherSessions"); + this.signOutOfOtherSessions = signOutOfOtherSessions; + return this; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + public UpdateUserRequestBody withTotpSecret(String totpSecret) { + Utils.checkNotNull(totpSecret, "totpSecret"); + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + public UpdateUserRequestBody withTotpSecret(Optional totpSecret) { + Utils.checkNotNull(totpSecret, "totpSecret"); + this.totpSecret = totpSecret; + return this; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + public UpdateUserRequestBody withBackupCodes(java.util.List backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = Optional.ofNullable(backupCodes); + return this; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + public UpdateUserRequestBody withBackupCodes(Optional> backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = backupCodes; + return this; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + public UpdateUserRequestBody withPublicMetadata(UpdateUserPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + public UpdateUserRequestBody withPublicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + public UpdateUserRequestBody withPrivateMetadata(UpdateUserPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + public UpdateUserRequestBody withPrivateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public UpdateUserRequestBody withUnsafeMetadata(UpdateUserUnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public UpdateUserRequestBody withUnsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + /** + * If true, the user can delete themselves with the Frontend API. + */ + public UpdateUserRequestBody withDeleteSelfEnabled(boolean deleteSelfEnabled) { + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + this.deleteSelfEnabled = JsonNullable.of(deleteSelfEnabled); + return this; + } + + /** + * If true, the user can delete themselves with the Frontend API. + */ + public UpdateUserRequestBody withDeleteSelfEnabled(JsonNullable deleteSelfEnabled) { + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + this.deleteSelfEnabled = deleteSelfEnabled; + return this; + } + + /** + * If true, the user can create organizations with the Frontend API. + */ + public UpdateUserRequestBody withCreateOrganizationEnabled(boolean createOrganizationEnabled) { + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + this.createOrganizationEnabled = JsonNullable.of(createOrganizationEnabled); + return this; + } + + /** + * If true, the user can create organizations with the Frontend API. + */ + public UpdateUserRequestBody withCreateOrganizationEnabled(JsonNullable createOrganizationEnabled) { + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + this.createOrganizationEnabled = createOrganizationEnabled; + return this; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + public UpdateUserRequestBody withCreatedAt(String createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + public UpdateUserRequestBody withCreatedAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserRequestBody other = (UpdateUserRequestBody) o; + return + java.util.Objects.deepEquals(this.externalId, other.externalId) && + java.util.Objects.deepEquals(this.firstName, other.firstName) && + java.util.Objects.deepEquals(this.lastName, other.lastName) && + java.util.Objects.deepEquals(this.primaryEmailAddressId, other.primaryEmailAddressId) && + java.util.Objects.deepEquals(this.notifyPrimaryEmailAddressChanged, other.notifyPrimaryEmailAddressChanged) && + java.util.Objects.deepEquals(this.primaryPhoneNumberId, other.primaryPhoneNumberId) && + java.util.Objects.deepEquals(this.primaryWeb3WalletId, other.primaryWeb3WalletId) && + java.util.Objects.deepEquals(this.username, other.username) && + java.util.Objects.deepEquals(this.profileImageId, other.profileImageId) && + java.util.Objects.deepEquals(this.password, other.password) && + java.util.Objects.deepEquals(this.passwordDigest, other.passwordDigest) && + java.util.Objects.deepEquals(this.passwordHasher, other.passwordHasher) && + java.util.Objects.deepEquals(this.skipPasswordChecks, other.skipPasswordChecks) && + java.util.Objects.deepEquals(this.signOutOfOtherSessions, other.signOutOfOtherSessions) && + java.util.Objects.deepEquals(this.totpSecret, other.totpSecret) && + java.util.Objects.deepEquals(this.backupCodes, other.backupCodes) && + java.util.Objects.deepEquals(this.publicMetadata, other.publicMetadata) && + java.util.Objects.deepEquals(this.privateMetadata, other.privateMetadata) && + java.util.Objects.deepEquals(this.unsafeMetadata, other.unsafeMetadata) && + java.util.Objects.deepEquals(this.deleteSelfEnabled, other.deleteSelfEnabled) && + java.util.Objects.deepEquals(this.createOrganizationEnabled, other.createOrganizationEnabled) && + java.util.Objects.deepEquals(this.createdAt, other.createdAt); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + externalId, + firstName, + lastName, + primaryEmailAddressId, + notifyPrimaryEmailAddressChanged, + primaryPhoneNumberId, + primaryWeb3WalletId, + username, + profileImageId, + password, + passwordDigest, + passwordHasher, + skipPasswordChecks, + signOutOfOtherSessions, + totpSecret, + backupCodes, + publicMetadata, + privateMetadata, + unsafeMetadata, + deleteSelfEnabled, + createOrganizationEnabled, + createdAt); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserRequestBody.class, + "externalId", externalId, + "firstName", firstName, + "lastName", lastName, + "primaryEmailAddressId", primaryEmailAddressId, + "notifyPrimaryEmailAddressChanged", notifyPrimaryEmailAddressChanged, + "primaryPhoneNumberId", primaryPhoneNumberId, + "primaryWeb3WalletId", primaryWeb3WalletId, + "username", username, + "profileImageId", profileImageId, + "password", password, + "passwordDigest", passwordDigest, + "passwordHasher", passwordHasher, + "skipPasswordChecks", skipPasswordChecks, + "signOutOfOtherSessions", signOutOfOtherSessions, + "totpSecret", totpSecret, + "backupCodes", backupCodes, + "publicMetadata", publicMetadata, + "privateMetadata", privateMetadata, + "unsafeMetadata", unsafeMetadata, + "deleteSelfEnabled", deleteSelfEnabled, + "createOrganizationEnabled", createOrganizationEnabled, + "createdAt", createdAt); + } + + public final static class Builder { + + private JsonNullable externalId = JsonNullable.undefined(); + + private JsonNullable firstName = JsonNullable.undefined(); + + private JsonNullable lastName = JsonNullable.undefined(); + + private Optional primaryEmailAddressId = Optional.empty(); + + private Optional notifyPrimaryEmailAddressChanged; + + private Optional primaryPhoneNumberId = Optional.empty(); + + private Optional primaryWeb3WalletId = Optional.empty(); + + private JsonNullable username = JsonNullable.undefined(); + + private JsonNullable profileImageId = JsonNullable.undefined(); + + private JsonNullable password = JsonNullable.undefined(); + + private Optional passwordDigest = Optional.empty(); + + private Optional passwordHasher = Optional.empty(); + + private JsonNullable skipPasswordChecks = JsonNullable.undefined(); + + private JsonNullable signOutOfOtherSessions = JsonNullable.undefined(); + + private Optional totpSecret = Optional.empty(); + + private Optional> backupCodes = Optional.empty(); + + private Optional publicMetadata = Optional.empty(); + + private Optional privateMetadata = Optional.empty(); + + private Optional unsafeMetadata = Optional.empty(); + + private JsonNullable deleteSelfEnabled = JsonNullable.undefined(); + + private JsonNullable createOrganizationEnabled = JsonNullable.undefined(); + + private Optional createdAt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + public Builder externalId(String externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = JsonNullable.of(externalId); + return this; + } + + /** + * The ID of the user as used in your external systems or your previous authentication solution. + * Must be unique across your instance. + */ + public Builder externalId(JsonNullable externalId) { + Utils.checkNotNull(externalId, "externalId"); + this.externalId = externalId; + return this; + } + + /** + * The first name to assign to the user + */ + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + /** + * The first name to assign to the user + */ + public Builder firstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + /** + * The last name to assign to the user + */ + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + /** + * The last name to assign to the user + */ + public Builder lastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * The ID of the email address to set as primary. + * It must be verified, and present on the current user. + */ + public Builder primaryEmailAddressId(String primaryEmailAddressId) { + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + this.primaryEmailAddressId = Optional.ofNullable(primaryEmailAddressId); + return this; + } + + /** + * The ID of the email address to set as primary. + * It must be verified, and present on the current user. + */ + public Builder primaryEmailAddressId(Optional primaryEmailAddressId) { + Utils.checkNotNull(primaryEmailAddressId, "primaryEmailAddressId"); + this.primaryEmailAddressId = primaryEmailAddressId; + return this; + } + + /** + * If set to `true`, the user will be notified that their primary email address has changed. + * By default, no notification is sent. + */ + public Builder notifyPrimaryEmailAddressChanged(boolean notifyPrimaryEmailAddressChanged) { + Utils.checkNotNull(notifyPrimaryEmailAddressChanged, "notifyPrimaryEmailAddressChanged"); + this.notifyPrimaryEmailAddressChanged = Optional.ofNullable(notifyPrimaryEmailAddressChanged); + return this; + } + + /** + * If set to `true`, the user will be notified that their primary email address has changed. + * By default, no notification is sent. + */ + public Builder notifyPrimaryEmailAddressChanged(Optional notifyPrimaryEmailAddressChanged) { + Utils.checkNotNull(notifyPrimaryEmailAddressChanged, "notifyPrimaryEmailAddressChanged"); + this.notifyPrimaryEmailAddressChanged = notifyPrimaryEmailAddressChanged; + return this; + } + + /** + * The ID of the phone number to set as primary. + * It must be verified, and present on the current user. + */ + public Builder primaryPhoneNumberId(String primaryPhoneNumberId) { + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + this.primaryPhoneNumberId = Optional.ofNullable(primaryPhoneNumberId); + return this; + } + + /** + * The ID of the phone number to set as primary. + * It must be verified, and present on the current user. + */ + public Builder primaryPhoneNumberId(Optional primaryPhoneNumberId) { + Utils.checkNotNull(primaryPhoneNumberId, "primaryPhoneNumberId"); + this.primaryPhoneNumberId = primaryPhoneNumberId; + return this; + } + + /** + * The ID of the web3 wallets to set as primary. + * It must be verified, and present on the current user. + */ + public Builder primaryWeb3WalletId(String primaryWeb3WalletId) { + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + this.primaryWeb3WalletId = Optional.ofNullable(primaryWeb3WalletId); + return this; + } + + /** + * The ID of the web3 wallets to set as primary. + * It must be verified, and present on the current user. + */ + public Builder primaryWeb3WalletId(Optional primaryWeb3WalletId) { + Utils.checkNotNull(primaryWeb3WalletId, "primaryWeb3WalletId"); + this.primaryWeb3WalletId = primaryWeb3WalletId; + return this; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + public Builder username(String username) { + Utils.checkNotNull(username, "username"); + this.username = JsonNullable.of(username); + return this; + } + + /** + * The username to give to the user. + * It must be unique across your instance. + */ + public Builder username(JsonNullable username) { + Utils.checkNotNull(username, "username"); + this.username = username; + return this; + } + + /** + * The ID of the image to set as the user's profile image + */ + public Builder profileImageId(String profileImageId) { + Utils.checkNotNull(profileImageId, "profileImageId"); + this.profileImageId = JsonNullable.of(profileImageId); + return this; + } + + /** + * The ID of the image to set as the user's profile image + */ + public Builder profileImageId(JsonNullable profileImageId) { + Utils.checkNotNull(profileImageId, "profileImageId"); + this.profileImageId = profileImageId; + return this; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + public Builder password(String password) { + Utils.checkNotNull(password, "password"); + this.password = JsonNullable.of(password); + return this; + } + + /** + * The plaintext password to give the user. + * Must be at least 8 characters long, and can not be in any list of hacked passwords. + */ + public Builder password(JsonNullable password) { + Utils.checkNotNull(password, "password"); + this.password = password; + return this; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + public Builder passwordDigest(String passwordDigest) { + Utils.checkNotNull(passwordDigest, "passwordDigest"); + this.passwordDigest = Optional.ofNullable(passwordDigest); + return this; + } + + /** + * In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + * The digests should be generated with one of the supported algorithms. + * The hashing algorithm can be specified using the `password_hasher` property. + */ + public Builder passwordDigest(Optional passwordDigest) { + Utils.checkNotNull(passwordDigest, "passwordDigest"); + this.passwordDigest = passwordDigest; + return this; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + */ + public Builder passwordHasher(UpdateUserPasswordHasher passwordHasher) { + Utils.checkNotNull(passwordHasher, "passwordHasher"); + this.passwordHasher = Optional.ofNullable(passwordHasher); + return this; + } + + /** + * The hashing algorithm that was used to generate the password digest. + * The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [bcrypt_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [md5](https://en.wikipedia.org/wiki/MD5), pbkdf2_sha256, pbkdf2_sha512, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), + * [phpass](https://www.openwall.com/phpass/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/), + * [sha256](https://en.wikipedia.org/wiki/SHA-2), [scrypt_werkzeug](https://werkzeug.palletsprojects.com/en/3.0.x/utils/#werkzeug.security.generate_password_hash) + * and the [argon2](https://argon2.online/) variants argon2i and argon2id. + * + * If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + * + * Note: for password hashers considered insecure (at this moment MD5 and SHA256), the corresponding user password hashes will be transparently migrated to Bcrypt (a secure hasher) upon the user's first successful password sign in. + * Insecure schemes are marked with `(insecure)` in the list below. + * + * Each of the supported hashers expects the incoming digest to be in a particular format. Specifically: + * + * **bcrypt:** The digest should be of the following form: + * + * `$<algorithm version>$<cost>$<salt & hash>` + * + * **bcrypt_sha256_django:** This is the Django-specific variant of Bcrypt, using SHA256 hashing function. The format should be as follows (as exported from Django): + * + * `bcrypt_sha256$$<algorithm version>$<cost>$<salt & hash>` + * + * **md5** (insecure): The digest should follow the regular form e.g.: + * + * `5f4dcc3b5aa765d61d8327deb882cf99` + * + * **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: Both the salt and the hash are expected to be base64-encoded. + * + * **pbkdf2_sha512:** This is the PBKDF2 algorithm using the SHA512 hashing function. The format should be as follows: + * + * `pbkdf2_sha512$<iterations>$<salt>$<hash>` + * + * _iterations:_ The number of iterations used. Must be an integer less than 420000. + * _salt:_ The salt used when generating the hash. Must be less than bytes. + * _hash:_ The hex-encoded hash. Must have been generated with a key length less than 1024 bytes. + * + * **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + * + * `pbkdf2_sha256$<iterations>$<salt>$<hash>` + * + * Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + * + * **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + * 1. uses sha1 instead of sha256 + * 2. accepts the hash as a hex-encoded string + * + * The format is the following: + * + * `pbkdf2_sha1$<iterations>$<salt>$<hash-as-hex-string>` + * + * **phpass:** Portable public domain password hashing framework for use in PHP applications. Digests hashed with phpass have the following sections: + * + * The format is the following: + * + * `$P$<rounds><salt><encoded-checksum>` + * + * - $P$ is the prefix used to identify phpass hashes. + * - rounds is a single character encoding a 6-bit integer representing the number of rounds used. + * - salt is eight characters drawn from [./0-9A-Za-z], providing a 48-bit salt. + * - checksum is 22 characters drawn from the same set, encoding the 128-bit checksum with MD5. + * + * **scrypt_firebase:** The Firebase-specific variant of scrypt. + * The value is expected to have 6 segments separated by the $ character and include the following information: + * + * _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + * _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + * _signer key:_ The base64 encoded signer key. + * _salt separator:_ The base64 encoded salt separator. + * _rounds:_ The number of rounds the algorithm needs to run. + * _memory cost:_ The cost of the algorithm run + * + * The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + * The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + * + * Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + * + * `<hash>$<salt>$<signer key>$<salt separator>$<rounds>$<memory cost>` + * + * **scrypt_werkzeug:** The Werkzeug-specific variant of scrypt. + * + * The value is expected to have 3 segments separated by the $ character and include the following information: + * + * _algorithm args:_ The algorithm used to generate the hash. + * _salt:_ The salt used to generate the above hash. + * _hash:_ The actual Base64 hash. + * + * The algorithm args are the parameters used to generate the hash and are included in the digest. + * + * **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + * + * _version (v):_ The argon version, version 19 is assumed + * _memory (m):_ The memory used by the algorithm (in kibibytes) + * _iterations (t):_ The number of iterations to perform + * _parallelism (p):_ The number of threads to use + * + * Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + * The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + * The final part is the actual digest. + * + * `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + * + * **argon2id:** See the previous algorithm for an explanation of the formatting. + * + * For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + * + * `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + * + * **sha256** (insecure): The digest should be a 64-length hex string, e.g.: + * + * `9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08` + */ + public Builder passwordHasher(Optional passwordHasher) { + Utils.checkNotNull(passwordHasher, "passwordHasher"); + this.passwordHasher = passwordHasher; + return this; + } + + /** + * Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. + */ + public Builder skipPasswordChecks(boolean skipPasswordChecks) { + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + this.skipPasswordChecks = JsonNullable.of(skipPasswordChecks); + return this; + } + + /** + * Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`. + */ + public Builder skipPasswordChecks(JsonNullable skipPasswordChecks) { + Utils.checkNotNull(skipPasswordChecks, "skipPasswordChecks"); + this.skipPasswordChecks = skipPasswordChecks; + return this; + } + + /** + * Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. + */ + public Builder signOutOfOtherSessions(boolean signOutOfOtherSessions) { + Utils.checkNotNull(signOutOfOtherSessions, "signOutOfOtherSessions"); + this.signOutOfOtherSessions = JsonNullable.of(signOutOfOtherSessions); + return this; + } + + /** + * Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`. + */ + public Builder signOutOfOtherSessions(JsonNullable signOutOfOtherSessions) { + Utils.checkNotNull(signOutOfOtherSessions, "signOutOfOtherSessions"); + this.signOutOfOtherSessions = signOutOfOtherSessions; + return this; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + public Builder totpSecret(String totpSecret) { + Utils.checkNotNull(totpSecret, "totpSecret"); + this.totpSecret = Optional.ofNullable(totpSecret); + return this; + } + + /** + * In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. + * Please note that currently the supported options are: + * * Period: 30 seconds + * * Code length: 6 digits + * * Algorithm: SHA1 + */ + public Builder totpSecret(Optional totpSecret) { + Utils.checkNotNull(totpSecret, "totpSecret"); + this.totpSecret = totpSecret; + return this; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + public Builder backupCodes(java.util.List backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = Optional.ofNullable(backupCodes); + return this; + } + + /** + * If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. + * You must provide the backup codes in plain format or the corresponding bcrypt digest. + */ + public Builder backupCodes(Optional> backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = backupCodes; + return this; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + public Builder publicMetadata(UpdateUserPublicMetadata publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = Optional.ofNullable(publicMetadata); + return this; + } + + /** + * Metadata saved on the user, that is visible to both your Frontend and Backend APIs + */ + public Builder publicMetadata(Optional publicMetadata) { + Utils.checkNotNull(publicMetadata, "publicMetadata"); + this.publicMetadata = publicMetadata; + return this; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + public Builder privateMetadata(UpdateUserPrivateMetadata privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = Optional.ofNullable(privateMetadata); + return this; + } + + /** + * Metadata saved on the user, that is only visible to your Backend API + */ + public Builder privateMetadata(Optional privateMetadata) { + Utils.checkNotNull(privateMetadata, "privateMetadata"); + this.privateMetadata = privateMetadata; + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public Builder unsafeMetadata(UpdateUserUnsafeMetadata unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = Optional.ofNullable(unsafeMetadata); + return this; + } + + /** + * Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + public Builder unsafeMetadata(Optional unsafeMetadata) { + Utils.checkNotNull(unsafeMetadata, "unsafeMetadata"); + this.unsafeMetadata = unsafeMetadata; + return this; + } + + /** + * If true, the user can delete themselves with the Frontend API. + */ + public Builder deleteSelfEnabled(boolean deleteSelfEnabled) { + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + this.deleteSelfEnabled = JsonNullable.of(deleteSelfEnabled); + return this; + } + + /** + * If true, the user can delete themselves with the Frontend API. + */ + public Builder deleteSelfEnabled(JsonNullable deleteSelfEnabled) { + Utils.checkNotNull(deleteSelfEnabled, "deleteSelfEnabled"); + this.deleteSelfEnabled = deleteSelfEnabled; + return this; + } + + /** + * If true, the user can create organizations with the Frontend API. + */ + public Builder createOrganizationEnabled(boolean createOrganizationEnabled) { + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + this.createOrganizationEnabled = JsonNullable.of(createOrganizationEnabled); + return this; + } + + /** + * If true, the user can create organizations with the Frontend API. + */ + public Builder createOrganizationEnabled(JsonNullable createOrganizationEnabled) { + Utils.checkNotNull(createOrganizationEnabled, "createOrganizationEnabled"); + this.createOrganizationEnabled = createOrganizationEnabled; + return this; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + public Builder createdAt(String createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + * A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + */ + public Builder createdAt(Optional createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + public UpdateUserRequestBody build() { + if (notifyPrimaryEmailAddressChanged == null) { + notifyPrimaryEmailAddressChanged = _SINGLETON_VALUE_NotifyPrimaryEmailAddressChanged.value(); + } + return new UpdateUserRequestBody( + externalId, + firstName, + lastName, + primaryEmailAddressId, + notifyPrimaryEmailAddressChanged, + primaryPhoneNumberId, + primaryWeb3WalletId, + username, + profileImageId, + password, + passwordDigest, + passwordHasher, + skipPasswordChecks, + signOutOfOtherSessions, + totpSecret, + backupCodes, + publicMetadata, + privateMetadata, + unsafeMetadata, + deleteSelfEnabled, + createOrganizationEnabled, + createdAt); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_NotifyPrimaryEmailAddressChanged = + new LazySingletonValue<>( + "notify_primary_email_address_changed", + "false", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequestBuilder.java new file mode 100644 index 0000000..d4c75bd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpdateUserRequestBuilder { + + private String userId; + private UpdateUserRequestBody requestBody; + private final SDKMethodInterfaces.MethodCallUpdateUser sdk; + + public UpdateUserRequestBuilder(SDKMethodInterfaces.MethodCallUpdateUser sdk) { + this.sdk = sdk; + } + + public UpdateUserRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UpdateUserRequestBuilder requestBody(UpdateUserRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpdateUserResponse call() throws Exception { + + return sdk.update( + userId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserResponse.java new file mode 100644 index 0000000..426c3f6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpdateUserResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional user; + + @JsonCreator + public UpdateUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional user) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(user, "user"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.user = user; + } + + public UpdateUserResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional user() { + return (Optional) user; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpdateUserResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateUserResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateUserResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpdateUserResponse withUser(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public UpdateUserResponse withUser(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateUserResponse other = (UpdateUserResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.user, other.user); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + user); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "user", user); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional user = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder user(com.clerk.backend_api.models.components.User user) { + Utils.checkNotNull(user, "user"); + this.user = Optional.ofNullable(user); + return this; + } + + /** + * Success + */ + public Builder user(Optional user) { + Utils.checkNotNull(user, "user"); + this.user = user; + return this; + } + + public UpdateUserResponse build() { + return new UpdateUserResponse( + contentType, + statusCode, + rawResponse, + user); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpdateUserUnsafeMetadata.java b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserUnsafeMetadata.java new file mode 100644 index 0000000..cfca187 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpdateUserUnsafeMetadata.java @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +/** + * UpdateUserUnsafeMetadata - Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + * Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + */ + +public class UpdateUserUnsafeMetadata { + + @JsonCreator + public UpdateUserUnsafeMetadata() { + + + } + + public final static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ); + } + + @Override + public String toString() { + return Utils.toString(UpdateUserUnsafeMetadata.class); + } + + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public UpdateUserUnsafeMetadata build() { + return new UpdateUserUnsafeMetadata( + ); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoFile.java b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoFile.java new file mode 100644 index 0000000..90b389f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoFile.java @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UploadOrganizationLogoFile { + + @SpeakeasyMetadata("multipartForm:name=file") + private String fileName; + + @SpeakeasyMetadata("multipartForm:content") + private byte[] content; + + @JsonCreator + public UploadOrganizationLogoFile( + String fileName, + byte[] content) { + Utils.checkNotNull(fileName, "fileName"); + Utils.checkNotNull(content, "content"); + this.fileName = fileName; + this.content = content; + } + + @JsonIgnore + public String fileName() { + return fileName; + } + + @JsonIgnore + public byte[] content() { + return content; + } + + public final static Builder builder() { + return new Builder(); + } + + public UploadOrganizationLogoFile withFileName(String fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = fileName; + return this; + } + + public UploadOrganizationLogoFile withContent(byte[] content) { + Utils.checkNotNull(content, "content"); + this.content = content; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadOrganizationLogoFile other = (UploadOrganizationLogoFile) o; + return + java.util.Objects.deepEquals(this.fileName, other.fileName) && + java.util.Objects.deepEquals(this.content, other.content); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + fileName, + content); + } + + @Override + public String toString() { + return Utils.toString(UploadOrganizationLogoFile.class, + "fileName", fileName, + "content", content); + } + + public final static class Builder { + + private String fileName; + + private byte[] content; + + private Builder() { + // force use of static builder() method + } + + public Builder fileName(String fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = fileName; + return this; + } + + public Builder content(byte[] content) { + Utils.checkNotNull(content, "content"); + this.content = content; + return this; + } + + public UploadOrganizationLogoFile build() { + return new UploadOrganizationLogoFile( + fileName, + content); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequest.java new file mode 100644 index 0000000..306e392 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequest.java @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UploadOrganizationLogoRequest { + + /** + * The ID of the organization for which to upload a logo + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=organization_id") + private String organizationId; + + @SpeakeasyMetadata("request:mediaType=multipart/form-data") + private Optional requestBody; + + @JsonCreator + public UploadOrganizationLogoRequest( + String organizationId, + Optional requestBody) { + Utils.checkNotNull(organizationId, "organizationId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.organizationId = organizationId; + this.requestBody = requestBody; + } + + public UploadOrganizationLogoRequest( + String organizationId) { + this(organizationId, Optional.empty()); + } + + /** + * The ID of the organization for which to upload a logo + */ + @JsonIgnore + public String organizationId() { + return organizationId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the organization for which to upload a logo + */ + public UploadOrganizationLogoRequest withOrganizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public UploadOrganizationLogoRequest withRequestBody(UploadOrganizationLogoRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public UploadOrganizationLogoRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadOrganizationLogoRequest other = (UploadOrganizationLogoRequest) o; + return + java.util.Objects.deepEquals(this.organizationId, other.organizationId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + organizationId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UploadOrganizationLogoRequest.class, + "organizationId", organizationId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String organizationId; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the organization for which to upload a logo + */ + public Builder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public Builder requestBody(UploadOrganizationLogoRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UploadOrganizationLogoRequest build() { + return new UploadOrganizationLogoRequest( + organizationId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequestBody.java new file mode 100644 index 0000000..681f8b0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequestBody.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UploadOrganizationLogoRequestBody { + + /** + * The ID of the user that will be credited with the image upload. + */ + @SpeakeasyMetadata("multipartForm:name=uploader_user_id") + private String uploaderUserId; + + @SpeakeasyMetadata("multipartForm:file") + private UploadOrganizationLogoFile file; + + @JsonCreator + public UploadOrganizationLogoRequestBody( + String uploaderUserId, + UploadOrganizationLogoFile file) { + Utils.checkNotNull(uploaderUserId, "uploaderUserId"); + Utils.checkNotNull(file, "file"); + this.uploaderUserId = uploaderUserId; + this.file = file; + } + + /** + * The ID of the user that will be credited with the image upload. + */ + @JsonIgnore + public String uploaderUserId() { + return uploaderUserId; + } + + @JsonIgnore + public UploadOrganizationLogoFile file() { + return file; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user that will be credited with the image upload. + */ + public UploadOrganizationLogoRequestBody withUploaderUserId(String uploaderUserId) { + Utils.checkNotNull(uploaderUserId, "uploaderUserId"); + this.uploaderUserId = uploaderUserId; + return this; + } + + public UploadOrganizationLogoRequestBody withFile(UploadOrganizationLogoFile file) { + Utils.checkNotNull(file, "file"); + this.file = file; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadOrganizationLogoRequestBody other = (UploadOrganizationLogoRequestBody) o; + return + java.util.Objects.deepEquals(this.uploaderUserId, other.uploaderUserId) && + java.util.Objects.deepEquals(this.file, other.file); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + uploaderUserId, + file); + } + + @Override + public String toString() { + return Utils.toString(UploadOrganizationLogoRequestBody.class, + "uploaderUserId", uploaderUserId, + "file", file); + } + + public final static class Builder { + + private String uploaderUserId; + + private UploadOrganizationLogoFile file; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user that will be credited with the image upload. + */ + public Builder uploaderUserId(String uploaderUserId) { + Utils.checkNotNull(uploaderUserId, "uploaderUserId"); + this.uploaderUserId = uploaderUserId; + return this; + } + + public Builder file(UploadOrganizationLogoFile file) { + Utils.checkNotNull(file, "file"); + this.file = file; + return this; + } + + public UploadOrganizationLogoRequestBody build() { + return new UploadOrganizationLogoRequestBody( + uploaderUserId, + file); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequestBuilder.java new file mode 100644 index 0000000..c31bc33 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UploadOrganizationLogoRequestBuilder { + + private String organizationId; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUploadOrganizationLogo sdk; + + public UploadOrganizationLogoRequestBuilder(SDKMethodInterfaces.MethodCallUploadOrganizationLogo sdk) { + this.sdk = sdk; + } + + public UploadOrganizationLogoRequestBuilder organizationId(String organizationId) { + Utils.checkNotNull(organizationId, "organizationId"); + this.organizationId = organizationId; + return this; + } + + public UploadOrganizationLogoRequestBuilder requestBody(UploadOrganizationLogoRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public UploadOrganizationLogoRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UploadOrganizationLogoResponse call() throws Exception { + + return sdk.uploadLogo( + organizationId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoResponse.java new file mode 100644 index 0000000..dc21675 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UploadOrganizationLogoResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UploadOrganizationLogoResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * An organization with a logo URL. + */ + private Optional organizationWithLogo; + + @JsonCreator + public UploadOrganizationLogoResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationWithLogo) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationWithLogo, "organizationWithLogo"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationWithLogo = organizationWithLogo; + } + + public UploadOrganizationLogoResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * An organization with a logo URL. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationWithLogo() { + return (Optional) organizationWithLogo; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UploadOrganizationLogoResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UploadOrganizationLogoResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadOrganizationLogoResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization with a logo URL. + */ + public UploadOrganizationLogoResponse withOrganizationWithLogo(com.clerk.backend_api.models.components.OrganizationWithLogo organizationWithLogo) { + Utils.checkNotNull(organizationWithLogo, "organizationWithLogo"); + this.organizationWithLogo = Optional.ofNullable(organizationWithLogo); + return this; + } + + /** + * An organization with a logo URL. + */ + public UploadOrganizationLogoResponse withOrganizationWithLogo(Optional organizationWithLogo) { + Utils.checkNotNull(organizationWithLogo, "organizationWithLogo"); + this.organizationWithLogo = organizationWithLogo; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadOrganizationLogoResponse other = (UploadOrganizationLogoResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationWithLogo, other.organizationWithLogo); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationWithLogo); + } + + @Override + public String toString() { + return Utils.toString(UploadOrganizationLogoResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationWithLogo", organizationWithLogo); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationWithLogo = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * An organization with a logo URL. + */ + public Builder organizationWithLogo(com.clerk.backend_api.models.components.OrganizationWithLogo organizationWithLogo) { + Utils.checkNotNull(organizationWithLogo, "organizationWithLogo"); + this.organizationWithLogo = Optional.ofNullable(organizationWithLogo); + return this; + } + + /** + * An organization with a logo URL. + */ + public Builder organizationWithLogo(Optional organizationWithLogo) { + Utils.checkNotNull(organizationWithLogo, "organizationWithLogo"); + this.organizationWithLogo = organizationWithLogo; + return this; + } + + public UploadOrganizationLogoResponse build() { + return new UploadOrganizationLogoResponse( + contentType, + statusCode, + rawResponse, + organizationWithLogo); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplatePathParamTemplateType.java b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplatePathParamTemplateType.java new file mode 100644 index 0000000..f73de42 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplatePathParamTemplateType.java @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** + * UpsertTemplatePathParamTemplateType - The type of template to update + */ +public enum UpsertTemplatePathParamTemplateType { + EMAIL("email"), + SMS("sms"); + + @JsonValue + private final String value; + + private UpsertTemplatePathParamTemplateType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequest.java new file mode 100644 index 0000000..509242d --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequest.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UpsertTemplateRequest { + + /** + * The type of template to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=template_type") + private UpsertTemplatePathParamTemplateType templateType; + + /** + * The slug of the template to update + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=slug") + private String slug; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public UpsertTemplateRequest( + UpsertTemplatePathParamTemplateType templateType, + String slug, + Optional requestBody) { + Utils.checkNotNull(templateType, "templateType"); + Utils.checkNotNull(slug, "slug"); + Utils.checkNotNull(requestBody, "requestBody"); + this.templateType = templateType; + this.slug = slug; + this.requestBody = requestBody; + } + + public UpsertTemplateRequest( + UpsertTemplatePathParamTemplateType templateType, + String slug) { + this(templateType, slug, Optional.empty()); + } + + /** + * The type of template to update + */ + @JsonIgnore + public UpsertTemplatePathParamTemplateType templateType() { + return templateType; + } + + /** + * The slug of the template to update + */ + @JsonIgnore + public String slug() { + return slug; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The type of template to update + */ + public UpsertTemplateRequest withTemplateType(UpsertTemplatePathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug of the template to update + */ + public UpsertTemplateRequest withSlug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public UpsertTemplateRequest withRequestBody(UpsertTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public UpsertTemplateRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertTemplateRequest other = (UpsertTemplateRequest) o; + return + java.util.Objects.deepEquals(this.templateType, other.templateType) && + java.util.Objects.deepEquals(this.slug, other.slug) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + templateType, + slug, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(UpsertTemplateRequest.class, + "templateType", templateType, + "slug", slug, + "requestBody", requestBody); + } + + public final static class Builder { + + private UpsertTemplatePathParamTemplateType templateType; + + private String slug; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The type of template to update + */ + public Builder templateType(UpsertTemplatePathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + /** + * The slug of the template to update + */ + public Builder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public Builder requestBody(UpsertTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpsertTemplateRequest build() { + return new UpsertTemplateRequest( + templateType, + slug, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequestBody.java new file mode 100644 index 0000000..48531ab --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequestBody.java @@ -0,0 +1,526 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class UpsertTemplateRequestBody { + + /** + * The user-friendly name of the template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + /** + * The email subject. + * Applicable only to email templates. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subject") + private JsonNullable subject; + + /** + * The editor markup used to generate the body of the template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("markup") + private JsonNullable markup; + + /** + * The template body before variable interpolation + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("body") + private Optional body; + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("delivered_by_clerk") + private JsonNullable deliveredByClerk; + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("from_email_name") + private Optional fromEmailName; + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reply_to_email_name") + private Optional replyToEmailName; + + @JsonCreator + public UpsertTemplateRequestBody( + @JsonProperty("name") Optional name, + @JsonProperty("subject") JsonNullable subject, + @JsonProperty("markup") JsonNullable markup, + @JsonProperty("body") Optional body, + @JsonProperty("delivered_by_clerk") JsonNullable deliveredByClerk, + @JsonProperty("from_email_name") Optional fromEmailName, + @JsonProperty("reply_to_email_name") Optional replyToEmailName) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(subject, "subject"); + Utils.checkNotNull(markup, "markup"); + Utils.checkNotNull(body, "body"); + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + Utils.checkNotNull(fromEmailName, "fromEmailName"); + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.name = name; + this.subject = subject; + this.markup = markup; + this.body = body; + this.deliveredByClerk = deliveredByClerk; + this.fromEmailName = fromEmailName; + this.replyToEmailName = replyToEmailName; + } + + public UpsertTemplateRequestBody() { + this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), Optional.empty()); + } + + /** + * The user-friendly name of the template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional name() { + return (Optional) name; + } + + /** + * The email subject. + * Applicable only to email templates. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable subject() { + return (JsonNullable) subject; + } + + /** + * The editor markup used to generate the body of the template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable markup() { + return (JsonNullable) markup; + } + + /** + * The template body before variable interpolation + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional body() { + return (Optional) body; + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable deliveredByClerk() { + return (JsonNullable) deliveredByClerk; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional fromEmailName() { + return (Optional) fromEmailName; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional replyToEmailName() { + return (Optional) replyToEmailName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The user-friendly name of the template + */ + public UpsertTemplateRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The user-friendly name of the template + */ + public UpsertTemplateRequestBody withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The email subject. + * Applicable only to email templates. + */ + public UpsertTemplateRequestBody withSubject(String subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = JsonNullable.of(subject); + return this; + } + + /** + * The email subject. + * Applicable only to email templates. + */ + public UpsertTemplateRequestBody withSubject(JsonNullable subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = subject; + return this; + } + + /** + * The editor markup used to generate the body of the template + */ + public UpsertTemplateRequestBody withMarkup(String markup) { + Utils.checkNotNull(markup, "markup"); + this.markup = JsonNullable.of(markup); + return this; + } + + /** + * The editor markup used to generate the body of the template + */ + public UpsertTemplateRequestBody withMarkup(JsonNullable markup) { + Utils.checkNotNull(markup, "markup"); + this.markup = markup; + return this; + } + + /** + * The template body before variable interpolation + */ + public UpsertTemplateRequestBody withBody(String body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + /** + * The template body before variable interpolation + */ + public UpsertTemplateRequestBody withBody(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + public UpsertTemplateRequestBody withDeliveredByClerk(boolean deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = JsonNullable.of(deliveredByClerk); + return this; + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + public UpsertTemplateRequestBody withDeliveredByClerk(JsonNullable deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = deliveredByClerk; + return this; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public UpsertTemplateRequestBody withFromEmailName(String fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = Optional.ofNullable(fromEmailName); + return this; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public UpsertTemplateRequestBody withFromEmailName(Optional fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = fromEmailName; + return this; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public UpsertTemplateRequestBody withReplyToEmailName(String replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = Optional.ofNullable(replyToEmailName); + return this; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public UpsertTemplateRequestBody withReplyToEmailName(Optional replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = replyToEmailName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertTemplateRequestBody other = (UpsertTemplateRequestBody) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.subject, other.subject) && + java.util.Objects.deepEquals(this.markup, other.markup) && + java.util.Objects.deepEquals(this.body, other.body) && + java.util.Objects.deepEquals(this.deliveredByClerk, other.deliveredByClerk) && + java.util.Objects.deepEquals(this.fromEmailName, other.fromEmailName) && + java.util.Objects.deepEquals(this.replyToEmailName, other.replyToEmailName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + subject, + markup, + body, + deliveredByClerk, + fromEmailName, + replyToEmailName); + } + + @Override + public String toString() { + return Utils.toString(UpsertTemplateRequestBody.class, + "name", name, + "subject", subject, + "markup", markup, + "body", body, + "deliveredByClerk", deliveredByClerk, + "fromEmailName", fromEmailName, + "replyToEmailName", replyToEmailName); + } + + public final static class Builder { + + private Optional name = Optional.empty(); + + private JsonNullable subject = JsonNullable.undefined(); + + private JsonNullable markup = JsonNullable.undefined(); + + private Optional body = Optional.empty(); + + private JsonNullable deliveredByClerk = JsonNullable.undefined(); + + private Optional fromEmailName = Optional.empty(); + + private Optional replyToEmailName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The user-friendly name of the template + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The user-friendly name of the template + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The email subject. + * Applicable only to email templates. + */ + public Builder subject(String subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = JsonNullable.of(subject); + return this; + } + + /** + * The email subject. + * Applicable only to email templates. + */ + public Builder subject(JsonNullable subject) { + Utils.checkNotNull(subject, "subject"); + this.subject = subject; + return this; + } + + /** + * The editor markup used to generate the body of the template + */ + public Builder markup(String markup) { + Utils.checkNotNull(markup, "markup"); + this.markup = JsonNullable.of(markup); + return this; + } + + /** + * The editor markup used to generate the body of the template + */ + public Builder markup(JsonNullable markup) { + Utils.checkNotNull(markup, "markup"); + this.markup = markup; + return this; + } + + /** + * The template body before variable interpolation + */ + public Builder body(String body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + /** + * The template body before variable interpolation + */ + public Builder body(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + public Builder deliveredByClerk(boolean deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = JsonNullable.of(deliveredByClerk); + return this; + } + + /** + * Whether Clerk should deliver emails or SMS messages based on the current template + */ + public Builder deliveredByClerk(JsonNullable deliveredByClerk) { + Utils.checkNotNull(deliveredByClerk, "deliveredByClerk"); + this.deliveredByClerk = deliveredByClerk; + return this; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public Builder fromEmailName(String fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = Optional.ofNullable(fromEmailName); + return this; + } + + /** + * The local part of the From email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public Builder fromEmailName(Optional fromEmailName) { + Utils.checkNotNull(fromEmailName, "fromEmailName"); + this.fromEmailName = fromEmailName; + return this; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public Builder replyToEmailName(String replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = Optional.ofNullable(replyToEmailName); + return this; + } + + /** + * The local part of the Reply To email address that will be used for emails. + * For example, in the address 'hello@example.com', the local part is 'hello'. + * Applicable only to email templates. + */ + public Builder replyToEmailName(Optional replyToEmailName) { + Utils.checkNotNull(replyToEmailName, "replyToEmailName"); + this.replyToEmailName = replyToEmailName; + return this; + } + + public UpsertTemplateRequestBody build() { + return new UpsertTemplateRequestBody( + name, + subject, + markup, + body, + deliveredByClerk, + fromEmailName, + replyToEmailName); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequestBuilder.java new file mode 100644 index 0000000..599c84a --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateRequestBuilder.java @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UpsertTemplateRequestBuilder { + + private UpsertTemplatePathParamTemplateType templateType; + private String slug; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallUpsertTemplate sdk; + + public UpsertTemplateRequestBuilder(SDKMethodInterfaces.MethodCallUpsertTemplate sdk) { + this.sdk = sdk; + } + + public UpsertTemplateRequestBuilder templateType(UpsertTemplatePathParamTemplateType templateType) { + Utils.checkNotNull(templateType, "templateType"); + this.templateType = templateType; + return this; + } + + public UpsertTemplateRequestBuilder slug(String slug) { + Utils.checkNotNull(slug, "slug"); + this.slug = slug; + return this; + } + + public UpsertTemplateRequestBuilder requestBody(UpsertTemplateRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public UpsertTemplateRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public UpsertTemplateResponse call() throws Exception { + + return sdk.upsert( + templateType, + slug, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateResponse.java new file mode 100644 index 0000000..1e89df7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UpsertTemplateResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class UpsertTemplateResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional template; + + @JsonCreator + public UpsertTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional template) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(template, "template"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.template = template; + } + + public UpsertTemplateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional template() { + return (Optional) template; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UpsertTemplateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpsertTemplateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpsertTemplateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public UpsertTemplateResponse withTemplate(com.clerk.backend_api.models.components.Template template) { + Utils.checkNotNull(template, "template"); + this.template = Optional.ofNullable(template); + return this; + } + + /** + * Success + */ + public UpsertTemplateResponse withTemplate(Optional template) { + Utils.checkNotNull(template, "template"); + this.template = template; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertTemplateResponse other = (UpsertTemplateResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.template, other.template); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + template); + } + + @Override + public String toString() { + return Utils.toString(UpsertTemplateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "template", template); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional template = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder template(com.clerk.backend_api.models.components.Template template) { + Utils.checkNotNull(template, "template"); + this.template = Optional.ofNullable(template); + return this; + } + + /** + * Success + */ + public Builder template(Optional template) { + Utils.checkNotNull(template, "template"); + this.template = template; + return this; + } + + public UpsertTemplateResponse build() { + return new UpsertTemplateResponse( + contentType, + statusCode, + rawResponse, + template); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsRequest.java b/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsRequest.java new file mode 100644 index 0000000..38721f8 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsRequest.java @@ -0,0 +1,265 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class UsersGetOrganizationMembershipsRequest { + + /** + * The ID of the user whose organization memberships we want to retrieve + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + /** + * 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") + private Optional limit; + + /** + * 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") + private Optional offset; + + @JsonCreator + public UsersGetOrganizationMembershipsRequest( + String userId, + Optional limit, + Optional offset) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(offset, "offset"); + this.userId = userId; + this.limit = limit; + this.offset = offset; + } + + public UsersGetOrganizationMembershipsRequest( + String userId) { + this(userId, Optional.empty(), Optional.empty()); + } + + /** + * The ID of the user whose organization memberships we want to retrieve + */ + @JsonIgnore + public String userId() { + return userId; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional limit() { + return (Optional) limit; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional offset() { + return (Optional) offset; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user whose organization memberships we want to retrieve + */ + public UsersGetOrganizationMembershipsRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public UsersGetOrganizationMembershipsRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public UsersGetOrganizationMembershipsRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public UsersGetOrganizationMembershipsRequest withOffset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public UsersGetOrganizationMembershipsRequest withOffset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UsersGetOrganizationMembershipsRequest other = (UsersGetOrganizationMembershipsRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.limit, other.limit) && + java.util.Objects.deepEquals(this.offset, other.offset); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + limit, + offset); + } + + @Override + public String toString() { + return Utils.toString(UsersGetOrganizationMembershipsRequest.class, + "userId", userId, + "limit", limit, + "offset", offset); + } + + public final static class Builder { + + private String userId; + + private Optional limit; + + private Optional offset; + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user whose organization memberships we want to retrieve + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Applies a limit to the number of results returned. + * Can be used for paginating the results together with `offset`. + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.ofNullable(offset); + return this; + } + + /** + * Skip the first `offset` results when paginating. + * Needs to be an integer greater or equal to zero. + * To be used in conjunction with `limit`. + */ + public Builder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public UsersGetOrganizationMembershipsRequest build() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + return new UsersGetOrganizationMembershipsRequest( + userId, + limit, + offset); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsRequestBuilder.java new file mode 100644 index 0000000..ce726b1 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsRequestBuilder.java @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class UsersGetOrganizationMembershipsRequestBuilder { + + private String userId; + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "10", + new TypeReference>() {}); + private Optional offset = Utils.readDefaultOrConstValue( + "offset", + "0", + new TypeReference>() {}); + private final SDKMethodInterfaces.MethodCallUsersGetOrganizationMemberships sdk; + + public UsersGetOrganizationMembershipsRequestBuilder(SDKMethodInterfaces.MethodCallUsersGetOrganizationMemberships sdk) { + this.sdk = sdk; + } + + public UsersGetOrganizationMembershipsRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public UsersGetOrganizationMembershipsRequestBuilder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public UsersGetOrganizationMembershipsRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public UsersGetOrganizationMembershipsRequestBuilder offset(long offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = Optional.of(offset); + return this; + } + + public UsersGetOrganizationMembershipsRequestBuilder offset(Optional offset) { + Utils.checkNotNull(offset, "offset"); + this.offset = offset; + return this; + } + + public UsersGetOrganizationMembershipsResponse call() throws Exception { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + if (offset == null) { + offset = _SINGLETON_VALUE_Offset.value(); + } + + return sdk.getOrganizationMemberships( + userId, + limit, + offset); + } + + /** + * Returns a stream that performs next page calls till no more pages + * are returned. Unlike the {@link #call()} method this method will + * throw an {@link SDKError} if any page retrieval has an HTTP status + * code >= 300 (Note that 3XX is not an error range but will need + * special handling by the user if for example the HTTP client is + * not configured to follow redirects). + * + * @throws {@link SDKError} if HTTP status code >= 300 is encountered + **/ + public Stream callAsStream() { + return Utils.stream(() -> Optional.of(call()), x -> { + if (x.statusCode() >= 300) { + byte[] body = Utils.toByteArrayAndClose(x.rawResponse().body()); + throw new SDKError(x.rawResponse(), x.statusCode(), x.contentType(), body); + } else { + return x.next(); + } + }); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "10", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Offset = + new LazySingletonValue<>( + "offset", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsResponse.java b/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsResponse.java new file mode 100644 index 0000000..94753a5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/UsersGetOrganizationMembershipsResponse.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.Callable; + +public class UsersGetOrganizationMembershipsResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A list of organization memberships + */ + private Optional organizationMemberships; + + private Callable> next = () -> Optional.empty(); + + @JsonCreator + public UsersGetOrganizationMembershipsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional organizationMemberships) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.organizationMemberships = organizationMemberships; + } + + public UsersGetOrganizationMembershipsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A list of organization memberships + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional organizationMemberships() { + return (Optional) organizationMemberships; + } + + public Optional next() throws Exception { + return this.next.call(); + } + + // internal use only + private UsersGetOrganizationMembershipsResponse withNext(Callable> next) { + this.next = next; + return this; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UsersGetOrganizationMembershipsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UsersGetOrganizationMembershipsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UsersGetOrganizationMembershipsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization memberships + */ + public UsersGetOrganizationMembershipsResponse withOrganizationMemberships(com.clerk.backend_api.models.components.OrganizationMemberships organizationMemberships) { + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.organizationMemberships = Optional.ofNullable(organizationMemberships); + return this; + } + + /** + * A list of organization memberships + */ + public UsersGetOrganizationMembershipsResponse withOrganizationMemberships(Optional organizationMemberships) { + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.organizationMemberships = organizationMemberships; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UsersGetOrganizationMembershipsResponse other = (UsersGetOrganizationMembershipsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.organizationMemberships, other.organizationMemberships); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + organizationMemberships); + } + + @Override + public String toString() { + return Utils.toString(UsersGetOrganizationMembershipsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "organizationMemberships", organizationMemberships); + } + + public final static class Builder { + private Callable> next; + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional organizationMemberships = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A list of organization memberships + */ + public Builder organizationMemberships(com.clerk.backend_api.models.components.OrganizationMemberships organizationMemberships) { + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.organizationMemberships = Optional.ofNullable(organizationMemberships); + return this; + } + + /** + * A list of organization memberships + */ + public Builder organizationMemberships(Optional organizationMemberships) { + Utils.checkNotNull(organizationMemberships, "organizationMemberships"); + this.organizationMemberships = organizationMemberships; + return this; + } + + /** + * Internal API. Not for public use. Sets the provider of the next page. + * + * @deprecated not part of the public API, may be removed without notice + */ + @Deprecated + public Builder next(Callable> next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public UsersGetOrganizationMembershipsResponse build() { + return new UsersGetOrganizationMembershipsResponse( + contentType, + statusCode, + rawResponse, + organizationMemberships) + .withNext(next); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyClientRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyClientRequestBody.java new file mode 100644 index 0000000..9268801 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyClientRequestBody.java @@ -0,0 +1,132 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * VerifyClientRequestBody - Parameters. + */ + +public class VerifyClientRequestBody { + + /** + * A JWT Token that represents the active client. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("token") + private Optional token; + + @JsonCreator + public VerifyClientRequestBody( + @JsonProperty("token") Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + } + + public VerifyClientRequestBody() { + this(Optional.empty()); + } + + /** + * A JWT Token that represents the active client. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional token() { + return (Optional) token; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A JWT Token that represents the active client. + */ + public VerifyClientRequestBody withToken(String token) { + Utils.checkNotNull(token, "token"); + this.token = Optional.ofNullable(token); + return this; + } + + /** + * A JWT Token that represents the active client. + */ + public VerifyClientRequestBody withToken(Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyClientRequestBody other = (VerifyClientRequestBody) o; + return + java.util.Objects.deepEquals(this.token, other.token); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + token); + } + + @Override + public String toString() { + return Utils.toString(VerifyClientRequestBody.class, + "token", token); + } + + public final static class Builder { + + private Optional token = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A JWT Token that represents the active client. + */ + public Builder token(String token) { + Utils.checkNotNull(token, "token"); + this.token = Optional.ofNullable(token); + return this; + } + + /** + * A JWT Token that represents the active client. + */ + public Builder token(Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + public VerifyClientRequestBody build() { + return new VerifyClientRequestBody( + token); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyClientRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyClientRequestBuilder.java new file mode 100644 index 0000000..bdadf11 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyClientRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class VerifyClientRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallVerifyClient sdk; + + public VerifyClientRequestBuilder(SDKMethodInterfaces.MethodCallVerifyClient sdk) { + this.sdk = sdk; + } + + public VerifyClientRequestBuilder request(VerifyClientRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public VerifyClientRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public VerifyClientResponse call() throws Exception { + + return sdk.verify( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyClientResponse.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyClientResponse.java new file mode 100644 index 0000000..9b02127 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyClientResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class VerifyClientResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional client; + + @JsonCreator + public VerifyClientResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional client) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(client, "client"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.client = client; + } + + public VerifyClientResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional client() { + return (Optional) client; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public VerifyClientResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public VerifyClientResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public VerifyClientResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public VerifyClientResponse withClient(com.clerk.backend_api.models.components.Client client) { + Utils.checkNotNull(client, "client"); + this.client = Optional.ofNullable(client); + return this; + } + + /** + * Success + */ + public VerifyClientResponse withClient(Optional client) { + Utils.checkNotNull(client, "client"); + this.client = client; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyClientResponse other = (VerifyClientResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.client, other.client); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + client); + } + + @Override + public String toString() { + return Utils.toString(VerifyClientResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "client", client); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional client = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder client(com.clerk.backend_api.models.components.Client client) { + Utils.checkNotNull(client, "client"); + this.client = Optional.ofNullable(client); + return this; + } + + /** + * Success + */ + public Builder client(Optional client) { + Utils.checkNotNull(client, "client"); + this.client = client; + return this; + } + + public VerifyClientResponse build() { + return new VerifyClientResponse( + contentType, + statusCode, + rawResponse, + client); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyRequestBody.java new file mode 100644 index 0000000..244704f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyRequestBody.java @@ -0,0 +1,190 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class VerifyDomainProxyRequestBody { + + /** + * The ID of the domain that will be updated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("domain_id") + private Optional domainId; + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. e.g. https://example.com/__clerk + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("proxy_url") + private Optional proxyUrl; + + @JsonCreator + public VerifyDomainProxyRequestBody( + @JsonProperty("domain_id") Optional domainId, + @JsonProperty("proxy_url") Optional proxyUrl) { + Utils.checkNotNull(domainId, "domainId"); + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.domainId = domainId; + this.proxyUrl = proxyUrl; + } + + public VerifyDomainProxyRequestBody() { + this(Optional.empty(), Optional.empty()); + } + + /** + * The ID of the domain that will be updated. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional domainId() { + return (Optional) domainId; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. e.g. https://example.com/__clerk + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional proxyUrl() { + return (Optional) proxyUrl; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the domain that will be updated. + */ + public VerifyDomainProxyRequestBody withDomainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = Optional.ofNullable(domainId); + return this; + } + + /** + * The ID of the domain that will be updated. + */ + public VerifyDomainProxyRequestBody withDomainId(Optional domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. e.g. https://example.com/__clerk + */ + public VerifyDomainProxyRequestBody withProxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = Optional.ofNullable(proxyUrl); + return this; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. e.g. https://example.com/__clerk + */ + public VerifyDomainProxyRequestBody withProxyUrl(Optional proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyDomainProxyRequestBody other = (VerifyDomainProxyRequestBody) o; + return + java.util.Objects.deepEquals(this.domainId, other.domainId) && + java.util.Objects.deepEquals(this.proxyUrl, other.proxyUrl); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + domainId, + proxyUrl); + } + + @Override + public String toString() { + return Utils.toString(VerifyDomainProxyRequestBody.class, + "domainId", domainId, + "proxyUrl", proxyUrl); + } + + public final static class Builder { + + private Optional domainId = Optional.empty(); + + private Optional proxyUrl = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the domain that will be updated. + */ + public Builder domainId(String domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = Optional.ofNullable(domainId); + return this; + } + + /** + * The ID of the domain that will be updated. + */ + public Builder domainId(Optional domainId) { + Utils.checkNotNull(domainId, "domainId"); + this.domainId = domainId; + return this; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. e.g. https://example.com/__clerk + */ + public Builder proxyUrl(String proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = Optional.ofNullable(proxyUrl); + return this; + } + + /** + * The full URL of the proxy which will forward requests to the Clerk Frontend API for this domain. e.g. https://example.com/__clerk + */ + public Builder proxyUrl(Optional proxyUrl) { + Utils.checkNotNull(proxyUrl, "proxyUrl"); + this.proxyUrl = proxyUrl; + return this; + } + + public VerifyDomainProxyRequestBody build() { + return new VerifyDomainProxyRequestBody( + domainId, + proxyUrl); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyRequestBuilder.java new file mode 100644 index 0000000..169f135 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyRequestBuilder.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class VerifyDomainProxyRequestBuilder { + + private Optional request = Optional.empty(); + private final SDKMethodInterfaces.MethodCallVerifyDomainProxy sdk; + + public VerifyDomainProxyRequestBuilder(SDKMethodInterfaces.MethodCallVerifyDomainProxy sdk) { + this.sdk = sdk; + } + + public VerifyDomainProxyRequestBuilder request(VerifyDomainProxyRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public VerifyDomainProxyRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public VerifyDomainProxyResponse call() throws Exception { + + return sdk.verifyDomain( + request); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyResponse.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyResponse.java new file mode 100644 index 0000000..1ccb54c --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyDomainProxyResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class VerifyDomainProxyResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Health check information about a domain's proxy configuration validation attempt. + */ + private Optional proxyCheck; + + @JsonCreator + public VerifyDomainProxyResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional proxyCheck) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(proxyCheck, "proxyCheck"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.proxyCheck = proxyCheck; + } + + public VerifyDomainProxyResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Health check information about a domain's proxy configuration validation attempt. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional proxyCheck() { + return (Optional) proxyCheck; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public VerifyDomainProxyResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public VerifyDomainProxyResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public VerifyDomainProxyResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Health check information about a domain's proxy configuration validation attempt. + */ + public VerifyDomainProxyResponse withProxyCheck(com.clerk.backend_api.models.components.ProxyCheck proxyCheck) { + Utils.checkNotNull(proxyCheck, "proxyCheck"); + this.proxyCheck = Optional.ofNullable(proxyCheck); + return this; + } + + /** + * Health check information about a domain's proxy configuration validation attempt. + */ + public VerifyDomainProxyResponse withProxyCheck(Optional proxyCheck) { + Utils.checkNotNull(proxyCheck, "proxyCheck"); + this.proxyCheck = proxyCheck; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyDomainProxyResponse other = (VerifyDomainProxyResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.proxyCheck, other.proxyCheck); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + proxyCheck); + } + + @Override + public String toString() { + return Utils.toString(VerifyDomainProxyResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "proxyCheck", proxyCheck); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional proxyCheck = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Health check information about a domain's proxy configuration validation attempt. + */ + public Builder proxyCheck(com.clerk.backend_api.models.components.ProxyCheck proxyCheck) { + Utils.checkNotNull(proxyCheck, "proxyCheck"); + this.proxyCheck = Optional.ofNullable(proxyCheck); + return this; + } + + /** + * Health check information about a domain's proxy configuration validation attempt. + */ + public Builder proxyCheck(Optional proxyCheck) { + Utils.checkNotNull(proxyCheck, "proxyCheck"); + this.proxyCheck = proxyCheck; + return this; + } + + public VerifyDomainProxyResponse build() { + return new VerifyDomainProxyResponse( + contentType, + statusCode, + rawResponse, + proxyCheck); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequest.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequest.java new file mode 100644 index 0000000..f77af38 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequest.java @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class VerifyPasswordRequest { + + /** + * The ID of the user for whom to verify the password + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public VerifyPasswordRequest( + String userId, + Optional requestBody) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.userId = userId; + this.requestBody = requestBody; + } + + public VerifyPasswordRequest( + String userId) { + this(userId, Optional.empty()); + } + + /** + * The ID of the user for whom to verify the password + */ + @JsonIgnore + public String userId() { + return userId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user for whom to verify the password + */ + public VerifyPasswordRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public VerifyPasswordRequest withRequestBody(VerifyPasswordRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public VerifyPasswordRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyPasswordRequest other = (VerifyPasswordRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(VerifyPasswordRequest.class, + "userId", userId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String userId; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user for whom to verify the password + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder requestBody(VerifyPasswordRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public VerifyPasswordRequest build() { + return new VerifyPasswordRequest( + userId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequestBody.java new file mode 100644 index 0000000..a534895 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequestBody.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class VerifyPasswordRequestBody { + + /** + * The user password to verify + */ + @JsonProperty("password") + private String password; + + @JsonCreator + public VerifyPasswordRequestBody( + @JsonProperty("password") String password) { + Utils.checkNotNull(password, "password"); + this.password = password; + } + + /** + * The user password to verify + */ + @JsonIgnore + public String password() { + return password; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The user password to verify + */ + public VerifyPasswordRequestBody withPassword(String password) { + Utils.checkNotNull(password, "password"); + this.password = password; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyPasswordRequestBody other = (VerifyPasswordRequestBody) o; + return + java.util.Objects.deepEquals(this.password, other.password); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + password); + } + + @Override + public String toString() { + return Utils.toString(VerifyPasswordRequestBody.class, + "password", password); + } + + public final static class Builder { + + private String password; + + private Builder() { + // force use of static builder() method + } + + /** + * The user password to verify + */ + public Builder password(String password) { + Utils.checkNotNull(password, "password"); + this.password = password; + return this; + } + + public VerifyPasswordRequestBody build() { + return new VerifyPasswordRequestBody( + password); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequestBuilder.java new file mode 100644 index 0000000..f28296f --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class VerifyPasswordRequestBuilder { + + private String userId; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallVerifyPassword sdk; + + public VerifyPasswordRequestBuilder(SDKMethodInterfaces.MethodCallVerifyPassword sdk) { + this.sdk = sdk; + } + + public VerifyPasswordRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public VerifyPasswordRequestBuilder requestBody(VerifyPasswordRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public VerifyPasswordRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public VerifyPasswordResponse call() throws Exception { + + return sdk.verifyPassword( + userId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordResponse.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordResponse.java new file mode 100644 index 0000000..32de772 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class VerifyPasswordResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The provided password was correct. + */ + private Optional object; + + @JsonCreator + public VerifyPasswordResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public VerifyPasswordResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The provided password was correct. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public VerifyPasswordResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public VerifyPasswordResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public VerifyPasswordResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The provided password was correct. + */ + public VerifyPasswordResponse withObject(VerifyPasswordResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The provided password was correct. + */ + public VerifyPasswordResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyPasswordResponse other = (VerifyPasswordResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(VerifyPasswordResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The provided password was correct. + */ + public Builder object(VerifyPasswordResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The provided password was correct. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public VerifyPasswordResponse build() { + return new VerifyPasswordResponse( + contentType, + statusCode, + rawResponse, + object); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordResponseBody.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordResponseBody.java new file mode 100644 index 0000000..d539635 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyPasswordResponseBody.java @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * VerifyPasswordResponseBody - The provided password was correct. + */ + +public class VerifyPasswordResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("verified") + private Optional verified; + + @JsonCreator + public VerifyPasswordResponseBody( + @JsonProperty("verified") Optional verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + } + + public VerifyPasswordResponseBody() { + this(Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional verified() { + return (Optional) verified; + } + + public final static Builder builder() { + return new Builder(); + } + + public VerifyPasswordResponseBody withVerified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = Optional.ofNullable(verified); + return this; + } + + public VerifyPasswordResponseBody withVerified(Optional verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyPasswordResponseBody other = (VerifyPasswordResponseBody) o; + return + java.util.Objects.deepEquals(this.verified, other.verified); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + verified); + } + + @Override + public String toString() { + return Utils.toString(VerifyPasswordResponseBody.class, + "verified", verified); + } + + public final static class Builder { + + private Optional verified = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder verified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = Optional.ofNullable(verified); + return this; + } + + public Builder verified(Optional verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + public VerifyPasswordResponseBody build() { + return new VerifyPasswordResponseBody( + verified); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequest.java b/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequest.java new file mode 100644 index 0000000..a3b4081 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequest.java @@ -0,0 +1,168 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class VerifySessionRequest { + + /** + * The ID of the session + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=session_id") + private String sessionId; + + /** + * Parameters. + */ + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public VerifySessionRequest( + String sessionId, + Optional requestBody) { + Utils.checkNotNull(sessionId, "sessionId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.sessionId = sessionId; + this.requestBody = requestBody; + } + + public VerifySessionRequest( + String sessionId) { + this(sessionId, Optional.empty()); + } + + /** + * The ID of the session + */ + @JsonIgnore + public String sessionId() { + return sessionId; + } + + /** + * Parameters. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the session + */ + public VerifySessionRequest withSessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + /** + * Parameters. + */ + public VerifySessionRequest withRequestBody(VerifySessionRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + /** + * Parameters. + */ + public VerifySessionRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifySessionRequest other = (VerifySessionRequest) o; + return + java.util.Objects.deepEquals(this.sessionId, other.sessionId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + sessionId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(VerifySessionRequest.class, + "sessionId", sessionId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String sessionId; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the session + */ + public Builder sessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + /** + * Parameters. + */ + public Builder requestBody(VerifySessionRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + /** + * Parameters. + */ + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public VerifySessionRequest build() { + return new VerifySessionRequest( + sessionId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequestBody.java new file mode 100644 index 0000000..f765534 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequestBody.java @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * VerifySessionRequestBody - Parameters. + */ + +public class VerifySessionRequestBody { + + /** + * The JWT that is sent via the `__session` cookie from your frontend. + * Note: this JWT must be associated with the supplied session ID. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("token") + private Optional token; + + @JsonCreator + public VerifySessionRequestBody( + @JsonProperty("token") Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + } + + public VerifySessionRequestBody() { + this(Optional.empty()); + } + + /** + * The JWT that is sent via the `__session` cookie from your frontend. + * Note: this JWT must be associated with the supplied session ID. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional token() { + return (Optional) token; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The JWT that is sent via the `__session` cookie from your frontend. + * Note: this JWT must be associated with the supplied session ID. + */ + public VerifySessionRequestBody withToken(String token) { + Utils.checkNotNull(token, "token"); + this.token = Optional.ofNullable(token); + return this; + } + + /** + * The JWT that is sent via the `__session` cookie from your frontend. + * Note: this JWT must be associated with the supplied session ID. + */ + public VerifySessionRequestBody withToken(Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifySessionRequestBody other = (VerifySessionRequestBody) o; + return + java.util.Objects.deepEquals(this.token, other.token); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + token); + } + + @Override + public String toString() { + return Utils.toString(VerifySessionRequestBody.class, + "token", token); + } + + public final static class Builder { + + private Optional token = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The JWT that is sent via the `__session` cookie from your frontend. + * Note: this JWT must be associated with the supplied session ID. + */ + public Builder token(String token) { + Utils.checkNotNull(token, "token"); + this.token = Optional.ofNullable(token); + return this; + } + + /** + * The JWT that is sent via the `__session` cookie from your frontend. + * Note: this JWT must be associated with the supplied session ID. + */ + public Builder token(Optional token) { + Utils.checkNotNull(token, "token"); + this.token = token; + return this; + } + + public VerifySessionRequestBody build() { + return new VerifySessionRequestBody( + token); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequestBuilder.java new file mode 100644 index 0000000..9f99bea --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifySessionRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class VerifySessionRequestBuilder { + + private String sessionId; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallVerifySession sdk; + + public VerifySessionRequestBuilder(SDKMethodInterfaces.MethodCallVerifySession sdk) { + this.sdk = sdk; + } + + public VerifySessionRequestBuilder sessionId(String sessionId) { + Utils.checkNotNull(sessionId, "sessionId"); + this.sessionId = sessionId; + return this; + } + + public VerifySessionRequestBuilder requestBody(VerifySessionRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public VerifySessionRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public VerifySessionResponse call() throws Exception { + + return sdk.verify( + sessionId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifySessionResponse.java b/src/main/java/com/clerk/backend_api/models/operations/VerifySessionResponse.java new file mode 100644 index 0000000..ac4eff0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifySessionResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class VerifySessionResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Success + */ + private Optional session; + + @JsonCreator + public VerifySessionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional session) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(session, "session"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.session = session; + } + + public VerifySessionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional session() { + return (Optional) session; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public VerifySessionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public VerifySessionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public VerifySessionResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public VerifySessionResponse withSession(com.clerk.backend_api.models.components.Session session) { + Utils.checkNotNull(session, "session"); + this.session = Optional.ofNullable(session); + return this; + } + + /** + * Success + */ + public VerifySessionResponse withSession(Optional session) { + Utils.checkNotNull(session, "session"); + this.session = session; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifySessionResponse other = (VerifySessionResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.session, other.session); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + session); + } + + @Override + public String toString() { + return Utils.toString(VerifySessionResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "session", session); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional session = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Success + */ + public Builder session(com.clerk.backend_api.models.components.Session session) { + Utils.checkNotNull(session, "session"); + this.session = Optional.ofNullable(session); + return this; + } + + /** + * Success + */ + public Builder session(Optional session) { + Utils.checkNotNull(session, "session"); + this.session = session; + return this; + } + + public VerifySessionResponse build() { + return new VerifySessionResponse( + contentType, + statusCode, + rawResponse, + session); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequest.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequest.java new file mode 100644 index 0000000..2975e34 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequest.java @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.SpeakeasyMetadata; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; + +public class VerifyTOTPRequest { + + /** + * The ID of the user for whom to verify the TOTP + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=user_id") + private String userId; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + @JsonCreator + public VerifyTOTPRequest( + String userId, + Optional requestBody) { + Utils.checkNotNull(userId, "userId"); + Utils.checkNotNull(requestBody, "requestBody"); + this.userId = userId; + this.requestBody = requestBody; + } + + public VerifyTOTPRequest( + String userId) { + this(userId, Optional.empty()); + } + + /** + * The ID of the user for whom to verify the TOTP + */ + @JsonIgnore + public String userId() { + return userId; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The ID of the user for whom to verify the TOTP + */ + public VerifyTOTPRequest withUserId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public VerifyTOTPRequest withRequestBody(VerifyTOTPRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public VerifyTOTPRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyTOTPRequest other = (VerifyTOTPRequest) o; + return + java.util.Objects.deepEquals(this.userId, other.userId) && + java.util.Objects.deepEquals(this.requestBody, other.requestBody); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + userId, + requestBody); + } + + @Override + public String toString() { + return Utils.toString(VerifyTOTPRequest.class, + "userId", userId, + "requestBody", requestBody); + } + + public final static class Builder { + + private String userId; + + private Optional requestBody = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The ID of the user for whom to verify the TOTP + */ + public Builder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public Builder requestBody(VerifyTOTPRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public VerifyTOTPRequest build() { + return new VerifyTOTPRequest( + userId, + requestBody); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequestBody.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequestBody.java new file mode 100644 index 0000000..36fd3c9 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequestBody.java @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; + +public class VerifyTOTPRequestBody { + + /** + * The TOTP or backup code to verify + */ + @JsonProperty("code") + private String code; + + @JsonCreator + public VerifyTOTPRequestBody( + @JsonProperty("code") String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + } + + /** + * The TOTP or backup code to verify + */ + @JsonIgnore + public String code() { + return code; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The TOTP or backup code to verify + */ + public VerifyTOTPRequestBody withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyTOTPRequestBody other = (VerifyTOTPRequestBody) o; + return + java.util.Objects.deepEquals(this.code, other.code); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + code); + } + + @Override + public String toString() { + return Utils.toString(VerifyTOTPRequestBody.class, + "code", code); + } + + public final static class Builder { + + private String code; + + private Builder() { + // force use of static builder() method + } + + /** + * The TOTP or backup code to verify + */ + public Builder code(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public VerifyTOTPRequestBody build() { + return new VerifyTOTPRequestBody( + code); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequestBuilder.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequestBuilder.java new file mode 100644 index 0000000..46b91c7 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPRequestBuilder.java @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.models.errors.SDKError; +import com.clerk.backend_api.utils.LazySingletonValue; +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import java.util.stream.Stream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class VerifyTOTPRequestBuilder { + + private String userId; + private Optional requestBody = Optional.empty(); + private final SDKMethodInterfaces.MethodCallVerifyTOTP sdk; + + public VerifyTOTPRequestBuilder(SDKMethodInterfaces.MethodCallVerifyTOTP sdk) { + this.sdk = sdk; + } + + public VerifyTOTPRequestBuilder userId(String userId) { + Utils.checkNotNull(userId, "userId"); + this.userId = userId; + return this; + } + + public VerifyTOTPRequestBuilder requestBody(VerifyTOTPRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public VerifyTOTPRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + public VerifyTOTPResponse call() throws Exception { + + return sdk.verifyTOTP( + userId, + requestBody); + } +} diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPResponse.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPResponse.java new file mode 100644 index 0000000..f8e5851 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPResponse.java @@ -0,0 +1,248 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.http.HttpResponse; +import java.util.Optional; + +public class VerifyTOTPResponse implements com.clerk.backend_api.utils.Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The provided TOTP or backup code was correct. + */ + private Optional object; + + @JsonCreator + public VerifyTOTPResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public VerifyTOTPResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The provided TOTP or backup code was correct. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public VerifyTOTPResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public VerifyTOTPResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public VerifyTOTPResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The provided TOTP or backup code was correct. + */ + public VerifyTOTPResponse withObject(VerifyTOTPResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The provided TOTP or backup code was correct. + */ + public VerifyTOTPResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyTOTPResponse other = (VerifyTOTPResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(VerifyTOTPResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The provided TOTP or backup code was correct. + */ + public Builder object(VerifyTOTPResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The provided TOTP or backup code was correct. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public VerifyTOTPResponse build() { + return new VerifyTOTPResponse( + contentType, + statusCode, + rawResponse, + object); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPResponseBody.java b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPResponseBody.java new file mode 100644 index 0000000..0b479ae --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/operations/VerifyTOTPResponseBody.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.operations; + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.InputStream; +import java.lang.Deprecated; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Optional; +/** + * VerifyTOTPResponseBody - The provided TOTP or backup code was correct. + */ + +public class VerifyTOTPResponseBody { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("verified") + private Optional verified; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code_type") + private Optional codeType; + + @JsonCreator + public VerifyTOTPResponseBody( + @JsonProperty("verified") Optional verified, + @JsonProperty("code_type") Optional codeType) { + Utils.checkNotNull(verified, "verified"); + Utils.checkNotNull(codeType, "codeType"); + this.verified = verified; + this.codeType = codeType; + } + + public VerifyTOTPResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional verified() { + return (Optional) verified; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional codeType() { + return (Optional) codeType; + } + + public final static Builder builder() { + return new Builder(); + } + + public VerifyTOTPResponseBody withVerified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = Optional.ofNullable(verified); + return this; + } + + public VerifyTOTPResponseBody withVerified(Optional verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + public VerifyTOTPResponseBody withCodeType(CodeType codeType) { + Utils.checkNotNull(codeType, "codeType"); + this.codeType = Optional.ofNullable(codeType); + return this; + } + + public VerifyTOTPResponseBody withCodeType(Optional codeType) { + Utils.checkNotNull(codeType, "codeType"); + this.codeType = codeType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyTOTPResponseBody other = (VerifyTOTPResponseBody) o; + return + java.util.Objects.deepEquals(this.verified, other.verified) && + java.util.Objects.deepEquals(this.codeType, other.codeType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + verified, + codeType); + } + + @Override + public String toString() { + return Utils.toString(VerifyTOTPResponseBody.class, + "verified", verified, + "codeType", codeType); + } + + public final static class Builder { + + private Optional verified = Optional.empty(); + + private Optional codeType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder verified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = Optional.ofNullable(verified); + return this; + } + + public Builder verified(Optional verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + public Builder codeType(CodeType codeType) { + Utils.checkNotNull(codeType, "codeType"); + this.codeType = Optional.ofNullable(codeType); + return this; + } + + public Builder codeType(Optional codeType) { + Utils.checkNotNull(codeType, "codeType"); + this.codeType = codeType; + return this; + } + + public VerifyTOTPResponseBody build() { + return new VerifyTOTPResponseBody( + verified, + codeType); + } + } +} + diff --git a/src/main/java/com/clerk/backend_api/utils/BackoffStrategy.java b/src/main/java/com/clerk/backend_api/utils/BackoffStrategy.java new file mode 100644 index 0000000..057b972 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/BackoffStrategy.java @@ -0,0 +1,251 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.util.concurrent.TimeUnit; +import com.clerk.backend_api.utils.Utils; + +/** + * Exponential Backoff Strategy with Jitter + * + * The duration between consecutive attempts is calculated as follows: + * intervalMs = min(maxIntervalMs, initialIntervalMs*(baseFactor^attempts) +/- r) + * where baseFactor is the base factor and r a random value between 0 and jitterFactor*intervalMs. + */ +public class BackoffStrategy { + + private static final long DEFAULT_INITIAL_INTERVAL_MS = 500L; + private static final long DEFAULT_MAX_INTERVAL_MS = 60000L; + private static final long DEFAULT_MAX_ELAPSED_TIME_MS = 3600000L; + private static final double DEFAULT_EXPONENT = 1.5; + private static final double DEFAULT_JITTER_FACTOR = 0.5; + private static final boolean DEFAULT_RETRY_CONNECT_ERROR = false; + private static final boolean DEFAULT_RETRY_READ_TIMEOUT_ERROR = false; + + private final long initialIntervalMs; + private final long maxIntervalMs; + private final long maxElapsedTimeMs; + private final double baseFactor; + private final double jitterFactor; + private final boolean retryConnectError; + private final boolean retryReadTimeoutError; + + private BackoffStrategy(long initialIntervalMs, + long maxIntervalMs, + long maxElapsedTimeMs, + double baseFactor, + double jitterFactor, + boolean retryConnectError, + boolean retryReadTimeoutError) { + this.initialIntervalMs = initialIntervalMs; + this.maxIntervalMs = maxIntervalMs; + this.maxElapsedTimeMs = maxElapsedTimeMs; + this.baseFactor = baseFactor; + this.jitterFactor = jitterFactor; + this.retryConnectError = retryConnectError; + this.retryReadTimeoutError = retryReadTimeoutError; + } + + public static BackoffStrategy withDefaults() { + return BackoffStrategy.builder().build(); + } + + public long initialIntervalMs() { + return initialIntervalMs; + } + + public long maxIntervalMs() { + return maxIntervalMs; + } + + public double baseFactor() { + return baseFactor; + } + + /** + * @deprecated use baseFactor instead. + */ + @Deprecated + public double exponent() { + return baseFactor; + } + + public long maxElapsedTimeMs() { + return maxElapsedTimeMs; + } + + public double jitterFactor() { + return jitterFactor; + } + + public boolean retryConnectError() { + return retryConnectError; + } + + public boolean retryReadTimeoutError() { + return retryReadTimeoutError; + } + + public final static Builder builder() { + return new Builder(); + } + + public final static class Builder { + + private long initialIntervalMs = DEFAULT_INITIAL_INTERVAL_MS; + private long maxIntervalMs = DEFAULT_MAX_INTERVAL_MS; + private long maxElapsedTimeMs = DEFAULT_MAX_ELAPSED_TIME_MS; + private double baseFactor = DEFAULT_EXPONENT; + private double jitterFactor = DEFAULT_JITTER_FACTOR; + private boolean retryConnectError = DEFAULT_RETRY_CONNECT_ERROR; + private boolean retryReadTimeoutError = DEFAULT_RETRY_READ_TIMEOUT_ERROR; + + private Builder() {} + + /** + * Sets the initial interval + * + * @param duration The initial interval. + * @param unit The time unit associated with duration. + * @return The builder instance. + */ + public Builder initialInterval(long duration, TimeUnit unit) { + Utils.checkNotNull(unit, "unit"); + if (duration < 0) { + throw new IllegalArgumentException("initialInterval must be positive"); + } + this.initialIntervalMs = unit.toMillis(duration); + return this; + } + + /** + * Sets the maximum interval + * + * @param duration The maximum interval. + * @param unit The time unit associated with duration. + * @return The builder instance. + */ + public Builder maxInterval(long duration, TimeUnit unit) { + Utils.checkNotNull(unit, "unit"); + if (duration <= 0) { + throw new IllegalArgumentException("maxInterval must be strictly positive"); + } + this.maxIntervalMs = unit.toMillis(duration); + return this; + } + + /** + * Sets the maximum elapsed time + * + * @param duration The maximum elapsed time. + * @param unit The time unit associated with duration. + * @return The builder instance. + */ + public Builder maxElapsedTime(long duration, TimeUnit unit) { + Utils.checkNotNull(unit, "unit"); + if (duration < 0) { + throw new IllegalArgumentException("maxElapsedTime must be positive"); + } + this.maxElapsedTimeMs = unit.toMillis(duration); + return this; + } + + /** + * Sets the backoff base factor. + * + * @param baseFactor The base factor to use. + * @return The builder instance. + */ + public Builder baseFactor(double baseFactor) { + if (baseFactor <= 0 ) { + throw new IllegalArgumentException("baseFactor must be strictly positive"); + } + this.baseFactor = baseFactor; + return this; + } + + /** + * Sets the backoff base factor. + * + * @deprecated use baseFactor instead. + * @param exponent The base factor to use. + * @return The builder instance. + */ + @Deprecated + public Builder exponent(double baseFactor) { + if (baseFactor <= 0 ) { + throw new IllegalArgumentException("baseFactor must be strictly positive"); + } + this.baseFactor = baseFactor; + return this; + } + + /** + * Sets the jitter factor used to randomize the backoff interval. + * + * @param jitterFactor The jitter factor to use (default is 0.5f). + * @return The builder instance. + */ + public Builder jitterFactor(double jitterFactor) { + if (jitterFactor < 0 || jitterFactor > 1) { + throw new IllegalArgumentException("jitterFactor must be between 0 and 1"); + } + this.jitterFactor = jitterFactor; + return this; + } + + /** + * Specifies whether connection errors should be retried. + * + * @param retry Whether to retry on connection error. + * @return The builder instance. + */ + public Builder retryConnectError(boolean retry) { + this.retryConnectError = retry; + return this; + } + + /** + * Do not retry on connection error. + * + * @return The builder instance. + */ + public Builder throwConnectError() { + this.retryConnectError = false; + return this; + } + + /** + * Specifies whether Read Timeout errors should be retried. + * + * @param retry Whether to retry on Read Timeout error. + * @return The builder instance. + */ + public Builder retryReadTimeoutError(boolean retry) { + this.retryReadTimeoutError = retry; + return this; + } + + /** + * Do not retry on Read Timeout error. + * + * @return The builder instance. + */ + public Builder throwReadTimeoutError() { + this.retryReadTimeoutError = false; + return this; + } + + public BackoffStrategy build() { + return new BackoffStrategy(initialIntervalMs, + maxIntervalMs, + maxElapsedTimeMs, + baseFactor, + jitterFactor, + retryConnectError, + retryReadTimeoutError); + } + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/BigDecimalString.java b/src/main/java/com/clerk/backend_api/utils/BigDecimalString.java new file mode 100644 index 0000000..785fdc2 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/BigDecimalString.java @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Objects; + +import com.fasterxml.jackson.core.JacksonException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +// Internal API only + +// Note that Jackson 2.16.1 does not support @JsonValue and @JsonFormat combined so we must use +// a custom serializer/deserializer + +@JsonSerialize(using = BigDecimalString.BigDecimalStringSerializer.class) +@JsonDeserialize(using = BigDecimalString.BigDecimalStringDeserializer.class) +public class BigDecimalString { + + private final BigDecimal value; + + public BigDecimalString(BigDecimal value) { + this.value = value; + } + + public BigDecimalString(String value) { + this(new BigDecimal(value)); + } + + public BigDecimal value() { + return value; + } + + @Override + public String toString() { + return value.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + BigDecimalString other = (BigDecimalString) obj; + return Objects.equals(value, other.value); + } + + public static final class BigDecimalStringSerializer extends StdSerializer { + + private static final long serialVersionUID = -3828937716095008071L; + + public BigDecimalStringSerializer() { + this(null); + } + + public BigDecimalStringSerializer(Class t) { + super(t); + } + + @Override + public void serialize(BigDecimalString value, JsonGenerator g, SerializerProvider provider) + throws IOException, JsonProcessingException { + g.writeString(value.value.toString()); + } + } + + public static final class BigDecimalStringDeserializer extends StdDeserializer { + + private static final long serialVersionUID = -2474225842945673085L; + + public BigDecimalStringDeserializer() { + this(null); + } + + public BigDecimalStringDeserializer(Class t) { + super(t); + } + + @Override + public BigDecimalString deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + String s = p.readValueAs(String.class); + return new BigDecimalString(new BigDecimal(s)); + } + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/BigIntegerString.java b/src/main/java/com/clerk/backend_api/utils/BigIntegerString.java new file mode 100644 index 0000000..6455924 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/BigIntegerString.java @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.IOException; +import java.math.BigInteger; +import java.util.Objects; + +import com.fasterxml.jackson.core.JacksonException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +// Internal API only + +// Note that Jackson 2.16.1 does not support @JsonValue and @JsonFormat combined so we must use +// a custom serializer/deserializer + +@JsonSerialize(using = BigIntegerString.BigIntegerStringSerializer.class) +@JsonDeserialize(using = BigIntegerString.BigIntegerStringDeserializer.class) +public class BigIntegerString { + + private final BigInteger value; + + public BigIntegerString(BigInteger value) { + this.value = value; + } + + public BigIntegerString(String value) { + this(new BigInteger(value)); + } + + public BigInteger value() { + return value; + } + + @Override + public String toString() { + return value.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + BigIntegerString other = (BigIntegerString) obj; + return Objects.equals(value, other.value); + } + + public static final class BigIntegerStringSerializer extends StdSerializer { + + private static final long serialVersionUID = -2474225842945673085L; + + public BigIntegerStringSerializer() { + this(null); + } + + public BigIntegerStringSerializer(Class t) { + super(t); + } + + @Override + public void serialize(BigIntegerString value, JsonGenerator g, SerializerProvider provider) + throws IOException, JsonProcessingException { + g.writeString(value.value.toString()); + } + } + + public static final class BigIntegerStringDeserializer extends StdDeserializer { + + private static final long serialVersionUID = -2474225842945673085L; + + public BigIntegerStringDeserializer() { + this(null); + } + + public BigIntegerStringDeserializer(Class t) { + super(t); + } + + @Override + public BigIntegerString deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + String s = p.readValueAs(String.class); + return new BigIntegerString(new BigInteger(s)); + } + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/Deserializers.java b/src/main/java/com/clerk/backend_api/utils/Deserializers.java new file mode 100644 index 0000000..ef8f3e0 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/Deserializers.java @@ -0,0 +1,241 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +import com.fasterxml.jackson.core.JacksonException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.Module; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.module.SimpleModule; + +public final class Deserializers { + + public static final JsonDeserializer BOOLEAN_STRICT = new StrictBooleanDeserializer(); + public static final JsonDeserializer INTEGER_STRICT = new StrictIntegerDeserializer(); + public static final JsonDeserializer LONG_STRICT = new StrictLongDeserializer(); + public static final JsonDeserializer SHORT_STRICT = new StrictShortDeserializer(); + public static final JsonDeserializer FLOAT_STRICT = new StrictFloatDeserializer(); + public static final JsonDeserializer DOUBLE_STRICT = new StrictDoubleDeserializer(); + public static final JsonDeserializer LOCAL_DATE_STRICT = new StrictLocalDateDeserializer(); + public static final JsonDeserializer OFFSET_DATE_TIME_STRICT = new StrictOffsetDateTimeDeserializer(); + public static final JsonDeserializer STRING_STRICT = new StrictStringDeserializer(); + + public static final Module STRICT_DESERIALIZERS = createStrictDeserializersModule(); + + private static Module createStrictDeserializersModule() { + SimpleModule m = new SimpleModule(); + m.addDeserializer(Boolean.class, Deserializers.BOOLEAN_STRICT); + m.addDeserializer(Short.class, Deserializers.SHORT_STRICT); + m.addDeserializer(Integer.class, Deserializers.INTEGER_STRICT); + m.addDeserializer(Long.class, Deserializers.LONG_STRICT); + m.addDeserializer(Float.class, Deserializers.FLOAT_STRICT); + m.addDeserializer(Double.class, Deserializers.DOUBLE_STRICT); + m.addDeserializer(OffsetDateTime.class, Deserializers.OFFSET_DATE_TIME_STRICT); + m.addDeserializer(LocalDate.class, Deserializers.LOCAL_DATE_STRICT); + m.addDeserializer(String.class, Deserializers.STRING_STRICT); + return m; + } + + private static final class StrictBooleanDeserializer extends StdDeserializer { + + private static final long serialVersionUID = 6014987192625841276L; + + StrictBooleanDeserializer() { + super(Boolean.class); + } + + @Override + public Boolean deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + JsonToken t = p.currentToken(); + if (t == JsonToken.VALUE_TRUE) { + return true; + } else if (t == JsonToken.VALUE_FALSE) { + return false; + } else { + return (Boolean) ctxt.handleUnexpectedToken(Boolean.class, p); + } + } + } + + private static final class StrictDoubleDeserializer extends StdDeserializer { + + private static final long serialVersionUID = 5500822592284739392L; + + StrictDoubleDeserializer() { + super(Double.class); + } + + @Override + public Double deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + JsonToken t = p.currentToken(); + if (t == JsonToken.VALUE_NUMBER_INT) { + return p.getDoubleValue(); + } else if (t == JsonToken.VALUE_NUMBER_FLOAT) { + return p.getDoubleValue(); + } else { + return (Double) ctxt.handleUnexpectedToken(Double.class, p); + } + } + } + + private static final class StrictFloatDeserializer extends StdDeserializer { + + private static final long serialVersionUID = 2207323065789635630L; + + StrictFloatDeserializer() { + super(Float.class); + } + + @Override + public Float deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + JsonToken t = p.currentToken(); + if (t == JsonToken.VALUE_NUMBER_INT) { + return p.getFloatValue(); + } else if (t == JsonToken.VALUE_NUMBER_FLOAT) { + return p.getFloatValue(); + } else { + return (Float) ctxt.handleUnexpectedToken(Float.class, p); + } + } + } + + private static final class StrictIntegerDeserializer extends StdDeserializer { + + private static final long serialVersionUID = 6079282945607228350L; + + StrictIntegerDeserializer() { + super(Integer.class); + } + + @Override + public Integer deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + JsonToken t = p.currentToken(); + if (t == JsonToken.VALUE_NUMBER_INT) { + return p.getIntValue(); + } else { + return (Integer) ctxt.handleUnexpectedToken(Integer.class, p); + } + } + } + + private static final class StrictLocalDateDeserializer extends StdDeserializer { + + private static final long serialVersionUID = 6014987192625841276L; + + StrictLocalDateDeserializer() { + super(LocalDate.class); + } + + @Override + public LocalDate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JacksonException { + if (p.currentToken() == JsonToken.VALUE_STRING) { + String text = p.getText(); + try { + return LocalDate.parse(text, DateTimeFormatter.ISO_LOCAL_DATE); + } catch (DateTimeParseException e) { + return (LocalDate) ctxt.handleWeirdStringValue(LocalDate.class, text, e.getMessage()); + } + } else { + return (LocalDate) ctxt.handleUnexpectedToken(LocalDate.class, p); + } + } + } + + private static final class StrictLongDeserializer extends StdDeserializer { + + private static final long serialVersionUID = -2721538755854421632L; + + public StrictLongDeserializer() { + super(Long.class); + } + + @Override + public Long deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + JsonToken t = p.currentToken(); + if (t == JsonToken.VALUE_NUMBER_INT) { + return p.getLongValue(); + } else { + return (Long) ctxt.handleUnexpectedToken(Long.class, p); + } + } + } + + private static final class StrictOffsetDateTimeDeserializer extends StdDeserializer { + + private static final long serialVersionUID = 6014987192625841276L; + + StrictOffsetDateTimeDeserializer() { + super(OffsetDateTime.class); + } + + @Override + public OffsetDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JacksonException { + if (p.currentToken() == JsonToken.VALUE_STRING) { + String text = p.getText(); + try { + return OffsetDateTime.parse(text, DateTimeFormatter.ISO_DATE_TIME); + } catch (DateTimeParseException e) { + return (OffsetDateTime) ctxt.handleWeirdStringValue(OffsetDateTime.class, text, e.getMessage()); + } + } else { + return (OffsetDateTime) ctxt.handleUnexpectedToken(OffsetDateTime.class, p); + } + } + } + + private static final class StrictShortDeserializer extends StdDeserializer { + + private static final long serialVersionUID = 2162877248512421L; + + StrictShortDeserializer() { + super(Short.class); + } + + @Override + public Short deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + JsonToken t = p.currentToken(); + if (t == JsonToken.VALUE_NUMBER_INT) { + return p.getShortValue(); + } else { + return (Short) ctxt.handleUnexpectedToken(Short.class, p); + } + } + } + + private static final class StrictStringDeserializer extends StdDeserializer { + + private static final long serialVersionUID = 6014987192625841276L; + + StrictStringDeserializer() { + super(String.class); + } + + @Override + public String deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JacksonException { + JsonToken t = p.currentToken(); + if (t == JsonToken.VALUE_STRING) { + return p.getText(); + } else { + return (String) ctxt.handleUnexpectedToken(String.class, p); + } + } + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/EventStream.java b/src/main/java/com/clerk/backend_api/utils/EventStream.java new file mode 100644 index 0000000..c4066e6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/EventStream.java @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Optional; +import java.util.Spliterator; +import java.util.Spliterators; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * Manages the parsing of an InputStream in SSE (Server Sent Events) format. + * + * @param the type that the SSE {@code data} field is deserialized into + */ +/** + * @param + */ +public final class EventStream implements AutoCloseable { + + private final EventStreamReader reader; + private final TypeReference typeReference; + private final ObjectMapper mapper; + + // Internal use only + public EventStream(InputStream in, TypeReference typeReference, ObjectMapper mapper) { + this.reader = new EventStreamReader(in); + this.typeReference = typeReference; + this.mapper = mapper; + } + + /** + * Returns the next message. If another message does not exist returns + * {@code Optional.empty()}. + * + * @return the next message or {@code Optional.empty()} if no more messages + * @throws IOException + */ + public Optional next() throws IOException { + return reader.readMessage() // + .map(x -> Utils.asType(x, mapper, typeReference)); + } + + /** + * Reads all events and returns them as a {@code List}. This method calls + * {@code close()}. + * + * @return list of events + */ + public List toList() { + try { + return stream().collect(Collectors.toList()); + } finally { + try { + close(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + /** + * Returns a {@link Stream} of events. Must be closed after use! + * + * @return streamed events + */ + public Stream stream() { + return StreamSupport.stream(Spliterators.spliteratorUnknownSize(new Iterator() { + Optional next = null; + + public T next() { + load(); + if (!next.isPresent()) { + throw new NoSuchElementException(); + } + T v = next.get(); + next = null; + return v; + } + + public boolean hasNext() { + load(); + return next.isPresent(); + } + + private void load() { + if (next == null) { + try { + next = EventStream.this.next(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + } + + }, Spliterator.ORDERED), false).onClose(() -> { + try { + EventStream.this.close(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } + + @Override + public void close() throws Exception { + reader.close(); + } + +} diff --git a/src/main/java/com/clerk/backend_api/utils/EventStreamLineReader.java b/src/main/java/com/clerk/backend_api/utils/EventStreamLineReader.java new file mode 100644 index 0000000..44cff87 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/EventStreamLineReader.java @@ -0,0 +1,71 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.IOException; +import java.io.Reader; + +/** + * Converts CR-LF, LF, CR to LF + */ +public class EventStreamLineReader extends Reader { + + private final Reader reader; + private int lastCh = -1; // not LF nor CR + + public EventStreamLineReader(Reader reader) { + this.reader = reader; + } + + @Override + public int read() throws IOException { + if (lastCh == -1) { + // load first character of stream + lastCh = reader.read(); + if (lastCh == -1 || lastCh == '\n') { + // force reload of buffered last ch + int v = lastCh; + lastCh = -1; + return v; + } + } + int ch = reader.read(); + if (ch == -1) { + if (lastCh == '\r') { + lastCh = -1; + return '\n'; + } else { + int v = lastCh; + lastCh = -1; + return v; + } + } else if (lastCh == '\n') { + lastCh = ch; + return '\n'; + } else if (lastCh == '\r' && ch == '\n') { + // force reload of buffered last ch + lastCh = -1; + return '\n'; + } else if (lastCh == '\r') { + lastCh = ch; + return '\n'; + } else { + int v = lastCh; + lastCh = ch; + return v; + } + } + + @Override + public int read(char[] cbuf, int off, int len) throws IOException { + throw new UnsupportedOperationException(); + } + + @Override + public void close() throws IOException { + reader.close(); + } + +} diff --git a/src/main/java/com/clerk/backend_api/utils/EventStreamMessage.java b/src/main/java/com/clerk/backend_api/utils/EventStreamMessage.java new file mode 100644 index 0000000..6e9b579 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/EventStreamMessage.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.util.Optional; + +public class EventStreamMessage { + + private final Optional event; + private final Optional id; + private final Optional retryMs; + private final String data; + + public EventStreamMessage(Optional event, Optional id, Optional retryMs, String data) { + if (data == null) { + throw new IllegalArgumentException("data cannot be null"); + } + this.event = event; + this.id = id; + this.retryMs = retryMs; + this.data = data; + } + + public Optional event() { + return event; + } + + public Optional id() { + return id; + } + + public Optional retryMs() { + return retryMs; + } + + public String data() { + return data; + } + + public boolean isEmpty() { + return !event.isPresent() && !id().isPresent() && !retryMs().isPresent() && data.isEmpty(); + } + + @Override + public String toString() { + StringBuilder b = new StringBuilder(); + event.ifPresent(value -> b.append("event: " + value + "\n")); + id.ifPresent(value -> b.append("id: " + value + "\n")); + retryMs.ifPresent(value -> b.append("retry: " + value + "\n")); + if (!data.isEmpty()) { + b.append("data: " + data); + } + return b.toString(); + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/EventStreamReader.java b/src/main/java/com/clerk/backend_api/utils/EventStreamReader.java new file mode 100644 index 0000000..bfca9de --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/EventStreamReader.java @@ -0,0 +1,156 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public final class EventStreamReader implements AutoCloseable { + + private static final int BUFFER_SIZE = 8192; + + private static final String BYTE_ORDER_MARK = "\uFEFF"; + + private final Reader reader; + + private boolean first = true; + + public EventStreamReader(InputStream in) { + reader = new EventStreamLineReader( + new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8), BUFFER_SIZE)); + } + + /** + * Returns the event message (lines separated by \n) without the terminating + * \n\n. Returns null when end of stream reached (and may occur with a partially + * read event message that has not yet been terminated). Characters in comment + * lines are discarded as read (they are not buffered). + * + * @return the event message + * @throws IOException + */ + // VisibleForTesting + public String readRawMessage() throws IOException { + StringBuilder line = new StringBuilder(); + StringBuilder b = new StringBuilder(); + + char previousCh = 0; + boolean previousAvailable = false; + boolean isComment = false; + char ch; + while (true) { + int v = reader.read(); + if (v == -1) { + return null; + } + ch = (char) v; + if (previousAvailable) { + // note that incoming input stream converts sequences of \r and/or \n to \n + // characters so we only concern ourselves with \n (divide and conquer) + if (previousCh == '\n' && ch == '\n') { + b.append(line); + line.setLength(0); + isComment = false; + trimTrailingNewLines(b); + String msg = b.toString(); + if (first) { + // skip BOM if present in the first message only + if (msg.startsWith(BYTE_ORDER_MARK)) { + msg = msg.substring(BYTE_ORDER_MARK.length()); + } + first = false; + } + return msg; + } else { + if (line.length() == 0 && previousCh == ':') { + isComment = true; + } + if (!isComment) { + line.append(previousCh); + if (previousCh == '\n') { + b.append(line); + // reset line + line.setLength(0); + } + } else if (previousCh == '\n') { + isComment = false; + } + } + } else { + previousAvailable = true; + } + previousCh = ch; + } + } + + public Optional readMessage() throws IOException { + String m = readRawMessage(); + if (m == null) { + return Optional.empty(); + } else { + return Optional.of(parseMessage(m)); + } + } + + private static final Pattern LINE_PATTERN = Pattern.compile("^([a-zA-Z]+): ?(.*)$"); + private static final char LINEFEED = '\n'; + + // VisibleForTesting + public static EventStreamMessage parseMessage(String text) { + String[] lines = text.split("\n"); + Optional event = Optional.empty(); + Optional id = Optional.empty(); + Optional retryMs = Optional.empty(); + StringBuilder data = new StringBuilder(); + boolean firstData = true; + for (String line : lines) { + Matcher m = LINE_PATTERN.matcher(line); + if (m.find()) { + String key = m.group(1).toLowerCase(); + String value = m.group(2); + if ("event".equals(key)) { + event = Optional.of(value); + } else if ("id".equals(key)) { + id = Optional.of(value); + } else if ("retry".equals(key)) { + try { + retryMs = Optional.of(Integer.parseInt(value)); + } catch (NumberFormatException e) { + // ignore + } + } else if ("data".equals(key)) { + if (!firstData) { + data.append(LINEFEED); + } + firstData = false; + data.append(value); + } // else ignore the line + } + } + return new EventStreamMessage(event, id, retryMs, data.toString()); + } + + private static StringBuilder trimTrailingNewLines(StringBuilder b) { + int i = 0; + while (b.length() > i && b.charAt(b.length() - i - 1) == '\n') { + i++; + } + b.setLength(b.length() - i); + return b; + } + + @Override + public void close() throws Exception { + reader.close(); + } + +} diff --git a/src/main/java/com/clerk/backend_api/utils/FormMetadata.java b/src/main/java/com/clerk/backend_api/utils/FormMetadata.java new file mode 100644 index 0000000..d155302 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/FormMetadata.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.lang.reflect.Field; + +class FormMetadata { + + String style = "form"; + boolean explode = true; + boolean json; + String name; + + private FormMetadata() { + } + + // form:name=propName,style=spaceDelimited,explode=true + static FormMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("form", new FormMetadata(), field); + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/HTTPClient.java b/src/main/java/com/clerk/backend_api/utils/HTTPClient.java new file mode 100644 index 0000000..6fe4f23 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/HTTPClient.java @@ -0,0 +1,16 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URISyntaxException; +import java.net.http.HttpResponse; +import java.net.http.HttpRequest; + +public interface HTTPClient { + HttpResponse send(HttpRequest request) + throws IOException, InterruptedException, URISyntaxException; +} diff --git a/src/main/java/com/clerk/backend_api/utils/HTTPRequest.java b/src/main/java/com/clerk/backend_api/utils/HTTPRequest.java new file mode 100644 index 0000000..13d63fe --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/HTTPRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.net.URISyntaxException; +import java.net.http.HttpRequest; +import java.net.http.HttpRequest.BodyPublisher; +import java.net.http.HttpRequest.BodyPublishers; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.message.BasicNameValuePair; + +public class HTTPRequest { + + private final String baseURL; + private final String method; + private final List queryParams = new ArrayList<>(); + private final Map> headers = new HashMap<>(); + private Optional body = Optional.empty(); // mutable + + public HTTPRequest(String baseURL, String method) { + Utils.checkNotNull(baseURL, "baseURL"); + Utils.checkNotNull(method, "method"); + this.baseURL = baseURL; + this.method = method; + } + + public void setBody(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + } + + public HTTPRequest addHeader(String key, String value) { + List headerValues = headers.get(key); + if (headerValues == null) { + headerValues = new ArrayList<>(); + headers.put(key, headerValues); + } + headerValues.add(value); + return this; + } + + public HTTPRequest addHeaders(Map> map) { + map.forEach((key, list) -> list.forEach(v -> addHeader(key, v))); + return this; + } + + public HTTPRequest addQueryParam(String name, String value) { + addQueryParam(new BasicNameValuePair(name, value)); + return this; + } + + public HTTPRequest addQueryParam(NameValuePair param) { + this.queryParams.add(param); + return this; + } + + public HTTPRequest addQueryParams(Collection params) { + params.forEach(p -> addQueryParam(p)); + return this; + } + + public HttpRequest build() { + HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(); + + final BodyPublisher bodyPublisher; + if (body.isPresent()) { + bodyPublisher = body.get().body(); + requestBuilder.header("Content-Type", body.get().contentType()); + } else { + bodyPublisher = BodyPublishers.noBody(); + } + requestBuilder.method(method, bodyPublisher); + try { + URIBuilder b = new URIBuilder(this.baseURL); + queryParams.forEach(pair -> b.addParameter(pair.getName(), pair.getValue())); + requestBuilder.uri(b.build()); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + headers.forEach((k, list) -> list.forEach(v -> requestBuilder.header(k, v))); + return requestBuilder.build(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/clerk/backend_api/utils/HeaderMetadata.java b/src/main/java/com/clerk/backend_api/utils/HeaderMetadata.java new file mode 100644 index 0000000..c4ffc15 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/HeaderMetadata.java @@ -0,0 +1,22 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.lang.reflect.Field; + +class HeaderMetadata { + + String style = "simple"; + boolean explode; + String name; + + private HeaderMetadata() { + } + + // headerParam:style=simple,explode=false,name=apiID + static HeaderMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("header", new HeaderMetadata(), field); + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/Hook.java b/src/main/java/com/clerk/backend_api/utils/Hook.java new file mode 100644 index 0000000..0a2de39 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/Hook.java @@ -0,0 +1,266 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.net.http.HttpRequest; +import java.util.List; +import java.util.Optional; +import java.util.UUID; + +import com.clerk.backend_api.SecuritySource; + +/** + * Holder class for hook-associated types. This class does not get + * instantiated. + */ +public final class Hook { + + private Hook() { + // prevent instantiation + } + + /** + * Context for a hook call. + */ + public interface HookContext { + String operationId(); + Optional> oauthScopes(); + Optional securitySource(); + } + + /** + * Context for a BeforeRequest hook call. + */ + public interface BeforeRequestContext extends HookContext { + } + + public static final class BeforeRequestContextImpl implements BeforeRequestContext { + + private final String operationId; + private final Optional> oauthScopes; + private final Optional securitySource; + + public BeforeRequestContextImpl(String operationId, Optional> oauthScopes, Optional securitySource) { + this.operationId = operationId; + this.oauthScopes = oauthScopes; + this.securitySource = securitySource; + } + + @Override + public String operationId() { + return operationId; + } + + @Override + public Optional securitySource() { + return securitySource; + } + + @Override + public Optional> oauthScopes() { + return oauthScopes; + } + } + + /** + * Context for an AfterSuccess hook call. + */ + public interface AfterSuccessContext extends HookContext { + } + + public static final class AfterSuccessContextImpl implements AfterSuccessContext { + + private final String operationId; + private final Optional> oauthScopes; + private final Optional securitySource; + + public AfterSuccessContextImpl(String operationId, Optional> oauthScopes, Optional securitySource) { + Utils.checkNotNull(securitySource, "securitySource"); + this.operationId = operationId; + this.oauthScopes = oauthScopes; + this.securitySource = securitySource; + } + + @Override + public String operationId() { + return operationId; + } + + @Override + public Optional securitySource() { + return securitySource; + } + + @Override + public Optional> oauthScopes() { + return oauthScopes; + } + } + + /** + * Context for an AfterError hook call. + */ + public interface AfterErrorContext extends HookContext { + } + + public static final class AfterErrorContextImpl implements AfterErrorContext { + + private final String operationId; + private final Optional> oauthScopes; + private final Optional securitySource; + + public AfterErrorContextImpl(String operationId, Optional> oauthScopes, Optional securitySource) { + Utils.checkNotNull(securitySource, "securitySource"); + this.operationId = operationId; + this.oauthScopes = oauthScopes; + this.securitySource = securitySource; + } + + @Override + public String operationId() { + return operationId; + } + + @Override + public Optional securitySource() { + return securitySource; + } + + @Override + public Optional> oauthScopes() { + return oauthScopes; + } + } + + /** + * Specifies how a request is transformed before sending. + */ + public interface BeforeRequest { + + /** + * Transforms the given {@link HttpRequest} before sending. + * + * @param context context for the hook call + * @param request request to be transformed + * @return transformed request + * @throws Exception on error + */ + HttpRequest beforeRequest(BeforeRequestContext context, HttpRequest request) throws Exception; + + /** + * The default action is to return the request untouched. + */ + static BeforeRequest DEFAULT = (context, request) -> request; + } + + /** + * Specifies how a response is transformed before response processing. + */ + public interface AfterSuccess { + + /** + * Transforms the given response before response processing occurs. + * + * @param context context for the hook call + * @param response response to be transformed + * @return transformed response + * @throws Exception on error + */ + HttpResponse afterSuccess(AfterSuccessContext context, HttpResponse response) + throws Exception; + + /** + * The default action is to return the response untouched. + */ + static AfterSuccess DEFAULT = (context, response) -> response; + } + + /** + * Specifies what happens if a request action throws an Exception. + */ + public interface AfterError { + + /** + * Either returns an HttpResponse or throws an Exception. Must be passed either + * a response or an error (both can't be absent). + * + * @param context context for the error + * @param response response information if available. + * @param error the optional exception. If response present then the error is for-info + * only, it was the last error in the chain of AfterError hook + * calls leading to this one + * @return HTTP response if method decides that an exception is not to be thrown + * @throws Exception if error to be propagated + */ + HttpResponse afterError( + AfterErrorContext context, + Optional> response, + Optional error) throws Exception; + + /** + * The default action is to rethrow the given error. + */ + static AfterError DEFAULT = (context, response, error) -> { + Utils.checkArgument( + response.isPresent() ^ error.isPresent(), + "one and only one of response or error must be present"); + if (error.isPresent()) { + throw error.get(); + } else { + return response.get(); + } + }; + } + + public static final class SdkInitData { + private final String baseUrl; + private final HTTPClient client; + + public SdkInitData(String baseUrl, HTTPClient client) { + this.baseUrl = baseUrl; + this.client = client; + } + + public String baseUrl() { + return baseUrl; + } + + public HTTPClient client() { + return client; + } + } + + /** + * Transforms the HTTPClient before use. + */ + public interface SdkInit { + + /** + * Returns a transformed {@link HTTPClient} and {@code baseUrl} for use in requests. + * + * @param data data to transform + * @return the transformed data + */ + SdkInitData sdkInit(SdkInitData data); + + /** + * The default action is to return the client untouched. + */ + static SdkInit DEFAULT = data -> data; + + } + + public static final class IdempotencyHook implements BeforeRequest { + + @Override + public HttpRequest beforeRequest(BeforeRequestContext context, HttpRequest request) throws Exception { + HttpRequest.Builder b = Utils.copy(request); + b.header("Idempotency-Key", UUID.randomUUID().toString()); + return b.build(); + } + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/Hooks.java b/src/main/java/com/clerk/backend_api/utils/Hooks.java new file mode 100644 index 0000000..73f41f5 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/Hooks.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.net.http.HttpRequest; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; + +import com.clerk.backend_api.utils.Hook.AfterError; +import com.clerk.backend_api.utils.Hook.AfterErrorContext; +import com.clerk.backend_api.utils.Hook.AfterSuccess; +import com.clerk.backend_api.utils.Hook.AfterSuccessContext; +import com.clerk.backend_api.utils.Hook.BeforeRequest; +import com.clerk.backend_api.utils.Hook.BeforeRequestContext; +import com.clerk.backend_api.utils.Hook.SdkInit; +import com.clerk.backend_api.utils.Hook.SdkInitData; + +/** + * Registers hooks for use at runtime by an end-user or for use by a customer + * that may edit the SDKHooks.java file. + * + *

+ * For example, this code will add a transaction id header to every request: + * + *

+ * hooks.registerBeforeRequest((context, request) -> {
+ *     request.headers().map().put("acme-transaction-id", nextTransactionId());
+ *     return request;
+ * });
+ * 
+ */ +// ThreadSafe +public class Hooks implements BeforeRequest, AfterSuccess, AfterError, SdkInit { + + // we use CopyOnWriteArrayList for thread safety + private final List beforeRequestHooks = new CopyOnWriteArrayList<>(); + private final List afterSuccessHooks = new CopyOnWriteArrayList<>(); + private final List afterErrorHooks = new CopyOnWriteArrayList<>(); + private final List SdkInitHooks = new CopyOnWriteArrayList<>(); + + /** + * Constructor. + */ + public Hooks() { + } + + /** + * Registers a {@link BeforeRequest} hook to be applied in order of + * registration. The result of the first BeforeRequest hook will be passed to + * the second BeforeRequest hook and processed similarly for the rest of the + * registered hooks. If a BeforeRequest hook throws then that Exception will + * not be passed to the {@link AfterError} hooks. + * + * @param beforeRequest hook to be registered + * @return this + */ + public Hooks registerBeforeRequest(BeforeRequest beforeRequest) { + Utils.checkNotNull(beforeRequest, "beforeRequest"); + this.beforeRequestHooks.add(beforeRequest); + return this; + } + + /** + * Registers an {@link AfterSuccess} hook to be applied in order of registration + * (multiple can be registered). The result of the first AfterSuccess hook will + * be passed to the second AfterSuccess hook and processed similarly for the + * rest of the registered hooks. If an AfterSuccess hook throws then that + * Exception will not be passed to the {@link AfterError} hooks. + * + * @param afterSuccess hook to be registered + * @return this + */ + public Hooks registerAfterSuccess(AfterSuccess afterSuccess) { + Utils.checkNotNull(afterSuccess, "afterSuccess"); + this.afterSuccessHooks.add(afterSuccess); + return this; + } + + /** + * Registers an {@link AfterError} hook to be applied in order of registration + * (multiple can be registered). If the first AfterError hook throws then the + * second hook will be called with that exception (and no response object) and + * so on for the rest of the registered hooks. If an AfterError hook returns + * normally then its result will be passed through to the next AfterError hook + * with the latest thrown Exception. + * + * @param afterError hook to be registered + * @return this + */ + public Hooks registerAfterError(AfterError afterError) { + Utils.checkNotNull(afterError, "afterError"); + this.afterErrorHooks.add(afterError); + return this; + } + + /** + * Registers a {@SdkInit} hook to be applied in order of registration + * (multiple can be registered). + * + * @param SdkInit hook to be registered + * @return this + */ + public Hooks registerSdkInit(SdkInit SdkInit) { + Utils.checkNotNull(SdkInit, "SdkInit"); + this.SdkInitHooks.add(SdkInit); + return this; + } + + @Override + public HttpRequest beforeRequest(BeforeRequestContext context, HttpRequest request) throws Exception { + Utils.checkNotNull(context, "context"); + Utils.checkNotNull(request, "request"); + for (BeforeRequest hook : beforeRequestHooks) { + request = hook.beforeRequest(context, request); + } + return request; + } + + @Override + public HttpResponse afterSuccess(AfterSuccessContext context, HttpResponse response) + throws Exception { + Utils.checkNotNull(context, "context"); + Utils.checkNotNull(response, "response"); + + for (AfterSuccess hook : afterSuccessHooks) { + response = hook.afterSuccess(context, response); + if (response == null) { + throw new IllegalStateException("afterSuccess cannot return null"); + } + } + return response; + } + + @Override + public HttpResponse afterError( + AfterErrorContext context, + Optional> response, + Optional error) throws Exception { + Utils.checkNotNull(context, "context"); + Utils.checkNotNull(response, "response"); + Utils.checkNotNull(error, "error"); + Utils.checkArgument( + response.isPresent() ^ error.isPresent(), + "one and only one of response or error must be present"); + + for (AfterError hook : afterErrorHooks) { + try { + response = Optional.ofNullable(hook.afterError(context, response, error)); + if (!response.isPresent()) { + throw new IllegalStateException( + "afterError must either throw an exception or return a non-null response"); + } + } catch (FailEarlyException e) { + Throwable cause = e.getCause(); + if (cause instanceof Exception) { + throw (Exception) cause; + } else { + // must be an Error + throw (Error) cause; + } + } catch (Exception e) { + error = Optional.of(e); + response = Optional.empty(); + } + } + if (response.isPresent()) { + return response.get(); + } else { + throw error.get(); + } + } + + @Override + public SdkInitData sdkInit(SdkInitData data) { + Utils.checkNotNull(data, "data"); + for (SdkInit hook : SdkInitHooks) { + data = hook.sdkInit(data); + if (data == null) { + throw new IllegalStateException("sdkInit cannot return null"); + } + } + return data; + } + + @SuppressWarnings("serial") + public static final class FailEarlyException extends RuntimeException { + public FailEarlyException(Exception e) { + super(e); + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/clerk/backend_api/utils/JSON.java b/src/main/java/com/clerk/backend_api/utils/JSON.java new file mode 100644 index 0000000..8cdfbf6 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/JSON.java @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import org.openapitools.jackson.nullable.JsonNullableModule; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class JSON { + public static ObjectMapper getMapper() { + return new ObjectMapper() + .registerModule(new JavaTimeModule()) + .registerModule(new Jdk8Module()) + .registerModule(new JsonNullableModule()) + .registerModule(Deserializers.STRICT_DESERIALIZERS) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES); + } +} \ No newline at end of file diff --git a/src/main/java/com/clerk/backend_api/utils/LazySingletonValue.java b/src/main/java/com/clerk/backend_api/utils/LazySingletonValue.java new file mode 100644 index 0000000..e0c1dfd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/LazySingletonValue.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import com.fasterxml.jackson.core.type.TypeReference; + +public final class LazySingletonValue { + + private static final Object NOT_SET = new Object(); + + private final String name; + private final String json; + private final TypeReference typeReference; + private Object value = NOT_SET; + + public LazySingletonValue(String name, String json, TypeReference typeReference) { + this.name = name; + this.json = json; + this.typeReference = typeReference; + } + + @SuppressWarnings("unchecked") + public T value() { + if (value == NOT_SET) { + value = Utils.readDefaultOrConstValue(name, json, typeReference); + } + return (T) value; + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/Metadata.java b/src/main/java/com/clerk/backend_api/utils/Metadata.java new file mode 100644 index 0000000..5915b05 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/Metadata.java @@ -0,0 +1,83 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +final class Metadata { + + private Metadata() { + // prevent instantiation + } + + static T parse(String name, T metadata, Field field) + throws IllegalArgumentException, IllegalAccessException { + SpeakeasyMetadata md = field.getAnnotation(SpeakeasyMetadata.class); + if (md == null) { + return null; + } + + String mdValue = md.value(); + + if (mdValue == null || mdValue.isBlank()) { + return null; + } + + String[] groups = mdValue.split(" "); + + boolean handled = false; + + for (String group : groups) { + String[] parts = group.split(":"); + if (parts.length != 2) { + return null; + } + + if (!parts[0].equals(name)) { + continue; + } + + Map values = new HashMap<>(); + + String[] pairs = parts[1].split(","); + for (String pair : pairs) { + String[] keyVal = pair.split("="); + String key = keyVal[0]; + + String val = ""; + if (keyVal.length > 1) { + val = keyVal[1]; + } + + values.put(key, val); + } + + Field[] fields = metadata.getClass().getDeclaredFields(); + + for (Field f : fields) { + f.setAccessible(true); + if (values.containsKey(f.getName())) { + String val = values.get(f.getName()); + + if (f.getType().equals(boolean.class) || f.getType().equals(Boolean.class)) { + f.set(metadata, val.equals("true") || val.isBlank()); + } else { + f.set(metadata, val); + } + } + } + + handled = true; + } + + if (!handled) { + return null; + } + + return (T) metadata; + } +} \ No newline at end of file diff --git a/src/main/java/com/clerk/backend_api/utils/MultipartFormMetadata.java b/src/main/java/com/clerk/backend_api/utils/MultipartFormMetadata.java new file mode 100644 index 0000000..b22e8df --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/MultipartFormMetadata.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.lang.reflect.Field; + +class MultipartFormMetadata { + + boolean file; + boolean content; + boolean json; + String name; + + private MultipartFormMetadata() { + } + + // multipartForm:name=file + static MultipartFormMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("multipartForm", new MultipartFormMetadata(), field); + } +} diff --git a/src/main/java/com/clerk/backend_api/utils/OneOfDeserializer.java b/src/main/java/com/clerk/backend_api/utils/OneOfDeserializer.java new file mode 100644 index 0000000..ca207fd --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/OneOfDeserializer.java @@ -0,0 +1,251 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import com.clerk.backend_api.utils.Utils.TypeReferenceWithShape; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.TreeNode; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DatabindException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +public class OneOfDeserializer extends StdDeserializer { + + private static final long serialVersionUID = -1; + + private final List typeReferences; // oneOf subschemas + private final Class cls; + private final ObjectMapper mapper; + + protected OneOfDeserializer(Class cls, TypeReferenceWithShape... typeReferences) { + super(cls); + this.typeReferences= Arrays.asList(typeReferences); + this.cls = cls; + this.mapper = JSON.getMapper(); + } + + @Override + public T deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + return deserializeOneOf(mapper, p, ctxt, typeReferences, cls); + } + + private static T deserializeOneOf(ObjectMapper mapper, JsonParser p, DeserializationContext ctxt, + List typeReferences, Class cls) throws IOException { + TreeNode tree = p.getCodec().readTree(p); + // TODO don't have to generate json because can use tree.traverse to get a + // parser to read value, perf advantage and can stop plugging in ObjectMapper + String json = mapper.writeValueAsString(tree); + return deserializeOneOf(mapper, json, typeReferences, cls, ctxt); + } + + private static T deserializeOneOf(ObjectMapper mapper, String json, List typeReferences, Class cls, + DeserializationContext ctxt) throws JsonProcessingException { + List> matches = new ArrayList<>(); + for (TypeReferenceWithShape c : typeReferences) { + // try to deserialize with each of the member classes + // @formatter:off + try { + JavaType jt = Utils.convertToShape(mapper.getTypeFactory(), c.typeReference(), c.shape()); + // Jackson very permissive with readValue so we will tighten things up a bit + if (matchPossible(jt, json)) { + Object o = mapper.readValue(json, jt); + o = Utils.convertToShapeInverse(o, c.shape(), jt); + @SuppressWarnings("unchecked") + TypedObject typed = TypedObject.of(o, c.shape(), (TypeReference) c.typeReference()); + T v = newInstance(cls, typed); + matches.add(new Match<>(c, v)); + } + } catch (DatabindException e) {} // NOPMD + // @formatter:on + } + matches = applyMatchPreferences(matches, json); + if (matches.size() == 1) { + return matches.get(0).value; + } else if (matches.size() > 1) { + throw JsonMappingException.from(ctxt, + "json matched more than one of the possible type references, matches are: " + typeNames(matches) + " - json=\n" + json); + } else { + throw JsonMappingException.from(ctxt, + "json did not match any of the possible type references: " + typeReferenceNames(typeReferences) + ", json=\n" + json); + } + } + + private static final class Match { + final TypeReferenceWithShape typeReference; + final T value; + + Match(TypeReferenceWithShape typeReference, T value) { + this.typeReference = typeReference; + this.value = value; + } + } + + private static final Set NUMERIC_CLASSES = Set.of( + Integer.class.getCanonicalName(), + Long.class.getCanonicalName(), + BigInteger.class.getCanonicalName(), + Float.class.getCanonicalName(), + Double.class.getCanonicalName(), + BigDecimal.class.getCanonicalName()); + + private static final Set DECIMAL_CLASSES = Set.of( + Float.class.getCanonicalName(), + Double.class.getCanonicalName(), + BigDecimal.class.getCanonicalName()); + + private static final Set INTEGER_CLASSES = Set.of( + Integer.class.getCanonicalName(), + Long.class.getCanonicalName(), + BigInteger.class.getCanonicalName()); + + private static final Set DATE_TIME_CLASSES = Set.of( + OffsetDateTime.class.getCanonicalName(), + LocalDate.class.getCanonicalName()); + + // VisibleForTesting + public static boolean matchPossible(JavaType type, String json) { + // situations we want to AVOID that can happen with Jackson ObjectMapper: + // * json numeric considered as valid for deserialization to OffsetDateTime, LocalDate + // * non-double-quoted json string considered as valid string + // * json numeric can be parsed as a Boolean + // * double-quoted numerics can be parsed as numerics + + // We make important assumptions about matching json with types + if (typeIs(type, String.class) || typeIs(type, BigIntegerString.class) || typeIs(type, BigDecimalString.class)) { + // string must be double quoted + return isDoubleQuoted(json); + } else if (typeIs(type, Boolean.class)) { + // boolean can only have false or true values + return json.equals("true") || json.equals("false"); + } else if (NUMERIC_CLASSES.contains(type.getTypeName())) { + return !json.contains("\""); + } else if (typeIs(type, OffsetDateTime.class) || typeIs(type, LocalDate.class)) { + // only json schema datetime format accepted, not epoch ms/s etc. + return isDoubleQuoted(json) && !isNumeric(json.substring(1, json.length() - 1)); + } else { + return true; + } + } + + private static boolean isDoubleQuoted(String s) { + return s.length() >=2 && s.startsWith("\"") && s.endsWith("\""); + } + + // VisibleForTesting + public static List> applyMatchPreferences(List> matches, String json) { + if (matches.size() <= 1) { + return matches; + } else if (allNumeric(matches)) { + List> decimalMatches = decimalMatches(matches); + List> integerMatches = integerMatches(matches); + if (!decimalMatches.isEmpty() && !integerMatches.isEmpty()) { + if (json.contains("e")|| json.contains(".")) { + return decimalMatches; + } else { + return integerMatches; + } + } else if (!decimalMatches.isEmpty()) { + return decimalMatches; + } else { + return integerMatches; + } + } if (allDateTime(matches)) { + if (json.contains("T")) { + return filter(matches, OffsetDateTime.class); + } else { + return filter(matches, LocalDate.class); + } + } else { + return matches; + } + } + + private static List> filter(List> matches, Class filterByClass) { + return matches // + .stream() // + .filter(x -> x.typeReference.typeReference().getType().getTypeName().equals(filterByClass.getCanonicalName())) // + .collect(Collectors.toList()); + } + + private static boolean allDateTime(List> matches) { + return matches.stream().allMatch(x -> DATE_TIME_CLASSES.contains(x.typeReference.typeReference().getType().getTypeName())); + } + + private static boolean allNumeric(List> matches) { + return matches.stream().allMatch(x -> NUMERIC_CLASSES.contains(x.typeReference.typeReference().getType().getTypeName())); + } + + private static List> decimalMatches(List> matches) { + return matches // + .stream() // + .filter(x -> DECIMAL_CLASSES.contains(x.typeReference.typeReference().getType().getTypeName())) // + .collect(Collectors.toList()); + } + + private static List> integerMatches(List> matches) { + return matches // + .stream() // + .filter(x -> INTEGER_CLASSES.contains(x.typeReference.typeReference().getType().getTypeName())) // + .collect(Collectors.toList()); + } + + private static boolean isNumeric(String s) { + try { + Double.parseDouble(s); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + private static boolean typeIs(JavaType type, Class cls) { + return type.getRawClass().equals(cls); + } + + private static String typeNames(List> matches) { + return "[" + matches + .stream() + .map(x -> x.typeReference.typeReference().getType().getTypeName()) + .collect(Collectors.joining(", ")) + "]"; + } + + private static String typeReferenceNames(List list) { + return "[" + list + .stream() + .map(x -> x.typeReference().getType().getTypeName()) + .collect(Collectors.joining(", ")) + "]"; + } + + private static T newInstance(Class cls, Object parameter) { + try { + Constructor con = cls.getDeclaredConstructor(TypedObject.class); + con.setAccessible(true); + return con.newInstance(parameter); + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException + | NoSuchMethodException | SecurityException e) { + throw new RuntimeException(e); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/clerk/backend_api/utils/Options.java b/src/main/java/com/clerk/backend_api/utils/Options.java new file mode 100644 index 0000000..a6ed270 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/utils/Options.java @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.clerk.backend_api.utils; + +import java.util.Optional; +import java.util.List; +import com.clerk.backend_api.utils.Utils; + + +public class Options { + + public enum Option { + RETRY_CONFIG; + } + + private Optional retryConfig = Optional.empty(); + + private Options(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + } + + public Optional retryConfig() { + return retryConfig; + } + + public final void validate(List