From f737354e3d78a96696fc17aa07a3d68495c2bc5c Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 11 Nov 2024 15:46:04 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.437.0 --- .speakeasy/gen.lock | 46 ++- .speakeasy/gen.yaml | 3 +- .speakeasy/workflow.lock | 14 +- README.md | 56 +-- RELEASES.md | 12 +- build.gradle | 4 +- docs/models/components/Totp.md | 16 + docs/models/components/Type.md | 16 +- .../operations/CreateUserTOTPResponse.md | 2 +- .../clerk/backend_api/SDKConfiguration.java | 4 +- .../java/com/clerk/backend_api/Users.java | 6 +- .../backend_api/models/components/Totp.java | 341 ++++++++++++++++++ .../backend_api/models/components/Type.java | 2 + .../operations/CreateUserTOTPResponse.java | 21 +- 14 files changed, 454 insertions(+), 89 deletions(-) create mode 100644 docs/models/components/Totp.md create mode 100644 src/main/java/com/clerk/backend_api/models/components/Totp.java diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1f5f1a2..017e772 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,20 @@ lockVersion: 2.0.0 id: 1d22a5a4-8bac-42e3-b164-121fcacf66c9 management: - docChecksum: 360e2b992ec7b171685132d827f3b1f7 + docChecksum: b7d2d41694154c8bb06badd95ee5eabf docVersion: v1 - speakeasyVersion: 1.428.0 - generationVersion: 2.447.4 - releaseVersion: 1.0.0 - configChecksum: b91b6226ca33a5ba8fbd403738077ddb + speakeasyVersion: 1.437.0 + generationVersion: 2.456.0 + releaseVersion: 1.2.0 + configChecksum: 09ed2850809d9e84b4ae26784404d320 repoURL: https://github.com/clerk/clerk-sdk-java.git published: true features: java: additionalDependencies: 0.1.0 + additionalProperties: 0.0.1 constsAndDefaults: 0.1.1 - core: 3.30.7 + core: 3.31.0 deprecations: 2.81.1 examples: 2.81.3 flattening: 2.81.1 @@ -188,6 +189,7 @@ generatedFiles: - docs/models/components/TicketVerificationStrategy.md - docs/models/components/TotalCount.md - docs/models/components/TotalCountObject.md + - docs/models/components/Totp.md - docs/models/components/Type.md - docs/models/components/UnsafeMetadata.md - docs/models/components/User.md @@ -751,6 +753,7 @@ generatedFiles: - src/main/java/com/clerk/backend_api/models/components/TicketVerificationStrategy.java - src/main/java/com/clerk/backend_api/models/components/TotalCount.java - src/main/java/com/clerk/backend_api/models/components/TotalCountObject.java + - src/main/java/com/clerk/backend_api/models/components/Totp.java - src/main/java/com/clerk/backend_api/models/components/Type.java - src/main/java/com/clerk/backend_api/models/components/UnsafeMetadata.java - src/main/java/com/clerk/backend_api/models/components/User.java @@ -1393,6 +1396,7 @@ examples: responses: "401": application/json: {"errors": []} + "200": {} GetTemplateList: speakeasy-default-get-template-list: parameters: @@ -1401,6 +1405,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} RevertTemplate: speakeasy-default-revert-template: parameters: @@ -1410,6 +1415,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} GetTemplate: speakeasy-default-get-template: parameters: @@ -1419,6 +1425,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} ToggleTemplateDelivery: speakeasy-default-toggle-template-delivery: parameters: @@ -1428,6 +1435,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} UpsertTemplate: speakeasy-default-upsert-template: parameters: @@ -1437,6 +1445,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} + "200": {} PreviewTemplate: speakeasy-default-preview-template: parameters: @@ -1446,6 +1455,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} + "200": {} GetUserList: "": parameters: @@ -1579,6 +1589,7 @@ examples: responses: "400": application/json: {"errors": []} + "200": {} UsersGetOrganizationMemberships: speakeasy-default-users-get-organization-memberships: parameters: @@ -1609,6 +1620,7 @@ examples: responses: "500": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} VerifyTOTP: speakeasy-default-verify-TOTP: parameters: @@ -1617,6 +1629,7 @@ examples: responses: "500": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} + "200": {} DisableMFA: speakeasy-default-disable-MFA: parameters: @@ -1625,6 +1638,7 @@ examples: responses: "404": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} DeleteBackupCode: speakeasy-default-delete-backup-code: parameters: @@ -1633,6 +1647,7 @@ examples: responses: "404": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} + "200": {} UserPasskeyDelete: speakeasy-default-user-passkey-delete: parameters: @@ -1662,7 +1677,7 @@ examples: user_id: "" responses: "200": - application/json: {"key": "", "key1": ""} + application/json: {"object": "", "id": "", "secret": "", "uri": "https://creamy-merit.net", "verified": false, "key": "", "key1": ""} "403": application/json: {"errors": []} DeleteTOTP: @@ -1673,6 +1688,7 @@ examples: responses: "404": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} DeleteExternalAccount: speakeasy-default-delete-external-account: parameters: @@ -1723,6 +1739,7 @@ examples: responses: "400": application/json: {"errors": []} + "200": {} ListOrganizationInvitations: speakeasy-default-list-organization-invitations: parameters: @@ -1743,7 +1760,7 @@ examples: application/json: [] responses: "200": - application/json: {"total_count": 932144} + application/json: {"data": [], "total_count": 932144} "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} ListPendingOrganizationInvitations: @@ -1766,6 +1783,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} RevokeOrganizationInvitation: speakeasy-default-revoke-organization-invitation: parameters: @@ -1775,21 +1793,25 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} ListAllowlistIdentifiers: speakeasy-default-list-allowlist-identifiers: responses: "401": application/json: {"errors": []} + "200": {} CreateAllowlistIdentifier: speakeasy-default-create-allowlist-identifier: responses: "400": application/json: {"errors": []} + "200": {} CreateBlocklistIdentifier: speakeasy-default-create-blocklist-identifier: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} + "200": {} DeleteBlocklistIdentifier: speakeasy-default-delete-blocklist-identifier: parameters: @@ -1822,6 +1844,7 @@ examples: responses: "402": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} UpdateProductionInstanceDomain: speakeasy-default-update-production-instance-domain: responses: @@ -1893,6 +1916,7 @@ examples: responses: "402": application/json: {"errors": []} + "200": {} UpdateInstanceOrganizationSettings: speakeasy-default-update-instance-organization-settings: responses: @@ -2046,6 +2070,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} + "200": {} ListOrganizationMemberships: speakeasy-default-list-organization-memberships: parameters: @@ -2068,6 +2093,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} DeleteOrganizationMembership: speakeasy-default-delete-organization-membership: parameters: @@ -2077,6 +2103,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} UpdateOrganizationMembershipMetadata: speakeasy-default-update-organization-membership-metadata: parameters: @@ -2086,6 +2113,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} InstanceGetOrganizationMemberships: speakeasy-default-instance-get-organization-memberships: responses: @@ -2101,6 +2129,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} + "200": {} ListOrganizationDomains: speakeasy-default-list-organization-domains: parameters: @@ -2132,6 +2161,7 @@ examples: responses: "400": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} + "200": {} VerifyDomainProxy: speakeasy-default-verify-domain-proxy: responses: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c1a1d0b..95bccd9 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false java: - version: 1.0.0 + version: 1.2.0 additionalDependencies: [] additionalPlugins: [] artifactID: backend-api @@ -21,6 +21,7 @@ java: companyEmail: info@mycompany.com companyName: My Company companyURL: www.mycompany.com + defaultErrorName: SDKError flattenGlobalSecurity: true githubURL: github.com/owner/repo groupID: com.clerk diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 08dd63b..d0dfcbc 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.428.0 +speakeasyVersion: 1.437.0 sources: clerk-java-sdk: sourceNamespace: clerk-java-sdk - sourceRevisionDigest: sha256:b654e43e024e196fe7824140a1352efa4a12b63d9fda5373be91d01780dcd4b2 - sourceBlobDigest: sha256:b7d68649cec7493887787a96c7bc78466ced094c923f7bdbf6f7600aa86e3b3a + sourceRevisionDigest: sha256:1a486565939833e7da8fd89f4dca29e4ca17f28654e44085a3363f0f1e440eeb + sourceBlobDigest: sha256:3a79bd76a35cec51d82efcdad7c5fffff14db6ed394011e299ac78c2f6159e12 tags: - latest - main @@ -11,10 +11,10 @@ targets: clerk-java: source: clerk-java-sdk sourceNamespace: clerk-java-sdk - sourceRevisionDigest: sha256:b654e43e024e196fe7824140a1352efa4a12b63d9fda5373be91d01780dcd4b2 - sourceBlobDigest: sha256:b7d68649cec7493887787a96c7bc78466ced094c923f7bdbf6f7600aa86e3b3a + sourceRevisionDigest: sha256:1a486565939833e7da8fd89f4dca29e4ca17f28654e44085a3363f0f1e440eeb + sourceBlobDigest: sha256:3a79bd76a35cec51d82efcdad7c5fffff14db6ed394011e299ac78c2f6159e12 codeSamplesNamespace: clerk-java-sdk-code-samples - codeSamplesRevisionDigest: sha256:b018b9dd693908629edb929f8bf30c507fa87d0d14227cd6ba0f5c857cd15bfe + codeSamplesRevisionDigest: sha256:d767573120892d3ab715b3145a54847f35113612c3817bacc394d4b02e93896d my-first-target: source: clerk-java-sdk sourceNamespace: clerk-java-sdk @@ -26,7 +26,7 @@ workflow: sources: clerk-java-sdk: inputs: - - location: https://raw.githubusercontent.com/clerk/openapi-specs/refs/heads/main/bapi/2021-02-05.yml + - location: https://raw.githubusercontent.com/clerk/openapi-specs/refs/heads/main/bapi/2024-10-01.yml overlays: - location: fixes.yml - location: .speakeasy/speakeasy-suggestions.yaml diff --git a/README.md b/README.md index da83d1d..c6b970c 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.clerk:backend-api:1.0.0' +implementation 'com.clerk:backend-api:1.2.0' ``` Maven: @@ -55,7 +55,7 @@ Maven: com.clerk backend-api - 1.0.0 + 1.2.0 ``` @@ -346,10 +346,10 @@ Handling errors in this SDK should largely match your expectations. All operatio By default, an API error will throw a `models/errors/SDKError` exception. When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `verify` method throws the following exceptions: -| Error Type | Status Code | Content Type | -| ------------------------- | ------------------------- | ------------------------- | -| models/errors/ClerkErrors | 400, 401, 404 | application/json | -| models/errors/SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------------- | ------------- | ---------------- | +| models/errors/ClerkErrors | 400, 401, 404 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | ### Example @@ -388,45 +388,9 @@ public class Application { ## Server Selection -### Select Server by Index - -You can override the default server globally by passing a server index to the `serverIndex` builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: - -| # | Server | Variables | -| - | ------ | --------- | -| 0 | `https://api.clerk.com/v1` | None | - -#### Example - -```java -package hello.world; - -import com.clerk.backend_api.Clerk; -import com.clerk.backend_api.models.operations.GetPublicInterstitialResponse; -import java.lang.Exception; - -public class Application { - - public static void main(String[] args) throws Exception { - - Clerk sdk = Clerk.builder() - .serverIndex(0) - .build(); - - GetPublicInterstitialResponse res = sdk.miscellaneous().getInterstitial() - .frontendApi("") - .publishableKey("") - .call(); - - // handle response - } -} -``` - - ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverURL` builder method when initializing the SDK client instance. For example: +The default server can also be overridden globally using the `.serverURL(String serverUrl)` builder method when initializing the SDK client instance. For example: ```java package hello.world; @@ -460,9 +424,9 @@ public class Application { This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ------------ | ------------ | ------------ | -| `bearerAuth` | http | HTTP Bearer | +| Name | Type | Scheme | +| ------------ | ---- | ----------- | +| `bearerAuth` | http | HTTP Bearer | To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example: ```java diff --git a/RELEASES.md b/RELEASES.md index 7927c33..1d3b651 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -148,4 +148,14 @@ Based on: ### Generated - [java v1.0.0] . ### Releases -- [Maven Central v1.0.0] https://central.sonatype.com/artifact/com.clerk/backend-api/1.0.0 - . \ No newline at end of file +- [Maven Central v1.0.0] https://central.sonatype.com/artifact/com.clerk/backend-api/1.0.0 - . + +## 2024-11-11 15:44:46 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.437.0 (2.456.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v1.2.0] . +### Releases +- [Maven Central v1.2.0] https://central.sonatype.com/artifact/com.clerk/backend-api/1.2.0 - . \ No newline at end of file diff --git a/build.gradle b/build.gradle index fd1c506..aa39a35 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ tasks.withType(Javadoc) { } group = "com.clerk" -version = "1.0.0" +version = "1.2.0" sourcesJar { archiveBaseName = "backend-api" @@ -101,7 +101,7 @@ publishing { maven(MavenPublication) { groupId = 'com.clerk' artifactId = 'backend-api' - version = '1.0.0' + version = '1.2.0' from components.java diff --git a/docs/models/components/Totp.md b/docs/models/components/Totp.md new file mode 100644 index 0000000..8075e26 --- /dev/null +++ b/docs/models/components/Totp.md @@ -0,0 +1,16 @@ +# Totp + +A TOTP (Time-based One-Time Password) + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `object` | *String* | :heavy_check_mark: | N/A | +| `id` | *String* | :heavy_check_mark: | N/A | +| `secret` | *Optional\* | :heavy_check_mark: | N/A | +| `uri` | *Optional\* | :heavy_check_mark: | N/A | +| `verified` | *boolean* | :heavy_check_mark: | N/A | +| `backupCodes` | List\<*String*> | :heavy_minus_sign: | N/A | +| `additionalProperties` | Map\ | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/Type.md b/docs/models/components/Type.md index 6831d91..0b695ff 100644 --- a/docs/models/components/Type.md +++ b/docs/models/components/Type.md @@ -3,10 +3,12 @@ ## Values -| Name | Value | -| --------------- | --------------- | -| `OAUTH_GOOGLE` | oauth_google | -| `OAUTH_MOCK` | oauth_mock | -| `SAML` | saml | -| `OAUTH_APPLE` | oauth_apple | -| `OAUTH_DISCORD` | oauth_discord | \ No newline at end of file +| Name | Value | +| ----------------- | ----------------- | +| `OAUTH_GOOGLE` | oauth_google | +| `OAUTH_MOCK` | oauth_mock | +| `SAML` | saml | +| `OAUTH_MICROSOFT` | oauth_microsoft | +| `EMAIL_LINK` | email_link | +| `OAUTH_APPLE` | oauth_apple | +| `OAUTH_DISCORD` | oauth_discord | \ No newline at end of file diff --git a/docs/models/operations/CreateUserTOTPResponse.md b/docs/models/operations/CreateUserTOTPResponse.md index 324e230..fceb4c6 100644 --- a/docs/models/operations/CreateUserTOTPResponse.md +++ b/docs/models/operations/CreateUserTOTPResponse.md @@ -8,4 +8,4 @@ | `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 | -| `totp` | Map\ | :heavy_minus_sign: | A TOTP (Time-based One-Time Password) | \ No newline at end of file +| `totp` | [Optional\](../../models/components/Totp.md) | :heavy_minus_sign: | A TOTP (Time-based One-Time Password) | \ No newline at end of file diff --git a/src/main/java/com/clerk/backend_api/SDKConfiguration.java b/src/main/java/com/clerk/backend_api/SDKConfiguration.java index 7cdae40..2c62f0b 100644 --- a/src/main/java/com/clerk/backend_api/SDKConfiguration.java +++ b/src/main/java/com/clerk/backend_api/SDKConfiguration.java @@ -23,8 +23,8 @@ public Optional securitySource() { public int serverIdx = 0; private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "v1"; - public static final String SDK_VERSION = "1.0.0"; - public static final String GEN_VERSION = "2.447.4"; + public static final String SDK_VERSION = "1.2.0"; + public static final String GEN_VERSION = "2.456.0"; private static final String BASE_PACKAGE = "com.clerk.backend_api"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/clerk/backend_api/Users.java b/src/main/java/com/clerk/backend_api/Users.java index 9172d5f..fd76b36 100644 --- a/src/main/java/com/clerk/backend_api/Users.java +++ b/src/main/java/com/clerk/backend_api/Users.java @@ -8,6 +8,7 @@ import com.clerk.backend_api.models.components.OrganizationInvitationsWithPublicOrganizationData; import com.clerk.backend_api.models.components.OrganizationMemberships; import com.clerk.backend_api.models.components.TotalCount; +import com.clerk.backend_api.models.components.Totp; import com.clerk.backend_api.models.components.User; import com.clerk.backend_api.models.errors.ClerkErrors; import com.clerk.backend_api.models.errors.SDKError; @@ -116,7 +117,6 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.util.List; -import java.util.Map; import java.util.Optional; /** @@ -3532,9 +3532,9 @@ public CreateUserTOTPResponse createTOTP( if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { if (Utils.contentTypeMatches(_contentType, "application/json")) { - Map _out = Utils.mapper().readValue( + Totp _out = Utils.mapper().readValue( Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference>() {}); + new TypeReference() {}); _res.withTotp(Optional.ofNullable(_out)); return _res; } else { diff --git a/src/main/java/com/clerk/backend_api/models/components/Totp.java b/src/main/java/com/clerk/backend_api/models/components/Totp.java new file mode 100644 index 0000000..b024497 --- /dev/null +++ b/src/main/java/com/clerk/backend_api/models/components/Totp.java @@ -0,0 +1,341 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package com.clerk.backend_api.models.components; + + +import com.clerk.backend_api.utils.Utils; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +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 java.lang.Boolean; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Totp - A TOTP (Time-based One-Time Password) + */ + +public class Totp { + + @JsonProperty("object") + private String object; + + @JsonProperty("id") + private String id; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("secret") + private Optional secret; + + @JsonInclude(Include.ALWAYS) + @JsonProperty("uri") + private Optional uri; + + @JsonProperty("verified") + private boolean verified; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("backup_codes") + private JsonNullable> backupCodes; + + @JsonIgnore + private Map additionalProperties; + + @JsonCreator + public Totp( + @JsonProperty("object") String object, + @JsonProperty("id") String id, + @JsonProperty("secret") Optional secret, + @JsonProperty("uri") Optional uri, + @JsonProperty("verified") boolean verified, + @JsonProperty("backup_codes") JsonNullable> backupCodes) { + Utils.checkNotNull(object, "object"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(secret, "secret"); + Utils.checkNotNull(uri, "uri"); + Utils.checkNotNull(verified, "verified"); + Utils.checkNotNull(backupCodes, "backupCodes"); + this.object = object; + this.id = id; + this.secret = secret; + this.uri = uri; + this.verified = verified; + this.backupCodes = backupCodes; + this.additionalProperties = new HashMap<>(); + } + + public Totp( + String object, + String id, + boolean verified) { + this(object, id, Optional.empty(), Optional.empty(), verified, JsonNullable.undefined()); + } + + @JsonIgnore + public String object() { + return object; + } + + @JsonIgnore + public String id() { + return id; + } + + @JsonIgnore + public Optional secret() { + return secret; + } + + @JsonIgnore + public Optional uri() { + return uri; + } + + @JsonIgnore + public boolean verified() { + return verified; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> backupCodes() { + return (JsonNullable>) backupCodes; + } + + @JsonAnyGetter + public Map additionalProperties() { + return additionalProperties; + } + + public final static Builder builder() { + return new Builder(); + } + + public Totp withObject(String object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public Totp withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Totp withSecret(String secret) { + Utils.checkNotNull(secret, "secret"); + this.secret = Optional.ofNullable(secret); + return this; + } + + public Totp withSecret(Optional secret) { + Utils.checkNotNull(secret, "secret"); + this.secret = secret; + return this; + } + + public Totp withUri(String uri) { + Utils.checkNotNull(uri, "uri"); + this.uri = Optional.ofNullable(uri); + return this; + } + + public Totp withUri(Optional uri) { + Utils.checkNotNull(uri, "uri"); + this.uri = uri; + return this; + } + + public Totp withVerified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + public Totp withBackupCodes(List backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = JsonNullable.of(backupCodes); + return this; + } + + public Totp withBackupCodes(JsonNullable> backupCodes) { + Utils.checkNotNull(backupCodes, "backupCodes"); + this.backupCodes = backupCodes; + return this; + } + + @JsonAnySetter + public Totp withAdditionalProperty(String key, Object value) { + // note that value can be null because of the way JsonAnySetter works + Utils.checkNotNull(key, "key"); + additionalProperties.put(key, value); + return this; + } + + public Totp withAdditionalProperties(Map additionalProperties) { + Utils.checkNotNull(additionalProperties, "additionalProperties"); + this.additionalProperties = additionalProperties; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Totp other = (Totp) o; + return + Objects.deepEquals(this.object, other.object) && + Objects.deepEquals(this.id, other.id) && + Objects.deepEquals(this.secret, other.secret) && + Objects.deepEquals(this.uri, other.uri) && + Objects.deepEquals(this.verified, other.verified) && + Objects.deepEquals(this.backupCodes, other.backupCodes) && + Objects.deepEquals(this.additionalProperties, other.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + object, + id, + secret, + uri, + verified, + backupCodes, + additionalProperties); + } + + @Override + public String toString() { + return Utils.toString(Totp.class, + "object", object, + "id", id, + "secret", secret, + "uri", uri, + "verified", verified, + "backupCodes", backupCodes, + "additionalProperties", additionalProperties); + } + + public final static class Builder { + + private String object; + + private String id; + + private Optional secret = Optional.empty(); + + private Optional uri = Optional.empty(); + + private Boolean verified; + + private JsonNullable> backupCodes = JsonNullable.undefined(); + + private Map additionalProperties = new HashMap<>(); + + 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 = id; + return this; + } + + public Builder secret(String secret) { + Utils.checkNotNull(secret, "secret"); + this.secret = Optional.ofNullable(secret); + return this; + } + + public Builder secret(Optional secret) { + Utils.checkNotNull(secret, "secret"); + this.secret = secret; + return this; + } + + public Builder uri(String uri) { + Utils.checkNotNull(uri, "uri"); + this.uri = Optional.ofNullable(uri); + return this; + } + + public Builder uri(Optional uri) { + Utils.checkNotNull(uri, "uri"); + this.uri = uri; + return this; + } + + public Builder verified(boolean verified) { + Utils.checkNotNull(verified, "verified"); + this.verified = verified; + return this; + } + + public Builder backupCodes(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; + } + + public Builder additionalProperty(String key, Object value) { + Utils.checkNotNull(key, "key"); + // we could be strict about null values (force the user + // to pass `JsonNullable.of(null)`) but likely to be a bit + // annoying for additional properties building so we'll + // relax preconditions. + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + Utils.checkNotNull(additionalProperties, "additionalProperties"); + this.additionalProperties = additionalProperties; + return this; + } + + public Totp build() { + return new Totp( + object, + id, + secret, + uri, + verified, + backupCodes) + .withAdditionalProperties(additionalProperties); + } + } +} + 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 index 99350c8..c4056de 100644 --- a/src/main/java/com/clerk/backend_api/models/components/Type.java +++ b/src/main/java/com/clerk/backend_api/models/components/Type.java @@ -11,6 +11,8 @@ public enum Type { OAUTH_GOOGLE("oauth_google"), OAUTH_MOCK("oauth_mock"), SAML("saml"), + OAUTH_MICROSOFT("oauth_microsoft"), + EMAIL_LINK("email_link"), OAUTH_APPLE("oauth_apple"), OAUTH_DISCORD("oauth_discord"); diff --git a/src/main/java/com/clerk/backend_api/models/operations/CreateUserTOTPResponse.java b/src/main/java/com/clerk/backend_api/models/operations/CreateUserTOTPResponse.java index e814161..7f7a70e 100644 --- a/src/main/java/com/clerk/backend_api/models/operations/CreateUserTOTPResponse.java +++ b/src/main/java/com/clerk/backend_api/models/operations/CreateUserTOTPResponse.java @@ -5,18 +5,17 @@ package com.clerk.backend_api.models.operations; +import com.clerk.backend_api.models.components.Totp; import com.clerk.backend_api.utils.Response; import com.clerk.backend_api.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import java.io.InputStream; import java.lang.Integer; -import java.lang.Object; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -41,14 +40,14 @@ public class CreateUserTOTPResponse implements Response { /** * A TOTP (Time-based One-Time Password) */ - private Optional> totp; + private Optional totp; @JsonCreator public CreateUserTOTPResponse( String contentType, int statusCode, HttpResponse rawResponse, - Optional> totp) { + Optional totp) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); @@ -95,8 +94,8 @@ public HttpResponse rawResponse() { */ @SuppressWarnings("unchecked") @JsonIgnore - public Optional> totp() { - return (Optional>) totp; + public Optional totp() { + return (Optional) totp; } public final static Builder builder() { @@ -133,7 +132,7 @@ public CreateUserTOTPResponse withRawResponse(HttpResponse rawRespo /** * A TOTP (Time-based One-Time Password) */ - public CreateUserTOTPResponse withTotp(Map totp) { + public CreateUserTOTPResponse withTotp(Totp totp) { Utils.checkNotNull(totp, "totp"); this.totp = Optional.ofNullable(totp); return this; @@ -142,7 +141,7 @@ public CreateUserTOTPResponse withTotp(Map totp) { /** * A TOTP (Time-based One-Time Password) */ - public CreateUserTOTPResponse withTotp(Optional> totp) { + public CreateUserTOTPResponse withTotp(Optional totp) { Utils.checkNotNull(totp, "totp"); this.totp = totp; return this; @@ -190,7 +189,7 @@ public final static class Builder { private HttpResponse rawResponse; - private Optional> totp = Optional.empty(); + private Optional totp = Optional.empty(); private Builder() { // force use of static builder() method @@ -226,7 +225,7 @@ public Builder rawResponse(HttpResponse rawResponse) { /** * A TOTP (Time-based One-Time Password) */ - public Builder totp(Map totp) { + public Builder totp(Totp totp) { Utils.checkNotNull(totp, "totp"); this.totp = Optional.ofNullable(totp); return this; @@ -235,7 +234,7 @@ public Builder totp(Map totp) { /** * A TOTP (Time-based One-Time Password) */ - public Builder totp(Optional> totp) { + public Builder totp(Optional totp) { Utils.checkNotNull(totp, "totp"); this.totp = totp; return this;