diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2337c46..13b18dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,10 @@ on: - development tags: - 'v[0-9]+.[0-9]+.[0-9]+*' + paths-ignore: + - '**/*.md' # Ignore markdown files + - '**/LICENSE' + - 'scripts/**' pull_request: branches: - main @@ -23,6 +27,7 @@ on: jobs: build: + if: "!startsWith(github.event.head_commit.message, 'style:') && !startsWith(github.event.head_commit.message, 'docs:')" #do not run workflow on style or documentation changes name: Build runs-on: ubuntu-latest @@ -38,7 +43,7 @@ jobs: architecture: x64 - name: Cache Maven dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/src/**') }} @@ -57,12 +62,13 @@ jobs: - name: Save Maven build artifacts if: success() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: maven-artifacts path: target/ test: + if: "!startsWith(github.event.head_commit.message, 'style:') && !startsWith(github.event.head_commit.message, 'docs:')" #do not run workflow on style or documentation changes name: Test runs-on: ubuntu-latest needs: build # Ensure build job runs before this one @@ -77,7 +83,7 @@ jobs: uses: actions/checkout@v4 - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: maven-artifacts @@ -89,7 +95,7 @@ jobs: architecture: x64 - name: Cache Maven dependencies for tests - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/src/**') }} @@ -98,9 +104,10 @@ jobs: - name: Run test suite env: - CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }} - CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }} - CORBADO_BACKEND_API: ${{ vars.CORBADO_BACKEND_API }} + CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }} + CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }} + CORBADO_FRONTEND_API: ${{ vars.CORBADO_FRONTEND_API }} + CORBADO_BACKEND_API: ${{ vars.CORBADO_BACKEND_API }} run: mvn --batch-mode --update-snapshots verify -DskipInstall deploy: @@ -114,7 +121,7 @@ jobs: uses: actions/checkout@v4 - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: maven-artifacts @@ -128,7 +135,7 @@ jobs: server-id: central - name: Cache Maven dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/src/**') }} diff --git a/README.md b/README.md index 05e7bc5..c2f27b7 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ You can find the latest SDK version at [central repository](https://repo1.maven. Add this dependency to your project's build file: ```groovy -implementation "com.corbado:corbado-java:1.0.4" +implementation "com.corbado:corbado-java:2.0.0b" ``` #### Maven users @@ -38,7 +38,7 @@ Add this dependency to your project's POM: com.corbado corbado-java - 1.0.4 + 2.0.0b ``` diff --git a/VERSION b/VERSION index a6a3a43..a8949c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.4 \ No newline at end of file +2.0.0b \ No newline at end of file diff --git a/pom.xml b/pom.xml index 07eebb5..1d0ffec 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.corbado corbado-java jar - 1.0.4 + 2.0.0b Corbado Java Corbado Java SDK https://github.com/corbado/corbado-java diff --git a/src/main/java/com/corbado/entities/SessionValidationResult.java b/src/main/java/com/corbado/entities/SessionValidationResult.java deleted file mode 100644 index 52e8731..0000000 --- a/src/main/java/com/corbado/entities/SessionValidationResult.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.corbado.entities; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -/** Result class for SessionService validation. */ -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor - -/** - * The Class SessionValidationResultBuilder. - */ -@Builder -public class SessionValidationResult { - - /** The user ID. */ - private String userID; - - /** The full name. */ - private String fullName; - - /** The error. */ - private Exception error; -} diff --git a/src/main/java/com/corbado/enums/exception/ValidationErrorType.java b/src/main/java/com/corbado/enums/exception/ValidationErrorType.java new file mode 100644 index 0000000..f66ccb6 --- /dev/null +++ b/src/main/java/com/corbado/enums/exception/ValidationErrorType.java @@ -0,0 +1,65 @@ +package com.corbado.enums.exception; + +import com.corbado.exceptions.TokenValidationException; + +/** + * Enumeration representing different types of validation errors that can occur during token + * validation. + * + *

This enum is used by the {@link TokenValidationException} to categorize and describe specific + * validation failures that occur when validating JWT tokens. Each error type has a human-readable + * description that explains the nature of the validation failure. + * + *

The validation errors cover various aspects of token validation including: + * + *

+ * + * @see com.corbado.exceptions.TokenValidationException + */ +public enum ValidationErrorType { + + /** Indicates that the token is malformed or invalid in some way. */ + CODE_INVALID_TOKEN("Invalid token"), + /** Indicates that the session token is empty or null. */ + CODE_EMPTY_SESSION_TOKEN("Session token is empty"), + /** Indicates that the token's issuer claim is missing or empty. */ + CODE_EMPTY_ISSUER("Issuer is empty"), + /** Indicates that the token's "not before" (nbf) claim indicates the token is not yet valid. */ + CODE_JWT_BEFORE("Token is not valid yet"), + /** Indicates that the token has expired according to its "expiration" (exp) claim. */ + CODE_JWT_EXPIRED("Token is expired"), + /** Indicates that the public key used for signature verification is invalid. */ + CODE_INVALID_PUBLIC_KEY("Public key is invalid"), + /** Indicates that the token's signature verification failed. */ + CODE_JWT_INVALID_SIGNATURE("Token signature is invalid"), + /** Indicates that the token's issuer doesn't match the expected issuer. */ + CODE_ISSUER_MISSMATCH("Token issuer does not match"); + + /** The human-readable description of the validation error. */ + private final String description; + + /** + * Constructs a new validation error type with the specified description. + * + * @param description a human-readable description of the validation error + */ + ValidationErrorType(final String description) { + this.description = description; + } + + /** + * Returns the human-readable description of the validation error. + * + * @return the description of the validation error + */ + @Override + public String toString() { + return this.description; + } +} diff --git a/src/main/java/com/corbado/exceptions/CorbadoServerException.java b/src/main/java/com/corbado/exceptions/CorbadoServerException.java index 734e352..048fea3 100644 --- a/src/main/java/com/corbado/exceptions/CorbadoServerException.java +++ b/src/main/java/com/corbado/exceptions/CorbadoServerException.java @@ -1,12 +1,10 @@ package com.corbado.exceptions; +import com.corbado.generated.invoker.ApiException; +import com.google.gson.Gson; import java.util.Collections; import java.util.List; import java.util.Optional; - -import com.corbado.generated.invoker.ApiException; -import com.google.gson.Gson; - import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; diff --git a/src/main/java/com/corbado/exceptions/TokenValidationException.java b/src/main/java/com/corbado/exceptions/TokenValidationException.java new file mode 100644 index 0000000..14130af --- /dev/null +++ b/src/main/java/com/corbado/exceptions/TokenValidationException.java @@ -0,0 +1,67 @@ +package com.corbado.exceptions; + +import com.corbado.enums.exception.ValidationErrorType; +import lombok.Getter; + +/** + * TokenValidationException is a custom exception used to indicate issues during token validation. + * This exception is typically thrown when the token's issuer, format, or other key attributes do + * not meet the expected validation criteria. + * + *

This exception wraps a specific {@link ValidationErrorType} enum value to categorize the type + * of validation error encountered, and it provides a descriptive message detailing the reason for + * the exception. Additionally, it can wrap an underlying exception that caused the validation + * failure, allowing for more detailed error tracing. + * + *

Typical usage includes handling invalid token attributes, such as missing or mismatched + * issuers, empty tokens, or other validation failures. + * + *

Example usage: + * + *

{@code
+ * try {
+ *     validateToken(token);
+ * } catch (SomeOtherException e) {
+ *     throw new TokenValidationException(ValidationErrorType.ISSUER_MISMATCH,
+ *         "Issuer mismatch (configured issuer: 'expected.com', JWT issuer: 'actual.com')", e);
+ * }
+ * }
+ * + * @see ValidationErrorType + */ +public class TokenValidationException extends RuntimeException { + + /** The Constant serialVersionUID. */ + @Getter private static final long serialVersionUID = -2978676337061777870L; + + /** The error type. */ + @Getter private final ValidationErrorType errorType; + + /** + * Constructs a new TokenValidationException with a specified error type, a detailed message, and + * an optional original exception that caused this validation failure. + * + * @param errorType the type of validation error encountered, represented by {@link + * ValidationErrorType} + * @param message a descriptive message providing additional context for the validation error + * @param cause the original exception that caused this validation failure, if any + */ + public TokenValidationException( + final ValidationErrorType errorType, final String message, final Throwable cause) { + super(message, cause); + this.errorType = errorType; + } + + /** + * Constructs a new TokenValidationException with a specified error type and detailed message, + * without an underlying cause. + * + * @param errorType the type of validation error encountered, represented by {@link + * ValidationErrorType} + * @param message a descriptive message providing additional context for the validation error + */ + public TokenValidationException(final ValidationErrorType errorType, final String message) { + super(message); + this.errorType = errorType; + } +} diff --git a/src/main/java/com/corbado/generated/api/AuthEventsApi.java b/src/main/java/com/corbado/generated/api/AuthEventsApi.java index 4e72970..b3f6759 100644 --- a/src/main/java/com/corbado/generated/api/AuthEventsApi.java +++ b/src/main/java/com/corbado/generated/api/AuthEventsApi.java @@ -82,7 +82,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+ @@ -158,7 +159,8 @@ private okhttp3.Call authEventCreateValidateBeforeCall(String userID, AuthEventC * @return AuthEvent * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Auth event has been created -
0 Error -
+
+ @@ -177,7 +179,8 @@ public AuthEvent authEventCreate(String userID, AuthEventCreateReq authEventCrea * @return ApiResponse<AuthEvent> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Auth event has been created -
0 Error -
+
+ @@ -198,7 +201,8 @@ public ApiResponse authEventCreateWithHttpInfo(String userID, AuthEve * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Auth event has been created -
0 Error -
+
+ diff --git a/src/main/java/com/corbado/generated/api/ChallengesApi.java b/src/main/java/com/corbado/generated/api/ChallengesApi.java index 0ce2724..5892e02 100644 --- a/src/main/java/com/corbado/generated/api/ChallengesApi.java +++ b/src/main/java/com/corbado/generated/api/ChallengesApi.java @@ -83,7 +83,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Auth event has been created -
0 Error -
+
+ @@ -159,7 +160,8 @@ private okhttp3.Call challengeCreateValidateBeforeCall(String userID, ChallengeC * @return Challenge * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Challenge has been created -
0 Error -
+
+ @@ -178,7 +180,8 @@ public Challenge challengeCreate(String userID, ChallengeCreateReq challengeCrea * @return ApiResponse<Challenge> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Challenge has been created -
0 Error -
+
+ @@ -199,7 +202,8 @@ public ApiResponse challengeCreateWithHttpInfo(String userID, Challen * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Challenge has been created -
0 Error -
+
+ @@ -221,7 +225,8 @@ public okhttp3.Call challengeCreateAsync(String userID, ChallengeCreateReq chall * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Challenge has been created -
0 Error -
+
+ @@ -304,7 +309,8 @@ private okhttp3.Call challengeUpdateValidateBeforeCall(String userID, String cha * @return Challenge * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Challenge has been updated -
0 Error -
+
+ @@ -324,7 +330,8 @@ public Challenge challengeUpdate(String userID, String challengeID, ChallengeUpd * @return ApiResponse<Challenge> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Challenge has been updated -
0 Error -
+
+ @@ -346,7 +353,8 @@ public ApiResponse challengeUpdateWithHttpInfo(String userID, String * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Challenge has been updated -
0 Error -
+
+ diff --git a/src/main/java/com/corbado/generated/api/ConnectTokensApi.java b/src/main/java/com/corbado/generated/api/ConnectTokensApi.java index 167f137..33c59b4 100644 --- a/src/main/java/com/corbado/generated/api/ConnectTokensApi.java +++ b/src/main/java/com/corbado/generated/api/ConnectTokensApi.java @@ -84,7 +84,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Challenge has been updated -
0 Error -
+
+ @@ -153,7 +154,8 @@ private okhttp3.Call connectTokenCreateValidateBeforeCall(ConnectTokenCreateReq * @return ConnectToken * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Connect token has been created -
0 Error -
+
+ @@ -171,7 +173,8 @@ public ConnectToken connectTokenCreate(ConnectTokenCreateReq connectTokenCreateR * @return ApiResponse<ConnectToken> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Connect token has been created -
0 Error -
+
+ @@ -191,7 +194,8 @@ public ApiResponse connectTokenCreateWithHttpInfo(ConnectTokenCrea * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Connect token has been created -
0 Error -
+
+ @@ -211,7 +215,8 @@ public okhttp3.Call connectTokenCreateAsync(ConnectTokenCreateReq connectTokenCr * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Connect token has been created -
0 Error -
+
+ @@ -280,7 +285,8 @@ private okhttp3.Call connectTokenDeleteValidateBeforeCall(String connectTokenID, * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -298,7 +304,8 @@ public GenericRsp connectTokenDelete(String connectTokenID) throws ApiException * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -318,7 +325,8 @@ public ApiResponse connectTokenDeleteWithHttpInfo(String connectToke * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -341,7 +349,8 @@ public okhttp3.Call connectTokenDeleteAsync(String connectTokenID, final ApiCall * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -423,7 +432,8 @@ private okhttp3.Call connectTokenListValidateBeforeCall(String sort, List +
Response Details
Status Code Description Response Headers
200 List of all matching append tokens -
0 Error -
+ @@ -444,7 +454,8 @@ public ConnectTokenList connectTokenList(String sort, List filter, Integ * @return ApiResponse<ConnectTokenList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching append tokens -
0 Error -
+
+ @@ -467,7 +478,8 @@ public ApiResponse connectTokenListWithHttpInfo(String sort, L * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching append tokens -
0 Error -
+
+ @@ -488,7 +500,8 @@ public okhttp3.Call connectTokenListAsync(String sort, List filter, Inte * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching append tokens -
0 Error -
+
+ @@ -564,7 +577,8 @@ private okhttp3.Call connectTokenUpdateValidateBeforeCall(String connectTokenID, * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -583,7 +597,8 @@ public GenericRsp connectTokenUpdate(String connectTokenID, ConnectTokenUpdateRe * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -604,7 +619,8 @@ public ApiResponse connectTokenUpdateWithHttpInfo(String connectToke * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ diff --git a/src/main/java/com/corbado/generated/api/IdentifiersApi.java b/src/main/java/com/corbado/generated/api/IdentifiersApi.java index 4383647..ed886ce 100644 --- a/src/main/java/com/corbado/generated/api/IdentifiersApi.java +++ b/src/main/java/com/corbado/generated/api/IdentifiersApi.java @@ -85,7 +85,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -161,7 +162,8 @@ private okhttp3.Call identifierCreateValidateBeforeCall(String userID, Identifie * @return Identifier * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Identifier has been created -
0 Error -
+
+ @@ -180,7 +182,8 @@ public Identifier identifierCreate(String userID, IdentifierCreateReq identifier * @return ApiResponse<Identifier> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Identifier has been created -
0 Error -
+
+ @@ -201,7 +204,8 @@ public ApiResponse identifierCreateWithHttpInfo(String userID, Ident * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Identifier has been created -
0 Error -
+
+ @@ -222,7 +226,8 @@ public okhttp3.Call identifierCreateAsync(String userID, IdentifierCreateReq ide * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Identifier has been created -
0 Error -
+
+ @@ -298,7 +303,8 @@ private okhttp3.Call identifierDeleteValidateBeforeCall(String userID, String id * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -317,7 +323,8 @@ public GenericRsp identifierDelete(String userID, String identifierID) throws Ap * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -338,7 +345,8 @@ public ApiResponse identifierDeleteWithHttpInfo(String userID, Strin * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -361,7 +369,8 @@ public okhttp3.Call identifierDeleteAsync(String userID, String identifierID, fi * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -443,7 +452,8 @@ private okhttp3.Call identifierListValidateBeforeCall(String sort, List * @return IdentifierList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching identifiers -
0 Error -
+
+ @@ -464,7 +474,8 @@ public IdentifierList identifierList(String sort, List filter, Integer p * @return ApiResponse<IdentifierList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching identifiers -
0 Error -
+
+ @@ -487,7 +498,8 @@ public ApiResponse identifierListWithHttpInfo(String sort, List< * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching identifiers -
0 Error -
+
+ @@ -509,7 +521,8 @@ public okhttp3.Call identifierListAsync(String sort, List filter, Intege * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching identifiers -
0 Error -
+
+ @@ -592,7 +605,8 @@ private okhttp3.Call identifierUpdateValidateBeforeCall(String userID, String id * @return Identifier * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Identifier has been updated -
0 Error -
+
+ @@ -612,7 +626,8 @@ public Identifier identifierUpdate(String userID, String identifierID, Identifie * @return ApiResponse<Identifier> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Identifier has been updated -
0 Error -
+
+ @@ -634,7 +649,8 @@ public ApiResponse identifierUpdateWithHttpInfo(String userID, Strin * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Identifier has been updated -
0 Error -
+
+ diff --git a/src/main/java/com/corbado/generated/api/PasskeyChallengesApi.java b/src/main/java/com/corbado/generated/api/PasskeyChallengesApi.java index 436139a..4141d15 100644 --- a/src/main/java/com/corbado/generated/api/PasskeyChallengesApi.java +++ b/src/main/java/com/corbado/generated/api/PasskeyChallengesApi.java @@ -86,7 +86,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Identifier has been updated -
0 Error -
+
+ @@ -175,7 +176,8 @@ private okhttp3.Call passkeyChallengeListValidateBeforeCall(String userID, Strin * @return PasskeyChallengeList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching passkey challenges -
0 Error -
+
+ @@ -197,7 +199,8 @@ public PasskeyChallengeList passkeyChallengeList(String userID, String sort, Lis * @return ApiResponse<PasskeyChallengeList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching passkey challenges -
0 Error -
+
+ @@ -221,7 +224,8 @@ public ApiResponse passkeyChallengeListWithHttpInfo(String * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching passkey challenges -
0 Error -
+
+ @@ -243,7 +247,8 @@ public okhttp3.Call passkeyChallengeListAsync(String userID, String sort, List +
Response Details
Status Code Description Response Headers
200 List of all matching passkey challenges -
0 Error -
+ @@ -326,7 +331,8 @@ private okhttp3.Call passkeyChallengeUpdateValidateBeforeCall(String userID, Str * @return PasskeyChallenge * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey challenge has been updated -
0 Error -
+
+ @@ -346,7 +352,8 @@ public PasskeyChallenge passkeyChallengeUpdate(String userID, String passkeyChal * @return ApiResponse<PasskeyChallenge> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey challenge has been updated -
0 Error -
+
+ @@ -368,7 +375,8 @@ public ApiResponse passkeyChallengeUpdateWithHttpInfo(String u * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey challenge has been updated -
0 Error -
+
+ diff --git a/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java b/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java index 01d209f..fd435b2 100644 --- a/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java +++ b/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java @@ -84,7 +84,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey challenge has been updated -
0 Error -
+
+ @@ -160,7 +161,8 @@ private okhttp3.Call passkeyEventCreateValidateBeforeCall(String userID, Passkey * @return PasskeyEvent * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey event has been created -
0 Error -
+
+ @@ -179,7 +181,8 @@ public PasskeyEvent passkeyEventCreate(String userID, PasskeyEventCreateReq pass * @return ApiResponse<PasskeyEvent> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey event has been created -
0 Error -
+
+ @@ -200,7 +203,8 @@ public ApiResponse passkeyEventCreateWithHttpInfo(String userID, P * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey event has been created -
0 Error -
+
+ @@ -221,7 +225,8 @@ public okhttp3.Call passkeyEventCreateAsync(String userID, PasskeyEventCreateReq * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey event has been created -
0 Error -
+
+ @@ -297,7 +302,8 @@ private okhttp3.Call passkeyEventDeleteValidateBeforeCall(String userID, String * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -316,7 +322,8 @@ public GenericRsp passkeyEventDelete(String userID, String passkeyEventID) throw * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -337,7 +344,8 @@ public ApiResponse passkeyEventDeleteWithHttpInfo(String userID, Str * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -361,7 +369,8 @@ public okhttp3.Call passkeyEventDeleteAsync(String userID, String passkeyEventID * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -450,7 +459,8 @@ private okhttp3.Call passkeyEventListValidateBeforeCall(String userID, String so * @return PasskeyEventList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching passkey events -
0 Error -
+
+ @@ -472,7 +482,8 @@ public PasskeyEventList passkeyEventList(String userID, String sort, List +
Response Details
Status Code Description Response Headers
200 List of all matching passkey events -
0 Error -
+ @@ -496,7 +507,8 @@ public ApiResponse passkeyEventListWithHttpInfo(String userID, * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching passkey events -
0 Error -
+
+ diff --git a/src/main/java/com/corbado/generated/api/PasskeysApi.java b/src/main/java/com/corbado/generated/api/PasskeysApi.java index c251b6c..e46752c 100644 --- a/src/main/java/com/corbado/generated/api/PasskeysApi.java +++ b/src/main/java/com/corbado/generated/api/PasskeysApi.java @@ -40,6 +40,8 @@ import com.corbado.generated.model.PasskeyMediationFinishRsp; import com.corbado.generated.model.PasskeyMediationStartReq; import com.corbado.generated.model.PasskeyMediationStartRsp; +import com.corbado.generated.model.PasskeyPostLoginReq; +import com.corbado.generated.model.PasskeyPostLoginRsp; import java.lang.reflect.Type; import java.util.ArrayList; @@ -91,7 +93,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of all matching passkey events -
0 Error -
+
+ @@ -160,7 +163,8 @@ private okhttp3.Call passkeyAppendFinishValidateBeforeCall(PasskeyAppendFinishRe * @return PasskeyAppendFinishRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey append succeeded -
0 Error -
+
+ @@ -178,7 +182,8 @@ public PasskeyAppendFinishRsp passkeyAppendFinish(PasskeyAppendFinishReq passkey * @return ApiResponse<PasskeyAppendFinishRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey append succeeded -
0 Error -
+
+ @@ -198,7 +203,8 @@ public ApiResponse passkeyAppendFinishWithHttpInfo(Passk * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey append succeeded -
0 Error -
+
+ @@ -218,7 +224,8 @@ public okhttp3.Call passkeyAppendFinishAsync(PasskeyAppendFinishReq passkeyAppen * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey append succeeded -
0 Error -
+
+ @@ -287,7 +294,8 @@ private okhttp3.Call passkeyAppendStartValidateBeforeCall(PasskeyAppendStartReq * @return PasskeyAppendStartRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey append challenge has been created -
0 Error -
+
+ @@ -305,7 +313,8 @@ public PasskeyAppendStartRsp passkeyAppendStart(PasskeyAppendStartReq passkeyApp * @return ApiResponse<PasskeyAppendStartRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey append challenge has been created -
0 Error -
+
+ @@ -325,7 +334,8 @@ public ApiResponse passkeyAppendStartWithHttpInfo(Passkey * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey append challenge has been created -
0 Error -
+
+ @@ -345,7 +355,8 @@ public okhttp3.Call passkeyAppendStartAsync(PasskeyAppendStartReq passkeyAppendS * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey append challenge has been created -
0 Error -
+
+ @@ -414,7 +425,8 @@ private okhttp3.Call passkeyLoginFinishValidateBeforeCall(PasskeyLoginFinishReq * @return PasskeyLoginFinishRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login succeeded -
0 Error -
+
+ @@ -432,7 +444,8 @@ public PasskeyLoginFinishRsp passkeyLoginFinish(PasskeyLoginFinishReq passkeyLog * @return ApiResponse<PasskeyLoginFinishRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login succeeded -
0 Error -
+
+ @@ -452,7 +465,8 @@ public ApiResponse passkeyLoginFinishWithHttpInfo(Passkey * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login succeeded -
0 Error -
+
+ @@ -472,7 +486,8 @@ public okhttp3.Call passkeyLoginFinishAsync(PasskeyLoginFinishReq passkeyLoginFi * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login succeeded -
0 Error -
+
+ @@ -541,7 +556,8 @@ private okhttp3.Call passkeyLoginStartValidateBeforeCall(PasskeyLoginStartReq pa * @return PasskeyLoginStartRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+
+ @@ -559,7 +575,8 @@ public PasskeyLoginStartRsp passkeyLoginStart(PasskeyLoginStartReq passkeyLoginS * @return ApiResponse<PasskeyLoginStartRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+
+ @@ -579,7 +596,8 @@ public ApiResponse passkeyLoginStartWithHttpInfo(PasskeyLo * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+
+ @@ -599,7 +617,8 @@ public okhttp3.Call passkeyLoginStartAsync(PasskeyLoginStartReq passkeyLoginStar * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+
+ @@ -668,7 +687,8 @@ private okhttp3.Call passkeyMediationFinishValidateBeforeCall(PasskeyMediationFi * @return PasskeyMediationFinishRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey mediation has been success, thus we can return a userID -
0 Error -
+
+ @@ -686,7 +706,8 @@ public PasskeyMediationFinishRsp passkeyMediationFinish(PasskeyMediationFinishRe * @return ApiResponse<PasskeyMediationFinishRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey mediation has been success, thus we can return a userID -
0 Error -
+
+ @@ -706,7 +727,8 @@ public ApiResponse passkeyMediationFinishWithHttpInfo * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey mediation has been success, thus we can return a userID -
0 Error -
+
+ @@ -726,7 +748,8 @@ public okhttp3.Call passkeyMediationFinishAsync(PasskeyMediationFinishReq passke * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey mediation has been success, thus we can return a userID -
0 Error -
+
+ @@ -795,7 +818,8 @@ private okhttp3.Call passkeyMediationStartValidateBeforeCall(PasskeyMediationSta * @return PasskeyMediationStartRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+
+ @@ -813,7 +837,8 @@ public PasskeyMediationStartRsp passkeyMediationStart(PasskeyMediationStartReq p * @return ApiResponse<PasskeyMediationStartRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+
+ @@ -833,7 +858,8 @@ public ApiResponse passkeyMediationStartWithHttpInfo(P * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+
+ @@ -846,4 +872,135 @@ public okhttp3.Call passkeyMediationStartAsync(PasskeyMediationStartReq passkeyM localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for passkeyPostLogin + * @param passkeyPostLoginReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details +
Response Details
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ + + + +
Response Details
Status Code Description Response Headers
200 Post Passkey Login succeeded -
0 Error -
+ */ + public okhttp3.Call passkeyPostLoginCall(PasskeyPostLoginReq passkeyPostLoginReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyPostLoginReq; + + // create path and map variables + String localVarPath = "/passkey/postLogin"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyPostLoginValidateBeforeCall(PasskeyPostLoginReq passkeyPostLoginReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyPostLoginReq' is set + if (passkeyPostLoginReq == null) { + throw new ApiException("Missing the required parameter 'passkeyPostLoginReq' when calling passkeyPostLogin(Async)"); + } + + return passkeyPostLoginCall(passkeyPostLoginReq, _callback); + + } + + /** + * + * Explicitly runs the post-login action + * @param passkeyPostLoginReq (required) + * @return PasskeyPostLoginRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Post Passkey Login succeeded -
0 Error -
+ */ + public PasskeyPostLoginRsp passkeyPostLogin(PasskeyPostLoginReq passkeyPostLoginReq) throws ApiException { + ApiResponse localVarResp = passkeyPostLoginWithHttpInfo(passkeyPostLoginReq); + return localVarResp.getData(); + } + + /** + * + * Explicitly runs the post-login action + * @param passkeyPostLoginReq (required) + * @return ApiResponse<PasskeyPostLoginRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Post Passkey Login succeeded -
0 Error -
+ */ + public ApiResponse passkeyPostLoginWithHttpInfo(PasskeyPostLoginReq passkeyPostLoginReq) throws ApiException { + okhttp3.Call localVarCall = passkeyPostLoginValidateBeforeCall(passkeyPostLoginReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Explicitly runs the post-login action + * @param passkeyPostLoginReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Post Passkey Login succeeded -
0 Error -
+ */ + public okhttp3.Call passkeyPostLoginAsync(PasskeyPostLoginReq passkeyPostLoginReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyPostLoginValidateBeforeCall(passkeyPostLoginReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/corbado/generated/api/PasswordManagersApi.java b/src/main/java/com/corbado/generated/api/PasswordManagersApi.java new file mode 100644 index 0000000..732ef2f --- /dev/null +++ b/src/main/java/com/corbado/generated/api/PasswordManagersApi.java @@ -0,0 +1,207 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.PasswordManagerList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PasswordManagersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PasswordManagersApi() { + this(Configuration.getDefaultApiClient()); + } + + public PasswordManagersApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for passwordManagerList + * @param userID ID of user (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 List of all matching password managers -
0 Error -
+ */ + public okhttp3.Call passwordManagerListCall(String userID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/passwordManagers" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordManagerListValidateBeforeCall(String userID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling passwordManagerList(Async)"); + } + + return passwordManagerListCall(userID, _callback); + + } + + /** + * + * Returns a list of password managers + * @param userID ID of user (required) + * @return PasswordManagerList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 List of all matching password managers -
0 Error -
+ */ + public PasswordManagerList passwordManagerList(String userID) throws ApiException { + ApiResponse localVarResp = passwordManagerListWithHttpInfo(userID); + return localVarResp.getData(); + } + + /** + * + * Returns a list of password managers + * @param userID ID of user (required) + * @return ApiResponse<PasswordManagerList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 List of all matching password managers -
0 Error -
+ */ + public ApiResponse passwordManagerListWithHttpInfo(String userID) throws ApiException { + okhttp3.Call localVarCall = passwordManagerListValidateBeforeCall(userID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of password managers + * @param userID ID of user (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 List of all matching password managers -
0 Error -
+ */ + public okhttp3.Call passwordManagerListAsync(String userID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordManagerListValidateBeforeCall(userID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/ProjectConfigApi.java b/src/main/java/com/corbado/generated/api/ProjectConfigApi.java index 4e191a1..5a2324c 100644 --- a/src/main/java/com/corbado/generated/api/ProjectConfigApi.java +++ b/src/main/java/com/corbado/generated/api/ProjectConfigApi.java @@ -81,7 +81,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+ @@ -150,7 +151,8 @@ private okhttp3.Call projectConfigUpdateCNAMEValidateBeforeCall(ProjectConfigUpd * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -168,7 +170,8 @@ public GenericRsp projectConfigUpdateCNAME(ProjectConfigUpdateCnameReq projectCo * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -188,7 +191,8 @@ public ApiResponse projectConfigUpdateCNAMEWithHttpInfo(ProjectConfi * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ diff --git a/src/main/java/com/corbado/generated/api/SessionsApi.java b/src/main/java/com/corbado/generated/api/SessionsApi.java index c27e5f5..620ff4a 100644 --- a/src/main/java/com/corbado/generated/api/SessionsApi.java +++ b/src/main/java/com/corbado/generated/api/SessionsApi.java @@ -28,11 +28,8 @@ import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.LongSession; -import com.corbado.generated.model.LongSessionCreateReq; -import com.corbado.generated.model.LongSessionUpdateReq; -import com.corbado.generated.model.ShortSession; -import com.corbado.generated.model.ShortSessionCreateReq; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.SessionList; import java.lang.reflect.Type; import java.util.ArrayList; @@ -78,156 +75,23 @@ public void setCustomBaseUrl(String customBaseUrl) { } /** - * Build call for longSessionCreate - * @param userID ID of user (required) - * @param longSessionCreateReq (required) + * Build call for sessionList + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ - +
Response Details
Status Code Description Response Headers
200 Long session has been created -
200 List of all matching sessions -
0 Error -
*/ - public okhttp3.Call longSessionCreateCall(String userID, LongSessionCreateReq longSessionCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = longSessionCreateReq; - - // create path and map variables - String localVarPath = "/users/{userID}/longSessions" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call longSessionCreateValidateBeforeCall(String userID, LongSessionCreateReq longSessionCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling longSessionCreate(Async)"); - } - - // verify the required parameter 'longSessionCreateReq' is set - if (longSessionCreateReq == null) { - throw new ApiException("Missing the required parameter 'longSessionCreateReq' when calling longSessionCreate(Async)"); - } - - return longSessionCreateCall(userID, longSessionCreateReq, _callback); - - } - - /** - * - * Create a new long session - * @param userID ID of user (required) - * @param longSessionCreateReq (required) - * @return LongSession - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been created -
0 Error -
- */ - public LongSession longSessionCreate(String userID, LongSessionCreateReq longSessionCreateReq) throws ApiException { - ApiResponse localVarResp = longSessionCreateWithHttpInfo(userID, longSessionCreateReq); - return localVarResp.getData(); - } - - /** - * - * Create a new long session - * @param userID ID of user (required) - * @param longSessionCreateReq (required) - * @return ApiResponse<LongSession> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been created -
0 Error -
- */ - public ApiResponse longSessionCreateWithHttpInfo(String userID, LongSessionCreateReq longSessionCreateReq) throws ApiException { - okhttp3.Call localVarCall = longSessionCreateValidateBeforeCall(userID, longSessionCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Create a new long session - * @param userID ID of user (required) - * @param longSessionCreateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been created -
0 Error -
- */ - public okhttp3.Call longSessionCreateAsync(String userID, LongSessionCreateReq longSessionCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = longSessionCreateValidateBeforeCall(userID, longSessionCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for longSessionGet - * @param longSessionID ID of long session (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
- */ - public okhttp3.Call longSessionGetCall(String longSessionID, final ApiCallback _callback) throws ApiException { + public okhttp3.Call sessionListCall(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -244,138 +108,7 @@ public okhttp3.Call longSessionGetCall(String longSessionID, final ApiCallback _ Object localVarPostBody = null; // create path and map variables - String localVarPath = "/longSessions/{longSessionID}" - .replace("{" + "longSessionID" + "}", localVarApiClient.escapeString(longSessionID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call longSessionGetValidateBeforeCall(String longSessionID, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'longSessionID' is set - if (longSessionID == null) { - throw new ApiException("Missing the required parameter 'longSessionID' when calling longSessionGet(Async)"); - } - - return longSessionGetCall(longSessionID, _callback); - - } - - /** - * - * Retrieves a long session by ID - * @param longSessionID ID of long session (required) - * @return LongSession - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
- */ - public LongSession longSessionGet(String longSessionID) throws ApiException { - ApiResponse localVarResp = longSessionGetWithHttpInfo(longSessionID); - return localVarResp.getData(); - } - - /** - * - * Retrieves a long session by ID - * @param longSessionID ID of long session (required) - * @return ApiResponse<LongSession> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
- */ - public ApiResponse longSessionGetWithHttpInfo(String longSessionID) throws ApiException { - okhttp3.Call localVarCall = longSessionGetValidateBeforeCall(longSessionID, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Retrieves a long session by ID - * @param longSessionID ID of long session (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
- */ - public okhttp3.Call longSessionGetAsync(String longSessionID, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = longSessionGetValidateBeforeCall(longSessionID, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for longSessionUpdate - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @param longSessionUpdateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been updated -
0 Error -
- */ - public okhttp3.Call longSessionUpdateCall(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = longSessionUpdateReq; - - // create path and map variables - String localVarPath = "/users/{userID}/longSessions/{longSessionID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "longSessionID" + "}", localVarApiClient.escapeString(longSessionID.toString())); + String localVarPath = "/sessions"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -383,153 +116,22 @@ public okhttp3.Call longSessionUpdateCall(String userID, String longSessionID, L Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call longSessionUpdateValidateBeforeCall(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling longSessionUpdate(Async)"); + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); } - // verify the required parameter 'longSessionID' is set - if (longSessionID == null) { - throw new ApiException("Missing the required parameter 'longSessionID' when calling longSessionUpdate(Async)"); + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } - // verify the required parameter 'longSessionUpdateReq' is set - if (longSessionUpdateReq == null) { - throw new ApiException("Missing the required parameter 'longSessionUpdateReq' when calling longSessionUpdate(Async)"); + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } - return longSessionUpdateCall(userID, longSessionID, longSessionUpdateReq, _callback); - - } - - /** - * - * Updates long session status - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @param longSessionUpdateReq (required) - * @return LongSession - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been updated -
0 Error -
- */ - public LongSession longSessionUpdate(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq) throws ApiException { - ApiResponse localVarResp = longSessionUpdateWithHttpInfo(userID, longSessionID, longSessionUpdateReq); - return localVarResp.getData(); - } - - /** - * - * Updates long session status - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @param longSessionUpdateReq (required) - * @return ApiResponse<LongSession> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been updated -
0 Error -
- */ - public ApiResponse longSessionUpdateWithHttpInfo(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq) throws ApiException { - okhttp3.Call localVarCall = longSessionUpdateValidateBeforeCall(userID, longSessionID, longSessionUpdateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Updates long session status - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @param longSessionUpdateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Long session has been updated -
0 Error -
- */ - public okhttp3.Call longSessionUpdateAsync(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = longSessionUpdateValidateBeforeCall(userID, longSessionID, longSessionUpdateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for shortSessionCreate - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @param shortSessionCreateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Short session has been created -
0 Error -
- */ - public okhttp3.Call shortSessionCreateCall(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); } - Object localVarPostBody = shortSessionCreateReq; - - // create path and map variables - String localVarPath = "/users/{userID}/longSessions/{longSessionID}/shortSessions" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "longSessionID" + "}", localVarApiClient.escapeString(longSessionID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { "application/json" }; @@ -539,7 +141,6 @@ public okhttp3.Call shortSessionCreateCall(String userID, String longSessionID, } final String[] localVarContentTypes = { - "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -547,109 +148,100 @@ public okhttp3.Call shortSessionCreateCall(String userID, String longSessionID, } String[] localVarAuthNames = new String[] { "basicAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call shortSessionCreateValidateBeforeCall(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling shortSessionCreate(Async)"); - } - - // verify the required parameter 'longSessionID' is set - if (longSessionID == null) { - throw new ApiException("Missing the required parameter 'longSessionID' when calling shortSessionCreate(Async)"); - } - - // verify the required parameter 'shortSessionCreateReq' is set - if (shortSessionCreateReq == null) { - throw new ApiException("Missing the required parameter 'shortSessionCreateReq' when calling shortSessionCreate(Async)"); - } - - return shortSessionCreateCall(userID, longSessionID, shortSessionCreateReq, _callback); + private okhttp3.Call sessionListValidateBeforeCall(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return sessionListCall(sort, filter, page, pageSize, _callback); } /** * - * Create a new short session - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @param shortSessionCreateReq (required) - * @return ShortSession + * Returns a list of matching sessions + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return SessionList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+ - +
Response Details
Status Code Description Response Headers
200 Short session has been created -
200 List of all matching sessions -
0 Error -
*/ - public ShortSession shortSessionCreate(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq) throws ApiException { - ApiResponse localVarResp = shortSessionCreateWithHttpInfo(userID, longSessionID, shortSessionCreateReq); + public SessionList sessionList(String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = sessionListWithHttpInfo(sort, filter, page, pageSize); return localVarResp.getData(); } /** * - * Create a new short session - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @param shortSessionCreateReq (required) - * @return ApiResponse<ShortSession> + * Returns a list of matching sessions + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<SessionList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+ - +
Response Details
Status Code Description Response Headers
200 Short session has been created -
200 List of all matching sessions -
0 Error -
*/ - public ApiResponse shortSessionCreateWithHttpInfo(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq) throws ApiException { - okhttp3.Call localVarCall = shortSessionCreateValidateBeforeCall(userID, longSessionID, shortSessionCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse sessionListWithHttpInfo(String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = sessionListValidateBeforeCall(sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) - * Create a new short session - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @param shortSessionCreateReq (required) + * Returns a list of matching sessions + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
+ - +
Response Details
Status Code Description Response Headers
200 Short session has been created -
200 List of all matching sessions -
0 Error -
*/ - public okhttp3.Call shortSessionCreateAsync(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq, final ApiCallback _callback) throws ApiException { + public okhttp3.Call sessionListAsync(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = shortSessionCreateValidateBeforeCall(userID, longSessionID, shortSessionCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = sessionListValidateBeforeCall(sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for userLongSessionGet - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) + * Build call for sessionRevoke + * @param sessionID ID of session (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+ - +
Response Details
Status Code Description Response Headers
200 Long session has been returned -
200 Operation succeeded -
0 Error -
*/ - public okhttp3.Call userLongSessionGetCall(String userID, String longSessionID, final ApiCallback _callback) throws ApiException { + public okhttp3.Call sessionRevokeCall(String sessionID, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -666,9 +258,8 @@ public okhttp3.Call userLongSessionGetCall(String userID, String longSessionID, Object localVarPostBody = null; // create path and map variables - String localVarPath = "/users/{userID}/longSessions/{longSessionID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "longSessionID" + "}", localVarApiClient.escapeString(longSessionID.toString())); + String localVarPath = "/sessions/{sessionID}/revoke" + .replace("{" + "sessionID" + "}", localVarApiClient.escapeString(sessionID.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -692,83 +283,78 @@ public okhttp3.Call userLongSessionGetCall(String userID, String longSessionID, } String[] localVarAuthNames = new String[] { "basicAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call userLongSessionGetValidateBeforeCall(String userID, String longSessionID, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userLongSessionGet(Async)"); - } - - // verify the required parameter 'longSessionID' is set - if (longSessionID == null) { - throw new ApiException("Missing the required parameter 'longSessionID' when calling userLongSessionGet(Async)"); + private okhttp3.Call sessionRevokeValidateBeforeCall(String sessionID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sessionID' is set + if (sessionID == null) { + throw new ApiException("Missing the required parameter 'sessionID' when calling sessionRevoke(Async)"); } - return userLongSessionGetCall(userID, longSessionID, _callback); + return sessionRevokeCall(sessionID, _callback); } /** * - * Retrieves a long session by ID and user ID - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @return LongSession + * Revokes an existing session + * @param sessionID ID of session (required) + * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+ - +
Response Details
Status Code Description Response Headers
200 Long session has been returned -
200 Operation succeeded -
0 Error -
*/ - public LongSession userLongSessionGet(String userID, String longSessionID) throws ApiException { - ApiResponse localVarResp = userLongSessionGetWithHttpInfo(userID, longSessionID); + public GenericRsp sessionRevoke(String sessionID) throws ApiException { + ApiResponse localVarResp = sessionRevokeWithHttpInfo(sessionID); return localVarResp.getData(); } /** * - * Retrieves a long session by ID and user ID - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) - * @return ApiResponse<LongSession> + * Revokes an existing session + * @param sessionID ID of session (required) + * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
+ - +
Response Details
Status Code Description Response Headers
200 Long session has been returned -
200 Operation succeeded -
0 Error -
*/ - public ApiResponse userLongSessionGetWithHttpInfo(String userID, String longSessionID) throws ApiException { - okhttp3.Call localVarCall = userLongSessionGetValidateBeforeCall(userID, longSessionID, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse sessionRevokeWithHttpInfo(String sessionID) throws ApiException { + okhttp3.Call localVarCall = sessionRevokeValidateBeforeCall(sessionID, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) - * Retrieves a long session by ID and user ID - * @param userID ID of user (required) - * @param longSessionID ID of long session (required) + * Revokes an existing session + * @param sessionID ID of session (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details - +
+ - +
Response Details
Status Code Description Response Headers
200 Long session has been returned -
200 Operation succeeded -
0 Error -
*/ - public okhttp3.Call userLongSessionGetAsync(String userID, String longSessionID, final ApiCallback _callback) throws ApiException { + public okhttp3.Call sessionRevokeAsync(String sessionID, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = userLongSessionGetValidateBeforeCall(userID, longSessionID, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = sessionRevokeValidateBeforeCall(sessionID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/corbado/generated/api/UsersApi.java b/src/main/java/com/corbado/generated/api/UsersApi.java index 7945125..026f2b0 100644 --- a/src/main/java/com/corbado/generated/api/UsersApi.java +++ b/src/main/java/com/corbado/generated/api/UsersApi.java @@ -88,7 +88,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
+ @@ -164,7 +165,8 @@ private okhttp3.Call credentialDeleteValidateBeforeCall(String userID, String cr * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -183,7 +185,8 @@ public GenericRsp credentialDelete(String userID, String credentialID) throws Ap * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -204,7 +207,8 @@ public ApiResponse credentialDeleteWithHttpInfo(String userID, Strin * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -228,7 +232,8 @@ public okhttp3.Call credentialDeleteAsync(String userID, String credentialID, fi * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -317,7 +322,8 @@ private okhttp3.Call credentialListValidateBeforeCall(String userID, String sort * @return CredentialList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of credentials (passkeys) -
0 Error -
+
+ @@ -339,7 +345,8 @@ public CredentialList credentialList(String userID, String sort, List fi * @return ApiResponse<CredentialList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of credentials (passkeys) -
0 Error -
+
+ @@ -363,7 +370,8 @@ public ApiResponse credentialListWithHttpInfo(String userID, Str * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of credentials (passkeys) -
0 Error -
+
+ @@ -384,7 +392,8 @@ public okhttp3.Call credentialListAsync(String userID, String sort, List * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of credentials (passkeys) -
0 Error -
+
+ @@ -460,7 +469,8 @@ private okhttp3.Call socialAccountCreateValidateBeforeCall(String userID, Social * @return SocialAccount * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Social account has been created -
0 Error -
+
+ @@ -479,7 +489,8 @@ public SocialAccount socialAccountCreate(String userID, SocialAccountCreateReq s * @return ApiResponse<SocialAccount> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Social account has been created -
0 Error -
+
+ @@ -500,7 +511,8 @@ public ApiResponse socialAccountCreateWithHttpInfo(String userID, * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Social account has been created -
0 Error -
+
+ @@ -523,7 +535,8 @@ public okhttp3.Call socialAccountCreateAsync(String userID, SocialAccountCreateR * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Social account has been created -
0 Error -
+
+ @@ -605,7 +618,8 @@ private okhttp3.Call socialAccountListValidateBeforeCall(String sort, List +
Response Details
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ @@ -626,7 +640,8 @@ public SocialAccountList socialAccountList(String sort, List filter, Int * @return ApiResponse<SocialAccountList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+
+ @@ -649,7 +664,8 @@ public ApiResponse socialAccountListWithHttpInfo(String sort, * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+
+ @@ -669,7 +685,8 @@ public okhttp3.Call socialAccountListAsync(String sort, List filter, Int * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+
+ @@ -738,7 +755,8 @@ private okhttp3.Call userCreateValidateBeforeCall(UserCreateReq userCreateReq, f * @return User * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been created -
0 Error -
+
+ @@ -756,7 +774,8 @@ public User userCreate(UserCreateReq userCreateReq) throws ApiException { * @return ApiResponse<User> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been created -
0 Error -
+
+ @@ -776,7 +795,8 @@ public ApiResponse userCreateWithHttpInfo(UserCreateReq userCreateReq) thr * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been created -
0 Error -
+
+ @@ -796,7 +816,8 @@ public okhttp3.Call userCreateAsync(UserCreateReq userCreateReq, final ApiCallba * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been created -
0 Error -
+
+ @@ -865,7 +886,8 @@ private okhttp3.Call userDeleteValidateBeforeCall(String userID, final ApiCallba * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -883,7 +905,8 @@ public GenericRsp userDelete(String userID) throws ApiException { * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -903,7 +926,8 @@ public ApiResponse userDeleteWithHttpInfo(String userID) throws ApiE * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -923,7 +947,8 @@ public okhttp3.Call userDeleteAsync(String userID, final ApiCallback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+
+ @@ -992,7 +1017,8 @@ private okhttp3.Call userGetValidateBeforeCall(String userID, final ApiCallback * @return User * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been returned -
0 Error -
+
+ @@ -1010,7 +1036,8 @@ public User userGet(String userID) throws ApiException { * @return ApiResponse<User> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been returned -
0 Error -
+
+ @@ -1030,7 +1057,8 @@ public ApiResponse userGetWithHttpInfo(String userID) throws ApiException * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been returned -
0 Error -
+
+ @@ -1054,7 +1082,8 @@ public okhttp3.Call userGetAsync(String userID, final ApiCallback _callbac * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been returned -
0 Error -
+
+ @@ -1143,7 +1172,8 @@ private okhttp3.Call userSocialAccountListValidateBeforeCall(String userID, Stri * @return List<SocialAccount> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+
+ @@ -1165,7 +1195,8 @@ public List userSocialAccountList(String userID, String sort, Lis * @return ApiResponse<List<SocialAccount>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+
+ @@ -1189,7 +1220,8 @@ public ApiResponse> userSocialAccountListWithHttpInfo(String * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+
+ @@ -1210,7 +1242,8 @@ public okhttp3.Call userSocialAccountListAsync(String userID, String sort, List< * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+
+ @@ -1286,7 +1319,8 @@ private okhttp3.Call userUpdateValidateBeforeCall(String userID, UserUpdateReq u * @return User * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been updated -
0 Error -
+
+ @@ -1305,7 +1339,8 @@ public User userUpdate(String userID, UserUpdateReq userUpdateReq) throws ApiExc * @return ApiResponse<User> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been updated -
0 Error -
+
+ @@ -1326,7 +1361,8 @@ public ApiResponse userUpdateWithHttpInfo(String userID, UserUpdateReq use * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details -
Response Details
Status Code Description Response Headers
200 User has been updated -
0 Error -
+
+ diff --git a/src/main/java/com/corbado/generated/api/WebhookEndpointsApi.java b/src/main/java/com/corbado/generated/api/WebhookEndpointsApi.java new file mode 100644 index 0000000..da6c17d --- /dev/null +++ b/src/main/java/com/corbado/generated/api/WebhookEndpointsApi.java @@ -0,0 +1,462 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.WebhookEndpoint; +import com.corbado.generated.model.WebhookEndpointCreateReq; +import com.corbado.generated.model.WebhookEndpointList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WebhookEndpointsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public WebhookEndpointsApi() { + this(Configuration.getDefaultApiClient()); + } + + public WebhookEndpointsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for webhookEndpointCreate + * @param webhookEndpointCreateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details +
Response Details
Status Code Description Response Headers
200 User has been updated -
0 Error -
+ + + + +
Response Details
Status Code Description Response Headers
200 Webhook endpoint has been created -
0 Error -
+ */ + public okhttp3.Call webhookEndpointCreateCall(WebhookEndpointCreateReq webhookEndpointCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webhookEndpointCreateReq; + + // create path and map variables + String localVarPath = "/webhookEndpoints"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webhookEndpointCreateValidateBeforeCall(WebhookEndpointCreateReq webhookEndpointCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webhookEndpointCreateReq' is set + if (webhookEndpointCreateReq == null) { + throw new ApiException("Missing the required parameter 'webhookEndpointCreateReq' when calling webhookEndpointCreate(Async)"); + } + + return webhookEndpointCreateCall(webhookEndpointCreateReq, _callback); + + } + + /** + * + * Creates a new webhook endpoint + * @param webhookEndpointCreateReq (required) + * @return WebhookEndpoint + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Webhook endpoint has been created -
0 Error -
+ */ + public WebhookEndpoint webhookEndpointCreate(WebhookEndpointCreateReq webhookEndpointCreateReq) throws ApiException { + ApiResponse localVarResp = webhookEndpointCreateWithHttpInfo(webhookEndpointCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new webhook endpoint + * @param webhookEndpointCreateReq (required) + * @return ApiResponse<WebhookEndpoint> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Webhook endpoint has been created -
0 Error -
+ */ + public ApiResponse webhookEndpointCreateWithHttpInfo(WebhookEndpointCreateReq webhookEndpointCreateReq) throws ApiException { + okhttp3.Call localVarCall = webhookEndpointCreateValidateBeforeCall(webhookEndpointCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new webhook endpoint + * @param webhookEndpointCreateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Webhook endpoint has been created -
0 Error -
+ */ + public okhttp3.Call webhookEndpointCreateAsync(WebhookEndpointCreateReq webhookEndpointCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webhookEndpointCreateValidateBeforeCall(webhookEndpointCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webhookEndpointDelete + * @param webhookEndpointID ID of a webhook endpoint (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call webhookEndpointDeleteCall(String webhookEndpointID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/webhookEndpoints/{webhookEndpointID}" + .replace("{" + "webhookEndpointID" + "}", localVarApiClient.escapeString(webhookEndpointID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webhookEndpointDeleteValidateBeforeCall(String webhookEndpointID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webhookEndpointID' is set + if (webhookEndpointID == null) { + throw new ApiException("Missing the required parameter 'webhookEndpointID' when calling webhookEndpointDelete(Async)"); + } + + return webhookEndpointDeleteCall(webhookEndpointID, _callback); + + } + + /** + * + * Deletes an existing webhook endpoint + * @param webhookEndpointID ID of a webhook endpoint (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp webhookEndpointDelete(String webhookEndpointID) throws ApiException { + ApiResponse localVarResp = webhookEndpointDeleteWithHttpInfo(webhookEndpointID); + return localVarResp.getData(); + } + + /** + * + * Deletes an existing webhook endpoint + * @param webhookEndpointID ID of a webhook endpoint (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse webhookEndpointDeleteWithHttpInfo(String webhookEndpointID) throws ApiException { + okhttp3.Call localVarCall = webhookEndpointDeleteValidateBeforeCall(webhookEndpointID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an existing webhook endpoint + * @param webhookEndpointID ID of a webhook endpoint (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call webhookEndpointDeleteAsync(String webhookEndpointID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webhookEndpointDeleteValidateBeforeCall(webhookEndpointID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webhookEndpointList + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 List of webhook endpoints -
0 Error -
+ */ + public okhttp3.Call webhookEndpointListCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/webhookEndpoints"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webhookEndpointListValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return webhookEndpointListCall(_callback); + + } + + /** + * + * Returns a list of webhook endpoints + * @return WebhookEndpointList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 List of webhook endpoints -
0 Error -
+ */ + public WebhookEndpointList webhookEndpointList() throws ApiException { + ApiResponse localVarResp = webhookEndpointListWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Returns a list of webhook endpoints + * @return ApiResponse<WebhookEndpointList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 List of webhook endpoints -
0 Error -
+ */ + public ApiResponse webhookEndpointListWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = webhookEndpointListValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of webhook endpoints + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 List of webhook endpoints -
0 Error -
+ */ + public okhttp3.Call webhookEndpointListAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webhookEndpointListValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ApiClient.java b/src/main/java/com/corbado/generated/invoker/ApiClient.java index 0f34ac9..b401f53 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiClient.java +++ b/src/main/java/com/corbado/generated/invoker/ApiClient.java @@ -735,6 +735,31 @@ public List parameterToPairs(String collectionFormat, String name, Collect return params; } + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + /** * Formats the specified collection path parameter to a string value. * @@ -1173,10 +1198,6 @@ public Call buildCall(String baseUrl, String path, String method, List que * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object */ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body @@ -1204,10 +1225,12 @@ public Request buildRequest(String baseUrl, String path, String method, List updatedQueryParams = new ArrayList<>(queryParams); + // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - final Request.Builder reqBuilder = new Request.Builder().url(url); + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); processHeaderParams(headerParams, reqBuilder); processCookieParams(cookieParams, reqBuilder); diff --git a/src/main/java/com/corbado/generated/invoker/ApiException.java b/src/main/java/com/corbado/generated/invoker/ApiException.java index 5613511..55a199b 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiException.java +++ b/src/main/java/com/corbado/generated/invoker/ApiException.java @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/corbado/generated/invoker/Configuration.java b/src/main/java/com/corbado/generated/invoker/Configuration.java index c1074ad..46b9aed 100644 --- a/src/main/java/com/corbado/generated/invoker/Configuration.java +++ b/src/main/java/com/corbado/generated/invoker/Configuration.java @@ -13,7 +13,7 @@ package com.corbado.generated.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/src/main/java/com/corbado/generated/invoker/JSON.java b/src/main/java/com/corbado/generated/invoker/JSON.java index de018af..26f705d 100644 --- a/src/main/java/com/corbado/generated/invoker/JSON.java +++ b/src/main/java/com/corbado/generated/invoker/JSON.java @@ -93,6 +93,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AaguidDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthEventCreateReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Challenge.CustomTypeAdapterFactory()); @@ -105,10 +106,13 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenDataPasskeyAppend.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenDataPasskeyDelete.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenDataPasskeyList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenDataPasskeyLogin.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenUpdateReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Credential.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.CredentialList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.DecisionInsights.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.DetectionInsights.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.DetectionTag.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ErrorRsp.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ErrorRspAllOfError.CustomTypeAdapterFactory()); @@ -119,10 +123,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IdentifierList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IdentifierUpdateReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.JavaScriptHighEntropy.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSession.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionUpdateReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Paging.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ParsedDeviceInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendFinishReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendFinishRsp.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendStartReq.CustomTypeAdapterFactory()); @@ -143,16 +145,23 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyMediationFinishRsp.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyMediationStartReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyMediationStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyPostLoginReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyPostLoginRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasswordManager.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasswordManagerList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigUpdateCnameReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ShortSession.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ShortSessionCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Session.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SocialAccount.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SocialAccountCreateReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SocialAccountList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.User.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCreateReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookEndpoint.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookEndpointCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookEndpointList.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/src/main/java/com/corbado/generated/invoker/Pair.java b/src/main/java/com/corbado/generated/invoker/Pair.java index d7cb63c..26aaf85 100644 --- a/src/main/java/com/corbado/generated/invoker/Pair.java +++ b/src/main/java/com/corbado/generated/invoker/Pair.java @@ -13,7 +13,7 @@ package com.corbado.generated.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java index d5cf3ca..0e35f6c 100644 --- a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java +++ b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java @@ -1,3 +1,16 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package com.corbado.generated.invoker; import java.util.Map; @@ -5,7 +18,7 @@ /** * Representing a Server configuration. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/src/main/java/com/corbado/generated/invoker/ServerVariable.java b/src/main/java/com/corbado/generated/invoker/ServerVariable.java index 5ac1cce..e8e93e7 100644 --- a/src/main/java/com/corbado/generated/invoker/ServerVariable.java +++ b/src/main/java/com/corbado/generated/invoker/ServerVariable.java @@ -1,3 +1,16 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package com.corbado.generated.invoker; import java.util.HashSet; @@ -5,7 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/src/main/java/com/corbado/generated/invoker/StringUtil.java b/src/main/java/com/corbado/generated/invoker/StringUtil.java index c8b2323..1e5d1f9 100644 --- a/src/main/java/com/corbado/generated/invoker/StringUtil.java +++ b/src/main/java/com/corbado/generated/invoker/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java index 832d638..69bccd2 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java index e7b6f57..788da0a 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; diff --git a/src/main/java/com/corbado/generated/model/AaguidDetails.java b/src/main/java/com/corbado/generated/model/AaguidDetails.java new file mode 100644 index 0000000..aa31e7a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AaguidDetails.java @@ -0,0 +1,307 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AaguidDetails + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AaguidDetails { + public static final String SERIALIZED_NAME_AAGUID = "aaguid"; + @SerializedName(SERIALIZED_NAME_AAGUID) + @javax.annotation.Nonnull + private String aaguid; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_ICON_LIGHT = "iconLight"; + @SerializedName(SERIALIZED_NAME_ICON_LIGHT) + @javax.annotation.Nonnull + private String iconLight; + + public static final String SERIALIZED_NAME_ICON_DARK = "iconDark"; + @SerializedName(SERIALIZED_NAME_ICON_DARK) + @javax.annotation.Nonnull + private String iconDark; + + public AaguidDetails() { + } + + public AaguidDetails aaguid(@javax.annotation.Nonnull String aaguid) { + this.aaguid = aaguid; + return this; + } + + /** + * Get aaguid + * @return aaguid + */ + @javax.annotation.Nonnull + public String getAaguid() { + return aaguid; + } + + public void setAaguid(@javax.annotation.Nonnull String aaguid) { + this.aaguid = aaguid; + } + + + public AaguidDetails name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public AaguidDetails iconLight(@javax.annotation.Nonnull String iconLight) { + this.iconLight = iconLight; + return this; + } + + /** + * Get iconLight + * @return iconLight + */ + @javax.annotation.Nonnull + public String getIconLight() { + return iconLight; + } + + public void setIconLight(@javax.annotation.Nonnull String iconLight) { + this.iconLight = iconLight; + } + + + public AaguidDetails iconDark(@javax.annotation.Nonnull String iconDark) { + this.iconDark = iconDark; + return this; + } + + /** + * Get iconDark + * @return iconDark + */ + @javax.annotation.Nonnull + public String getIconDark() { + return iconDark; + } + + public void setIconDark(@javax.annotation.Nonnull String iconDark) { + this.iconDark = iconDark; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AaguidDetails aaguidDetails = (AaguidDetails) o; + return Objects.equals(this.aaguid, aaguidDetails.aaguid) && + Objects.equals(this.name, aaguidDetails.name) && + Objects.equals(this.iconLight, aaguidDetails.iconLight) && + Objects.equals(this.iconDark, aaguidDetails.iconDark); + } + + @Override + public int hashCode() { + return Objects.hash(aaguid, name, iconLight, iconDark); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AaguidDetails {\n"); + sb.append(" aaguid: ").append(toIndentedString(aaguid)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" iconLight: ").append(toIndentedString(iconLight)).append("\n"); + sb.append(" iconDark: ").append(toIndentedString(iconDark)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("aaguid"); + openapiFields.add("name"); + openapiFields.add("iconLight"); + openapiFields.add("iconDark"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("aaguid"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("iconLight"); + openapiRequiredFields.add("iconDark"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AaguidDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AaguidDetails.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AaguidDetails is not found in the empty JSON string", AaguidDetails.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AaguidDetails.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AaguidDetails` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AaguidDetails.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("aaguid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aaguid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aaguid").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("iconLight").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `iconLight` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iconLight").toString())); + } + if (!jsonObj.get("iconDark").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `iconDark` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iconDark").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AaguidDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AaguidDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AaguidDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AaguidDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AaguidDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AaguidDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AaguidDetails + * @throws IOException if the JSON string is invalid with respect to AaguidDetails + */ + public static AaguidDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AaguidDetails.class); + } + + /** + * Convert an instance of AaguidDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java index 0b36fce..597c11f 100644 --- a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java @@ -21,7 +21,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/com/corbado/generated/model/AuthEvent.java b/src/main/java/com/corbado/generated/model/AuthEvent.java index ff10cd4..5f926b6 100644 --- a/src/main/java/com/corbado/generated/model/AuthEvent.java +++ b/src/main/java/com/corbado/generated/model/AuthEvent.java @@ -40,7 +40,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -52,40 +51,52 @@ /** * AuthEvent */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class AuthEvent { public static final String SERIALIZED_NAME_AUTH_EVENT_I_D = "authEventID"; @SerializedName(SERIALIZED_NAME_AUTH_EVENT_I_D) + @javax.annotation.Nonnull private String authEventID; public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull private String username; public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + @javax.annotation.Nonnull private AuthEventType eventType; public static final String SERIALIZED_NAME_METHOD = "method"; @SerializedName(SERIALIZED_NAME_METHOD) + @javax.annotation.Nonnull private AuthEventMethod method; public static final String SERIALIZED_NAME_CREATED = "created"; @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nonnull private String created; + public static final String SERIALIZED_NAME_CREATED_MS = "createdMs"; + @SerializedName(SERIALIZED_NAME_CREATED_MS) + @javax.annotation.Nonnull + private Long createdMs; + public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private AuthEventStatus status; public AuthEvent() { } - public AuthEvent authEventID(String authEventID) { + public AuthEvent authEventID(@javax.annotation.Nonnull String authEventID) { this.authEventID = authEventID; return this; } @@ -99,12 +110,12 @@ public String getAuthEventID() { return authEventID; } - public void setAuthEventID(String authEventID) { + public void setAuthEventID(@javax.annotation.Nonnull String authEventID) { this.authEventID = authEventID; } - public AuthEvent userID(String userID) { + public AuthEvent userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -118,12 +129,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public AuthEvent username(String username) { + public AuthEvent username(@javax.annotation.Nonnull String username) { this.username = username; return this; } @@ -137,12 +148,12 @@ public String getUsername() { return username; } - public void setUsername(String username) { + public void setUsername(@javax.annotation.Nonnull String username) { this.username = username; } - public AuthEvent eventType(AuthEventType eventType) { + public AuthEvent eventType(@javax.annotation.Nonnull AuthEventType eventType) { this.eventType = eventType; return this; } @@ -156,12 +167,12 @@ public AuthEventType getEventType() { return eventType; } - public void setEventType(AuthEventType eventType) { + public void setEventType(@javax.annotation.Nonnull AuthEventType eventType) { this.eventType = eventType; } - public AuthEvent method(AuthEventMethod method) { + public AuthEvent method(@javax.annotation.Nonnull AuthEventMethod method) { this.method = method; return this; } @@ -175,12 +186,12 @@ public AuthEventMethod getMethod() { return method; } - public void setMethod(AuthEventMethod method) { + public void setMethod(@javax.annotation.Nonnull AuthEventMethod method) { this.method = method; } - public AuthEvent created(String created) { + public AuthEvent created(@javax.annotation.Nonnull String created) { this.created = created; return this; } @@ -194,12 +205,31 @@ public String getCreated() { return created; } - public void setCreated(String created) { + public void setCreated(@javax.annotation.Nonnull String created) { this.created = created; } - public AuthEvent status(AuthEventStatus status) { + public AuthEvent createdMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + return this; + } + + /** + * Get createdMs + * @return createdMs + */ + @javax.annotation.Nonnull + public Long getCreatedMs() { + return createdMs; + } + + public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + } + + + public AuthEvent status(@javax.annotation.Nonnull AuthEventStatus status) { this.status = status; return this; } @@ -213,7 +243,7 @@ public AuthEventStatus getStatus() { return status; } - public void setStatus(AuthEventStatus status) { + public void setStatus(@javax.annotation.Nonnull AuthEventStatus status) { this.status = status; } @@ -234,12 +264,13 @@ public boolean equals(Object o) { Objects.equals(this.eventType, authEvent.eventType) && Objects.equals(this.method, authEvent.method) && Objects.equals(this.created, authEvent.created) && + Objects.equals(this.createdMs, authEvent.createdMs) && Objects.equals(this.status, authEvent.status); } @Override public int hashCode() { - return Objects.hash(authEventID, userID, username, eventType, method, created, status); + return Objects.hash(authEventID, userID, username, eventType, method, created, createdMs, status); } @Override @@ -252,6 +283,7 @@ public String toString() { sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); sb.append(" method: ").append(toIndentedString(method)).append("\n"); sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append("}"); return sb.toString(); @@ -281,6 +313,7 @@ private String toIndentedString(Object o) { openapiFields.add("eventType"); openapiFields.add("method"); openapiFields.add("created"); + openapiFields.add("createdMs"); openapiFields.add("status"); // a set of required properties/fields (JSON key names) @@ -291,6 +324,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("eventType"); openapiRequiredFields.add("method"); openapiRequiredFields.add("created"); + openapiRequiredFields.add("createdMs"); openapiRequiredFields.add("status"); } diff --git a/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java b/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java index f3803b2..9714bb0 100644 --- a/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java +++ b/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java @@ -41,7 +41,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,32 +52,37 @@ /** * AuthEventCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class AuthEventCreateReq { public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull private String username; public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + @javax.annotation.Nonnull private AuthEventType eventType; public static final String SERIALIZED_NAME_METHOD = "method"; @SerializedName(SERIALIZED_NAME_METHOD) + @javax.annotation.Nonnull private AuthEventMethod method; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private AuthEventStatus status; public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + @javax.annotation.Nonnull private ClientInformation clientInformation; public AuthEventCreateReq() { } - public AuthEventCreateReq username(String username) { + public AuthEventCreateReq username(@javax.annotation.Nonnull String username) { this.username = username; return this; } @@ -92,12 +96,12 @@ public String getUsername() { return username; } - public void setUsername(String username) { + public void setUsername(@javax.annotation.Nonnull String username) { this.username = username; } - public AuthEventCreateReq eventType(AuthEventType eventType) { + public AuthEventCreateReq eventType(@javax.annotation.Nonnull AuthEventType eventType) { this.eventType = eventType; return this; } @@ -111,12 +115,12 @@ public AuthEventType getEventType() { return eventType; } - public void setEventType(AuthEventType eventType) { + public void setEventType(@javax.annotation.Nonnull AuthEventType eventType) { this.eventType = eventType; } - public AuthEventCreateReq method(AuthEventMethod method) { + public AuthEventCreateReq method(@javax.annotation.Nonnull AuthEventMethod method) { this.method = method; return this; } @@ -130,12 +134,12 @@ public AuthEventMethod getMethod() { return method; } - public void setMethod(AuthEventMethod method) { + public void setMethod(@javax.annotation.Nonnull AuthEventMethod method) { this.method = method; } - public AuthEventCreateReq status(AuthEventStatus status) { + public AuthEventCreateReq status(@javax.annotation.Nonnull AuthEventStatus status) { this.status = status; return this; } @@ -149,12 +153,12 @@ public AuthEventStatus getStatus() { return status; } - public void setStatus(AuthEventStatus status) { + public void setStatus(@javax.annotation.Nonnull AuthEventStatus status) { this.status = status; } - public AuthEventCreateReq clientInformation(ClientInformation clientInformation) { + public AuthEventCreateReq clientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; return this; } @@ -168,7 +172,7 @@ public ClientInformation getClientInformation() { return clientInformation; } - public void setClientInformation(ClientInformation clientInformation) { + public void setClientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; } diff --git a/src/main/java/com/corbado/generated/model/Challenge.java b/src/main/java/com/corbado/generated/model/Challenge.java index 3924320..e9894a5 100644 --- a/src/main/java/com/corbado/generated/model/Challenge.java +++ b/src/main/java/com/corbado/generated/model/Challenge.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,32 +50,42 @@ /** * Challenge */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class Challenge { public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) + @javax.annotation.Nonnull private String challengeID; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull private ChallengeType type; public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + @javax.annotation.Nonnull private String identifierValue; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull private String value; + public static final String SERIALIZED_NAME_EXPIRES = "expires"; + @SerializedName(SERIALIZED_NAME_EXPIRES) + @javax.annotation.Nonnull + private Long expires; + public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private ChallengeStatus status; public Challenge() { } - public Challenge challengeID(String challengeID) { + public Challenge challengeID(@javax.annotation.Nonnull String challengeID) { this.challengeID = challengeID; return this; } @@ -90,12 +99,12 @@ public String getChallengeID() { return challengeID; } - public void setChallengeID(String challengeID) { + public void setChallengeID(@javax.annotation.Nonnull String challengeID) { this.challengeID = challengeID; } - public Challenge type(ChallengeType type) { + public Challenge type(@javax.annotation.Nonnull ChallengeType type) { this.type = type; return this; } @@ -109,12 +118,12 @@ public ChallengeType getType() { return type; } - public void setType(ChallengeType type) { + public void setType(@javax.annotation.Nonnull ChallengeType type) { this.type = type; } - public Challenge identifierValue(String identifierValue) { + public Challenge identifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; return this; } @@ -128,12 +137,12 @@ public String getIdentifierValue() { return identifierValue; } - public void setIdentifierValue(String identifierValue) { + public void setIdentifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; } - public Challenge value(String value) { + public Challenge value(@javax.annotation.Nonnull String value) { this.value = value; return this; } @@ -147,12 +156,31 @@ public String getValue() { return value; } - public void setValue(String value) { + public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } - public Challenge status(ChallengeStatus status) { + public Challenge expires(@javax.annotation.Nonnull Long expires) { + this.expires = expires; + return this; + } + + /** + * Get expires + * @return expires + */ + @javax.annotation.Nonnull + public Long getExpires() { + return expires; + } + + public void setExpires(@javax.annotation.Nonnull Long expires) { + this.expires = expires; + } + + + public Challenge status(@javax.annotation.Nonnull ChallengeStatus status) { this.status = status; return this; } @@ -166,7 +194,7 @@ public ChallengeStatus getStatus() { return status; } - public void setStatus(ChallengeStatus status) { + public void setStatus(@javax.annotation.Nonnull ChallengeStatus status) { this.status = status; } @@ -185,12 +213,13 @@ public boolean equals(Object o) { Objects.equals(this.type, challenge.type) && Objects.equals(this.identifierValue, challenge.identifierValue) && Objects.equals(this.value, challenge.value) && + Objects.equals(this.expires, challenge.expires) && Objects.equals(this.status, challenge.status); } @Override public int hashCode() { - return Objects.hash(challengeID, type, identifierValue, value, status); + return Objects.hash(challengeID, type, identifierValue, value, expires, status); } @Override @@ -201,6 +230,7 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append("}"); return sb.toString(); @@ -228,6 +258,7 @@ private String toIndentedString(Object o) { openapiFields.add("type"); openapiFields.add("identifierValue"); openapiFields.add("value"); + openapiFields.add("expires"); openapiFields.add("status"); // a set of required properties/fields (JSON key names) @@ -236,6 +267,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("type"); openapiRequiredFields.add("identifierValue"); openapiRequiredFields.add("value"); + openapiRequiredFields.add("expires"); openapiRequiredFields.add("status"); } diff --git a/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java b/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java index 6435c40..04f50ee 100644 --- a/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java +++ b/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,28 +50,37 @@ /** * ChallengeCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ChallengeCreateReq { public static final String SERIALIZED_NAME_CHALLENGE_TYPE = "challengeType"; @SerializedName(SERIALIZED_NAME_CHALLENGE_TYPE) + @javax.annotation.Nonnull private ChallengeType challengeType; public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + @javax.annotation.Nonnull private String identifierValue; public static final String SERIALIZED_NAME_CHALLENGE_METADATA = "challengeMetadata"; @SerializedName(SERIALIZED_NAME_CHALLENGE_METADATA) + @javax.annotation.Nullable private Object challengeMetadata; + public static final String SERIALIZED_NAME_LIFETIME_SECONDS = "lifetimeSeconds"; + @SerializedName(SERIALIZED_NAME_LIFETIME_SECONDS) + @javax.annotation.Nullable + private Integer lifetimeSeconds; + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + @javax.annotation.Nonnull private ClientInformation clientInformation; public ChallengeCreateReq() { } - public ChallengeCreateReq challengeType(ChallengeType challengeType) { + public ChallengeCreateReq challengeType(@javax.annotation.Nonnull ChallengeType challengeType) { this.challengeType = challengeType; return this; } @@ -86,12 +94,12 @@ public ChallengeType getChallengeType() { return challengeType; } - public void setChallengeType(ChallengeType challengeType) { + public void setChallengeType(@javax.annotation.Nonnull ChallengeType challengeType) { this.challengeType = challengeType; } - public ChallengeCreateReq identifierValue(String identifierValue) { + public ChallengeCreateReq identifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; return this; } @@ -105,12 +113,12 @@ public String getIdentifierValue() { return identifierValue; } - public void setIdentifierValue(String identifierValue) { + public void setIdentifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; } - public ChallengeCreateReq challengeMetadata(Object challengeMetadata) { + public ChallengeCreateReq challengeMetadata(@javax.annotation.Nullable Object challengeMetadata) { this.challengeMetadata = challengeMetadata; return this; } @@ -124,12 +132,31 @@ public Object getChallengeMetadata() { return challengeMetadata; } - public void setChallengeMetadata(Object challengeMetadata) { + public void setChallengeMetadata(@javax.annotation.Nullable Object challengeMetadata) { this.challengeMetadata = challengeMetadata; } - public ChallengeCreateReq clientInformation(ClientInformation clientInformation) { + public ChallengeCreateReq lifetimeSeconds(@javax.annotation.Nullable Integer lifetimeSeconds) { + this.lifetimeSeconds = lifetimeSeconds; + return this; + } + + /** + * Get lifetimeSeconds + * @return lifetimeSeconds + */ + @javax.annotation.Nullable + public Integer getLifetimeSeconds() { + return lifetimeSeconds; + } + + public void setLifetimeSeconds(@javax.annotation.Nullable Integer lifetimeSeconds) { + this.lifetimeSeconds = lifetimeSeconds; + } + + + public ChallengeCreateReq clientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; return this; } @@ -143,7 +170,7 @@ public ClientInformation getClientInformation() { return clientInformation; } - public void setClientInformation(ClientInformation clientInformation) { + public void setClientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; } @@ -161,12 +188,13 @@ public boolean equals(Object o) { return Objects.equals(this.challengeType, challengeCreateReq.challengeType) && Objects.equals(this.identifierValue, challengeCreateReq.identifierValue) && Objects.equals(this.challengeMetadata, challengeCreateReq.challengeMetadata) && + Objects.equals(this.lifetimeSeconds, challengeCreateReq.lifetimeSeconds) && Objects.equals(this.clientInformation, challengeCreateReq.clientInformation); } @Override public int hashCode() { - return Objects.hash(challengeType, identifierValue, challengeMetadata, clientInformation); + return Objects.hash(challengeType, identifierValue, challengeMetadata, lifetimeSeconds, clientInformation); } @Override @@ -176,6 +204,7 @@ public String toString() { sb.append(" challengeType: ").append(toIndentedString(challengeType)).append("\n"); sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); sb.append(" challengeMetadata: ").append(toIndentedString(challengeMetadata)).append("\n"); + sb.append(" lifetimeSeconds: ").append(toIndentedString(lifetimeSeconds)).append("\n"); sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); sb.append("}"); return sb.toString(); @@ -202,6 +231,7 @@ private String toIndentedString(Object o) { openapiFields.add("challengeType"); openapiFields.add("identifierValue"); openapiFields.add("challengeMetadata"); + openapiFields.add("lifetimeSeconds"); openapiFields.add("clientInformation"); // a set of required properties/fields (JSON key names) diff --git a/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java b/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java index af96ea0..03164ac 100644 --- a/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,16 +48,17 @@ /** * ChallengeUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ChallengeUpdateReq { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull private String value; public ChallengeUpdateReq() { } - public ChallengeUpdateReq value(String value) { + public ChallengeUpdateReq value(@javax.annotation.Nonnull String value) { this.value = value; return this; } @@ -72,7 +72,7 @@ public String getValue() { return value; } - public void setValue(String value) { + public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } diff --git a/src/main/java/com/corbado/generated/model/ClientInformation.java b/src/main/java/com/corbado/generated/model/ClientInformation.java index fd04999..4b22699 100644 --- a/src/main/java/com/corbado/generated/model/ClientInformation.java +++ b/src/main/java/com/corbado/generated/model/ClientInformation.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.corbado.generated.model.JavaScriptHighEntropy; +import com.corbado.generated.model.ParsedDeviceInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -38,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,44 +50,67 @@ /** * ClientInformation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ClientInformation { public static final String SERIALIZED_NAME_REMOTE_ADDRESS = "remoteAddress"; @SerializedName(SERIALIZED_NAME_REMOTE_ADDRESS) + @javax.annotation.Nonnull private String remoteAddress; public static final String SERIALIZED_NAME_USER_AGENT = "userAgent"; @SerializedName(SERIALIZED_NAME_USER_AGENT) + @javax.annotation.Nonnull private String userAgent; public static final String SERIALIZED_NAME_CLIENT_ENV_HANDLE = "clientEnvHandle"; @SerializedName(SERIALIZED_NAME_CLIENT_ENV_HANDLE) + @javax.annotation.Nullable private String clientEnvHandle; public static final String SERIALIZED_NAME_JAVASCRIPT_FINGERPRINT = "javascriptFingerprint"; @SerializedName(SERIALIZED_NAME_JAVASCRIPT_FINGERPRINT) + @javax.annotation.Nullable private String javascriptFingerprint; public static final String SERIALIZED_NAME_JAVA_SCRIPT_HIGH_ENTROPY = "javaScriptHighEntropy"; @SerializedName(SERIALIZED_NAME_JAVA_SCRIPT_HIGH_ENTROPY) + @javax.annotation.Nullable private JavaScriptHighEntropy javaScriptHighEntropy; public static final String SERIALIZED_NAME_BLUETOOTH_AVAILABLE = "bluetoothAvailable"; @SerializedName(SERIALIZED_NAME_BLUETOOTH_AVAILABLE) + @javax.annotation.Nullable private Boolean bluetoothAvailable; public static final String SERIALIZED_NAME_PASSWORD_MANAGER_AVAILABLE = "passwordManagerAvailable"; @SerializedName(SERIALIZED_NAME_PASSWORD_MANAGER_AVAILABLE) + @javax.annotation.Nullable private Boolean passwordManagerAvailable; public static final String SERIALIZED_NAME_USER_VERIFYING_PLATFORM_AUTHENTICATOR_AVAILABLE = "userVerifyingPlatformAuthenticatorAvailable"; @SerializedName(SERIALIZED_NAME_USER_VERIFYING_PLATFORM_AUTHENTICATOR_AVAILABLE) + @javax.annotation.Nonnull private Boolean userVerifyingPlatformAuthenticatorAvailable; + public static final String SERIALIZED_NAME_CONDITIONAL_MEDIATION_AVAILABLE = "conditionalMediationAvailable"; + @SerializedName(SERIALIZED_NAME_CONDITIONAL_MEDIATION_AVAILABLE) + @javax.annotation.Nonnull + private Boolean conditionalMediationAvailable; + + public static final String SERIALIZED_NAME_PRIVATE_MODE = "privateMode"; + @SerializedName(SERIALIZED_NAME_PRIVATE_MODE) + @javax.annotation.Nullable + private Boolean privateMode; + + public static final String SERIALIZED_NAME_PARSED_DEVICE_INFO = "parsedDeviceInfo"; + @SerializedName(SERIALIZED_NAME_PARSED_DEVICE_INFO) + @javax.annotation.Nonnull + private ParsedDeviceInfo parsedDeviceInfo; + public ClientInformation() { } - public ClientInformation remoteAddress(String remoteAddress) { + public ClientInformation remoteAddress(@javax.annotation.Nonnull String remoteAddress) { this.remoteAddress = remoteAddress; return this; } @@ -101,12 +124,12 @@ public String getRemoteAddress() { return remoteAddress; } - public void setRemoteAddress(String remoteAddress) { + public void setRemoteAddress(@javax.annotation.Nonnull String remoteAddress) { this.remoteAddress = remoteAddress; } - public ClientInformation userAgent(String userAgent) { + public ClientInformation userAgent(@javax.annotation.Nonnull String userAgent) { this.userAgent = userAgent; return this; } @@ -120,12 +143,12 @@ public String getUserAgent() { return userAgent; } - public void setUserAgent(String userAgent) { + public void setUserAgent(@javax.annotation.Nonnull String userAgent) { this.userAgent = userAgent; } - public ClientInformation clientEnvHandle(String clientEnvHandle) { + public ClientInformation clientEnvHandle(@javax.annotation.Nullable String clientEnvHandle) { this.clientEnvHandle = clientEnvHandle; return this; } @@ -139,12 +162,12 @@ public String getClientEnvHandle() { return clientEnvHandle; } - public void setClientEnvHandle(String clientEnvHandle) { + public void setClientEnvHandle(@javax.annotation.Nullable String clientEnvHandle) { this.clientEnvHandle = clientEnvHandle; } - public ClientInformation javascriptFingerprint(String javascriptFingerprint) { + public ClientInformation javascriptFingerprint(@javax.annotation.Nullable String javascriptFingerprint) { this.javascriptFingerprint = javascriptFingerprint; return this; } @@ -158,12 +181,12 @@ public String getJavascriptFingerprint() { return javascriptFingerprint; } - public void setJavascriptFingerprint(String javascriptFingerprint) { + public void setJavascriptFingerprint(@javax.annotation.Nullable String javascriptFingerprint) { this.javascriptFingerprint = javascriptFingerprint; } - public ClientInformation javaScriptHighEntropy(JavaScriptHighEntropy javaScriptHighEntropy) { + public ClientInformation javaScriptHighEntropy(@javax.annotation.Nullable JavaScriptHighEntropy javaScriptHighEntropy) { this.javaScriptHighEntropy = javaScriptHighEntropy; return this; } @@ -177,12 +200,12 @@ public JavaScriptHighEntropy getJavaScriptHighEntropy() { return javaScriptHighEntropy; } - public void setJavaScriptHighEntropy(JavaScriptHighEntropy javaScriptHighEntropy) { + public void setJavaScriptHighEntropy(@javax.annotation.Nullable JavaScriptHighEntropy javaScriptHighEntropy) { this.javaScriptHighEntropy = javaScriptHighEntropy; } - public ClientInformation bluetoothAvailable(Boolean bluetoothAvailable) { + public ClientInformation bluetoothAvailable(@javax.annotation.Nullable Boolean bluetoothAvailable) { this.bluetoothAvailable = bluetoothAvailable; return this; } @@ -196,12 +219,12 @@ public Boolean getBluetoothAvailable() { return bluetoothAvailable; } - public void setBluetoothAvailable(Boolean bluetoothAvailable) { + public void setBluetoothAvailable(@javax.annotation.Nullable Boolean bluetoothAvailable) { this.bluetoothAvailable = bluetoothAvailable; } - public ClientInformation passwordManagerAvailable(Boolean passwordManagerAvailable) { + public ClientInformation passwordManagerAvailable(@javax.annotation.Nullable Boolean passwordManagerAvailable) { this.passwordManagerAvailable = passwordManagerAvailable; return this; } @@ -215,12 +238,12 @@ public Boolean getPasswordManagerAvailable() { return passwordManagerAvailable; } - public void setPasswordManagerAvailable(Boolean passwordManagerAvailable) { + public void setPasswordManagerAvailable(@javax.annotation.Nullable Boolean passwordManagerAvailable) { this.passwordManagerAvailable = passwordManagerAvailable; } - public ClientInformation userVerifyingPlatformAuthenticatorAvailable(Boolean userVerifyingPlatformAuthenticatorAvailable) { + public ClientInformation userVerifyingPlatformAuthenticatorAvailable(@javax.annotation.Nonnull Boolean userVerifyingPlatformAuthenticatorAvailable) { this.userVerifyingPlatformAuthenticatorAvailable = userVerifyingPlatformAuthenticatorAvailable; return this; } @@ -234,11 +257,68 @@ public Boolean getUserVerifyingPlatformAuthenticatorAvailable() { return userVerifyingPlatformAuthenticatorAvailable; } - public void setUserVerifyingPlatformAuthenticatorAvailable(Boolean userVerifyingPlatformAuthenticatorAvailable) { + public void setUserVerifyingPlatformAuthenticatorAvailable(@javax.annotation.Nonnull Boolean userVerifyingPlatformAuthenticatorAvailable) { this.userVerifyingPlatformAuthenticatorAvailable = userVerifyingPlatformAuthenticatorAvailable; } + public ClientInformation conditionalMediationAvailable(@javax.annotation.Nonnull Boolean conditionalMediationAvailable) { + this.conditionalMediationAvailable = conditionalMediationAvailable; + return this; + } + + /** + * Get conditionalMediationAvailable + * @return conditionalMediationAvailable + */ + @javax.annotation.Nonnull + public Boolean getConditionalMediationAvailable() { + return conditionalMediationAvailable; + } + + public void setConditionalMediationAvailable(@javax.annotation.Nonnull Boolean conditionalMediationAvailable) { + this.conditionalMediationAvailable = conditionalMediationAvailable; + } + + + public ClientInformation privateMode(@javax.annotation.Nullable Boolean privateMode) { + this.privateMode = privateMode; + return this; + } + + /** + * Get privateMode + * @return privateMode + */ + @javax.annotation.Nullable + public Boolean getPrivateMode() { + return privateMode; + } + + public void setPrivateMode(@javax.annotation.Nullable Boolean privateMode) { + this.privateMode = privateMode; + } + + + public ClientInformation parsedDeviceInfo(@javax.annotation.Nonnull ParsedDeviceInfo parsedDeviceInfo) { + this.parsedDeviceInfo = parsedDeviceInfo; + return this; + } + + /** + * Get parsedDeviceInfo + * @return parsedDeviceInfo + */ + @javax.annotation.Nonnull + public ParsedDeviceInfo getParsedDeviceInfo() { + return parsedDeviceInfo; + } + + public void setParsedDeviceInfo(@javax.annotation.Nonnull ParsedDeviceInfo parsedDeviceInfo) { + this.parsedDeviceInfo = parsedDeviceInfo; + } + + @Override public boolean equals(Object o) { @@ -256,12 +336,15 @@ public boolean equals(Object o) { Objects.equals(this.javaScriptHighEntropy, clientInformation.javaScriptHighEntropy) && Objects.equals(this.bluetoothAvailable, clientInformation.bluetoothAvailable) && Objects.equals(this.passwordManagerAvailable, clientInformation.passwordManagerAvailable) && - Objects.equals(this.userVerifyingPlatformAuthenticatorAvailable, clientInformation.userVerifyingPlatformAuthenticatorAvailable); + Objects.equals(this.userVerifyingPlatformAuthenticatorAvailable, clientInformation.userVerifyingPlatformAuthenticatorAvailable) && + Objects.equals(this.conditionalMediationAvailable, clientInformation.conditionalMediationAvailable) && + Objects.equals(this.privateMode, clientInformation.privateMode) && + Objects.equals(this.parsedDeviceInfo, clientInformation.parsedDeviceInfo); } @Override public int hashCode() { - return Objects.hash(remoteAddress, userAgent, clientEnvHandle, javascriptFingerprint, javaScriptHighEntropy, bluetoothAvailable, passwordManagerAvailable, userVerifyingPlatformAuthenticatorAvailable); + return Objects.hash(remoteAddress, userAgent, clientEnvHandle, javascriptFingerprint, javaScriptHighEntropy, bluetoothAvailable, passwordManagerAvailable, userVerifyingPlatformAuthenticatorAvailable, conditionalMediationAvailable, privateMode, parsedDeviceInfo); } @Override @@ -276,6 +359,9 @@ public String toString() { sb.append(" bluetoothAvailable: ").append(toIndentedString(bluetoothAvailable)).append("\n"); sb.append(" passwordManagerAvailable: ").append(toIndentedString(passwordManagerAvailable)).append("\n"); sb.append(" userVerifyingPlatformAuthenticatorAvailable: ").append(toIndentedString(userVerifyingPlatformAuthenticatorAvailable)).append("\n"); + sb.append(" conditionalMediationAvailable: ").append(toIndentedString(conditionalMediationAvailable)).append("\n"); + sb.append(" privateMode: ").append(toIndentedString(privateMode)).append("\n"); + sb.append(" parsedDeviceInfo: ").append(toIndentedString(parsedDeviceInfo)).append("\n"); sb.append("}"); return sb.toString(); } @@ -306,12 +392,17 @@ private String toIndentedString(Object o) { openapiFields.add("bluetoothAvailable"); openapiFields.add("passwordManagerAvailable"); openapiFields.add("userVerifyingPlatformAuthenticatorAvailable"); + openapiFields.add("conditionalMediationAvailable"); + openapiFields.add("privateMode"); + openapiFields.add("parsedDeviceInfo"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("remoteAddress"); openapiRequiredFields.add("userAgent"); openapiRequiredFields.add("userVerifyingPlatformAuthenticatorAvailable"); + openapiRequiredFields.add("conditionalMediationAvailable"); + openapiRequiredFields.add("parsedDeviceInfo"); } /** @@ -358,6 +449,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("javaScriptHighEntropy") != null && !jsonObj.get("javaScriptHighEntropy").isJsonNull()) { JavaScriptHighEntropy.validateJsonElement(jsonObj.get("javaScriptHighEntropy")); } + // validate the required field `parsedDeviceInfo` + ParsedDeviceInfo.validateJsonElement(jsonObj.get("parsedDeviceInfo")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/ConnectToken.java b/src/main/java/com/corbado/generated/model/ConnectToken.java index e30a3fa..2caaf59 100644 --- a/src/main/java/com/corbado/generated/model/ConnectToken.java +++ b/src/main/java/com/corbado/generated/model/ConnectToken.java @@ -40,7 +40,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -52,36 +51,42 @@ /** * ConnectToken */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ConnectToken { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull private String id; public static final String SERIALIZED_NAME_TOKEN_TYPE = "tokenType"; @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) + @javax.annotation.Nonnull private ConnectTokenType tokenType; public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull private ConnectTokenData data; public static final String SERIALIZED_NAME_CONNECT_TOKEN_STATUS = "connectTokenStatus"; @SerializedName(SERIALIZED_NAME_CONNECT_TOKEN_STATUS) + @javax.annotation.Nonnull private ConnectTokenStatus connectTokenStatus; public static final String SERIALIZED_NAME_SECRET = "secret"; @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable private String secret; public static final String SERIALIZED_NAME_EXPIRES = "expires"; @SerializedName(SERIALIZED_NAME_EXPIRES) + @javax.annotation.Nonnull private Integer expires; public ConnectToken() { } - public ConnectToken id(String id) { + public ConnectToken id(@javax.annotation.Nonnull String id) { this.id = id; return this; } @@ -95,12 +100,12 @@ public String getId() { return id; } - public void setId(String id) { + public void setId(@javax.annotation.Nonnull String id) { this.id = id; } - public ConnectToken tokenType(ConnectTokenType tokenType) { + public ConnectToken tokenType(@javax.annotation.Nonnull ConnectTokenType tokenType) { this.tokenType = tokenType; return this; } @@ -114,12 +119,12 @@ public ConnectTokenType getTokenType() { return tokenType; } - public void setTokenType(ConnectTokenType tokenType) { + public void setTokenType(@javax.annotation.Nonnull ConnectTokenType tokenType) { this.tokenType = tokenType; } - public ConnectToken data(ConnectTokenData data) { + public ConnectToken data(@javax.annotation.Nonnull ConnectTokenData data) { this.data = data; return this; } @@ -133,12 +138,12 @@ public ConnectTokenData getData() { return data; } - public void setData(ConnectTokenData data) { + public void setData(@javax.annotation.Nonnull ConnectTokenData data) { this.data = data; } - public ConnectToken connectTokenStatus(ConnectTokenStatus connectTokenStatus) { + public ConnectToken connectTokenStatus(@javax.annotation.Nonnull ConnectTokenStatus connectTokenStatus) { this.connectTokenStatus = connectTokenStatus; return this; } @@ -152,12 +157,12 @@ public ConnectTokenStatus getConnectTokenStatus() { return connectTokenStatus; } - public void setConnectTokenStatus(ConnectTokenStatus connectTokenStatus) { + public void setConnectTokenStatus(@javax.annotation.Nonnull ConnectTokenStatus connectTokenStatus) { this.connectTokenStatus = connectTokenStatus; } - public ConnectToken secret(String secret) { + public ConnectToken secret(@javax.annotation.Nullable String secret) { this.secret = secret; return this; } @@ -171,12 +176,12 @@ public String getSecret() { return secret; } - public void setSecret(String secret) { + public void setSecret(@javax.annotation.Nullable String secret) { this.secret = secret; } - public ConnectToken expires(Integer expires) { + public ConnectToken expires(@javax.annotation.Nonnull Integer expires) { this.expires = expires; return this; } @@ -190,7 +195,7 @@ public Integer getExpires() { return expires; } - public void setExpires(Integer expires) { + public void setExpires(@javax.annotation.Nonnull Integer expires) { this.expires = expires; } diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java index de3f3d3..fbc24a2 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,24 +50,27 @@ /** * ConnectTokenCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ConnectTokenCreateReq { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull private ConnectTokenType type; public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull private ConnectTokenData data; public static final String SERIALIZED_NAME_MAX_LIFETIME_IN_SECONDS = "maxLifetimeInSeconds"; @SerializedName(SERIALIZED_NAME_MAX_LIFETIME_IN_SECONDS) + @javax.annotation.Nullable private Integer maxLifetimeInSeconds; public ConnectTokenCreateReq() { } - public ConnectTokenCreateReq type(ConnectTokenType type) { + public ConnectTokenCreateReq type(@javax.annotation.Nonnull ConnectTokenType type) { this.type = type; return this; } @@ -82,12 +84,12 @@ public ConnectTokenType getType() { return type; } - public void setType(ConnectTokenType type) { + public void setType(@javax.annotation.Nonnull ConnectTokenType type) { this.type = type; } - public ConnectTokenCreateReq data(ConnectTokenData data) { + public ConnectTokenCreateReq data(@javax.annotation.Nonnull ConnectTokenData data) { this.data = data; return this; } @@ -101,12 +103,12 @@ public ConnectTokenData getData() { return data; } - public void setData(ConnectTokenData data) { + public void setData(@javax.annotation.Nonnull ConnectTokenData data) { this.data = data; } - public ConnectTokenCreateReq maxLifetimeInSeconds(Integer maxLifetimeInSeconds) { + public ConnectTokenCreateReq maxLifetimeInSeconds(@javax.annotation.Nullable Integer maxLifetimeInSeconds) { this.maxLifetimeInSeconds = maxLifetimeInSeconds; return this; } @@ -120,7 +122,7 @@ public Integer getMaxLifetimeInSeconds() { return maxLifetimeInSeconds; } - public void setMaxLifetimeInSeconds(Integer maxLifetimeInSeconds) { + public void setMaxLifetimeInSeconds(@javax.annotation.Nullable Integer maxLifetimeInSeconds) { this.maxLifetimeInSeconds = maxLifetimeInSeconds; } diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenData.java b/src/main/java/com/corbado/generated/model/ConnectTokenData.java index 460d62e..4cfe4fe 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenData.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenData.java @@ -17,6 +17,7 @@ import com.corbado.generated.model.ConnectTokenDataPasskeyAppend; import com.corbado.generated.model.ConnectTokenDataPasskeyDelete; import com.corbado.generated.model.ConnectTokenDataPasskeyList; +import com.corbado.generated.model.ConnectTokenDataPasskeyLogin; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -60,7 +61,7 @@ import com.corbado.generated.invoker.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ConnectTokenData extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ConnectTokenData.class.getName()); @@ -75,6 +76,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter adapterConnectTokenDataPasskeyAppend = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyAppend.class)); final TypeAdapter adapterConnectTokenDataPasskeyDelete = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyDelete.class)); final TypeAdapter adapterConnectTokenDataPasskeyList = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyList.class)); + final TypeAdapter adapterConnectTokenDataPasskeyLogin = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyLogin.class)); return (TypeAdapter) new TypeAdapter() { @Override @@ -102,7 +104,13 @@ public void write(JsonWriter out, ConnectTokenData value) throws IOException { elementAdapter.write(out, element); return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList"); + // check if the actual instance is of the type `ConnectTokenDataPasskeyLogin` + if (value.getActualInstance() instanceof ConnectTokenDataPasskeyLogin) { + JsonElement element = adapterConnectTokenDataPasskeyLogin.toJsonTree((ConnectTokenDataPasskeyLogin)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList, ConnectTokenDataPasskeyLogin"); } @Override @@ -150,6 +158,18 @@ public ConnectTokenData read(JsonReader in) throws IOException { errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyList failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'ConnectTokenDataPasskeyList'", e); } + // deserialize ConnectTokenDataPasskeyLogin + try { + // validate the JSON object to see if any exception is thrown + ConnectTokenDataPasskeyLogin.validateJsonElement(jsonElement); + actualAdapter = adapterConnectTokenDataPasskeyLogin; + match++; + log.log(Level.FINER, "Input data matches schema 'ConnectTokenDataPasskeyLogin'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyLogin failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ConnectTokenDataPasskeyLogin'", e); + } if (match == 1) { ConnectTokenData ret = new ConnectTokenData(); @@ -179,6 +199,7 @@ public ConnectTokenData(Object o) { schemas.put("ConnectTokenDataPasskeyAppend", ConnectTokenDataPasskeyAppend.class); schemas.put("ConnectTokenDataPasskeyDelete", ConnectTokenDataPasskeyDelete.class); schemas.put("ConnectTokenDataPasskeyList", ConnectTokenDataPasskeyList.class); + schemas.put("ConnectTokenDataPasskeyLogin", ConnectTokenDataPasskeyLogin.class); } @Override @@ -189,7 +210,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList + * ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList, ConnectTokenDataPasskeyLogin * * It could be an instance of the 'oneOf' schemas. */ @@ -210,14 +231,19 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList"); + if (instance instanceof ConnectTokenDataPasskeyLogin) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList, ConnectTokenDataPasskeyLogin"); } /** * Get the actual instance, which can be the following: - * ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList + * ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList, ConnectTokenDataPasskeyLogin * - * @return The actual instance (ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList) + * @return The actual instance (ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList, ConnectTokenDataPasskeyLogin) */ @SuppressWarnings("unchecked") @Override @@ -235,6 +261,7 @@ public Object getActualInstance() { public ConnectTokenDataPasskeyAppend getConnectTokenDataPasskeyAppend() throws ClassCastException { return (ConnectTokenDataPasskeyAppend)super.getActualInstance(); } + /** * Get the actual instance of `ConnectTokenDataPasskeyDelete`. If the actual instance is not `ConnectTokenDataPasskeyDelete`, * the ClassCastException will be thrown. @@ -245,6 +272,7 @@ public ConnectTokenDataPasskeyAppend getConnectTokenDataPasskeyAppend() throws C public ConnectTokenDataPasskeyDelete getConnectTokenDataPasskeyDelete() throws ClassCastException { return (ConnectTokenDataPasskeyDelete)super.getActualInstance(); } + /** * Get the actual instance of `ConnectTokenDataPasskeyList`. If the actual instance is not `ConnectTokenDataPasskeyList`, * the ClassCastException will be thrown. @@ -256,6 +284,17 @@ public ConnectTokenDataPasskeyList getConnectTokenDataPasskeyList() throws Class return (ConnectTokenDataPasskeyList)super.getActualInstance(); } + /** + * Get the actual instance of `ConnectTokenDataPasskeyLogin`. If the actual instance is not `ConnectTokenDataPasskeyLogin`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ConnectTokenDataPasskeyLogin` + * @throws ClassCastException if the instance is not `ConnectTokenDataPasskeyLogin` + */ + public ConnectTokenDataPasskeyLogin getConnectTokenDataPasskeyLogin() throws ClassCastException { + return (ConnectTokenDataPasskeyLogin)super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -290,8 +329,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyList failed with `%s`.", e.getMessage())); // continue to the next one } + // validate the json string with ConnectTokenDataPasskeyLogin + try { + ConnectTokenDataPasskeyLogin.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyLogin failed with `%s`.", e.getMessage())); + // continue to the next one + } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for ConnectTokenData with oneOf schemas: ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + throw new IOException(String.format("The JSON string is invalid for ConnectTokenData with oneOf schemas: ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList, ConnectTokenDataPasskeyLogin. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java index 65ede38..3f9f10e 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,20 +48,22 @@ /** * ConnectTokenDataPasskeyAppend */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ConnectTokenDataPasskeyAppend { public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nonnull private String displayName; public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) + @javax.annotation.Nonnull private String identifier; public ConnectTokenDataPasskeyAppend() { } - public ConnectTokenDataPasskeyAppend displayName(String displayName) { + public ConnectTokenDataPasskeyAppend displayName(@javax.annotation.Nonnull String displayName) { this.displayName = displayName; return this; } @@ -76,12 +77,12 @@ public String getDisplayName() { return displayName; } - public void setDisplayName(String displayName) { + public void setDisplayName(@javax.annotation.Nonnull String displayName) { this.displayName = displayName; } - public ConnectTokenDataPasskeyAppend identifier(String identifier) { + public ConnectTokenDataPasskeyAppend identifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; return this; } @@ -95,7 +96,7 @@ public String getIdentifier() { return identifier; } - public void setIdentifier(String identifier) { + public void setIdentifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; } diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java index 14cc8e8..293af2c 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,16 +48,17 @@ /** * ConnectTokenDataPasskeyDelete */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ConnectTokenDataPasskeyDelete { public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) + @javax.annotation.Nonnull private String identifier; public ConnectTokenDataPasskeyDelete() { } - public ConnectTokenDataPasskeyDelete identifier(String identifier) { + public ConnectTokenDataPasskeyDelete identifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; return this; } @@ -72,7 +72,7 @@ public String getIdentifier() { return identifier; } - public void setIdentifier(String identifier) { + public void setIdentifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; } diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java index 9fe3b98..10579aa 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,16 +48,17 @@ /** * ConnectTokenDataPasskeyList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ConnectTokenDataPasskeyList { public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) + @javax.annotation.Nonnull private String identifier; public ConnectTokenDataPasskeyList() { } - public ConnectTokenDataPasskeyList identifier(String identifier) { + public ConnectTokenDataPasskeyList identifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; return this; } @@ -72,7 +72,7 @@ public String getIdentifier() { return identifier; } - public void setIdentifier(String identifier) { + public void setIdentifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; } diff --git a/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyLogin.java similarity index 57% rename from src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java rename to src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyLogin.java index 3accf4e..442cb7e 100644 --- a/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyLogin.java @@ -14,7 +14,6 @@ package com.corbado.generated.model; import java.util.Objects; -import com.corbado.generated.model.AppType; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -38,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -48,56 +46,34 @@ import com.corbado.generated.invoker.JSON; /** - * ShortSessionCreateReq + * ConnectTokenDataPasskeyLogin */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") -public class ShortSessionCreateReq { - public static final String SERIALIZED_NAME_APP_TYPE = "appType"; - @SerializedName(SERIALIZED_NAME_APP_TYPE) - private AppType appType; - - public static final String SERIALIZED_NAME_ISSUER = "issuer"; - @SerializedName(SERIALIZED_NAME_ISSUER) - private String issuer; - - public ShortSessionCreateReq() { - } - - public ShortSessionCreateReq appType(AppType appType) { - this.appType = appType; - return this; - } - - /** - * Get appType - * @return appType - */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ConnectTokenDataPasskeyLogin { + public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER) @javax.annotation.Nonnull - public AppType getAppType() { - return appType; - } + private String identifier; - public void setAppType(AppType appType) { - this.appType = appType; + public ConnectTokenDataPasskeyLogin() { } - - public ShortSessionCreateReq issuer(String issuer) { - this.issuer = issuer; + public ConnectTokenDataPasskeyLogin identifier(@javax.annotation.Nonnull String identifier) { + this.identifier = identifier; return this; } /** - * Get issuer - * @return issuer + * Get identifier + * @return identifier */ @javax.annotation.Nonnull - public String getIssuer() { - return issuer; + public String getIdentifier() { + return identifier; } - public void setIssuer(String issuer) { - this.issuer = issuer; + public void setIdentifier(@javax.annotation.Nonnull String identifier) { + this.identifier = identifier; } @@ -110,22 +86,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ShortSessionCreateReq shortSessionCreateReq = (ShortSessionCreateReq) o; - return Objects.equals(this.appType, shortSessionCreateReq.appType) && - Objects.equals(this.issuer, shortSessionCreateReq.issuer); + ConnectTokenDataPasskeyLogin connectTokenDataPasskeyLogin = (ConnectTokenDataPasskeyLogin) o; + return Objects.equals(this.identifier, connectTokenDataPasskeyLogin.identifier); } @Override public int hashCode() { - return Objects.hash(appType, issuer); + return Objects.hash(identifier); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ShortSessionCreateReq {\n"); - sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); - sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append("class ConnectTokenDataPasskeyLogin {\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); sb.append("}"); return sb.toString(); } @@ -148,47 +122,43 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("appType"); - openapiFields.add("issuer"); + openapiFields.add("identifier"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("appType"); - openapiRequiredFields.add("issuer"); + openapiRequiredFields.add("identifier"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ShortSessionCreateReq + * @throws IOException if the JSON Element is invalid with respect to ConnectTokenDataPasskeyLogin */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ShortSessionCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ShortSessionCreateReq is not found in the empty JSON string", ShortSessionCreateReq.openapiRequiredFields.toString())); + if (!ConnectTokenDataPasskeyLogin.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectTokenDataPasskeyLogin is not found in the empty JSON string", ConnectTokenDataPasskeyLogin.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ShortSessionCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShortSessionCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!ConnectTokenDataPasskeyLogin.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectTokenDataPasskeyLogin` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ShortSessionCreateReq.openapiRequiredFields) { + for (String requiredField : ConnectTokenDataPasskeyLogin.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `appType` - AppType.validateJsonElement(jsonObj.get("appType")); - if (!jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + if (!jsonObj.get("identifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifier").toString())); } } @@ -196,22 +166,22 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ShortSessionCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ShortSessionCreateReq' and its subtypes + if (!ConnectTokenDataPasskeyLogin.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectTokenDataPasskeyLogin' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ShortSessionCreateReq.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyLogin.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ShortSessionCreateReq value) throws IOException { + public void write(JsonWriter out, ConnectTokenDataPasskeyLogin value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ShortSessionCreateReq read(JsonReader in) throws IOException { + public ConnectTokenDataPasskeyLogin read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -222,18 +192,18 @@ public ShortSessionCreateReq read(JsonReader in) throws IOException { } /** - * Create an instance of ShortSessionCreateReq given an JSON string + * Create an instance of ConnectTokenDataPasskeyLogin given an JSON string * * @param jsonString JSON string - * @return An instance of ShortSessionCreateReq - * @throws IOException if the JSON string is invalid with respect to ShortSessionCreateReq + * @return An instance of ConnectTokenDataPasskeyLogin + * @throws IOException if the JSON string is invalid with respect to ConnectTokenDataPasskeyLogin */ - public static ShortSessionCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ShortSessionCreateReq.class); + public static ConnectTokenDataPasskeyLogin fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectTokenDataPasskeyLogin.class); } /** - * Convert an instance of ShortSessionCreateReq to an JSON string + * Convert an instance of ConnectTokenDataPasskeyLogin to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenList.java b/src/main/java/com/corbado/generated/model/ConnectTokenList.java index ed033fb..3770d05 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenList.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenList.java @@ -41,7 +41,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,20 +52,22 @@ /** * ConnectTokenList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ConnectTokenList { public static final String SERIALIZED_NAME_CONNECT_TOKENS = "connectTokens"; @SerializedName(SERIALIZED_NAME_CONNECT_TOKENS) + @javax.annotation.Nonnull private List connectTokens = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGING = "paging"; @SerializedName(SERIALIZED_NAME_PAGING) + @javax.annotation.Nonnull private Paging paging; public ConnectTokenList() { } - public ConnectTokenList connectTokens(List connectTokens) { + public ConnectTokenList connectTokens(@javax.annotation.Nonnull List connectTokens) { this.connectTokens = connectTokens; return this; } @@ -88,12 +89,12 @@ public List getConnectTokens() { return connectTokens; } - public void setConnectTokens(List connectTokens) { + public void setConnectTokens(@javax.annotation.Nonnull List connectTokens) { this.connectTokens = connectTokens; } - public ConnectTokenList paging(Paging paging) { + public ConnectTokenList paging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; return this; } @@ -107,7 +108,7 @@ public Paging getPaging() { return paging; } - public void setPaging(Paging paging) { + public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenType.java b/src/main/java/com/corbado/generated/model/ConnectTokenType.java index 97cf6f8..51ea620 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenType.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenType.java @@ -29,11 +29,13 @@ @JsonAdapter(ConnectTokenType.Adapter.class) public enum ConnectTokenType { - APPEND("passkey-append"), + PASSKEY_APPEND("passkey-append"), - DELETE("passkey-delete"), + PASSKEY_DELETE("passkey-delete"), - LIST("passkey-list"); + PASSKEY_LIST("passkey-list"), + + PASSKEY_LOGIN("passkey-login"); private String value; diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java index 45d4daa..8850344 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,16 +49,17 @@ /** * ConnectTokenUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ConnectTokenUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private ConnectTokenStatus status; public ConnectTokenUpdateReq() { } - public ConnectTokenUpdateReq status(ConnectTokenStatus status) { + public ConnectTokenUpdateReq status(@javax.annotation.Nonnull ConnectTokenStatus status) { this.status = status; return this; } @@ -73,7 +73,7 @@ public ConnectTokenStatus getStatus() { return status; } - public void setStatus(ConnectTokenStatus status) { + public void setStatus(@javax.annotation.Nonnull ConnectTokenStatus status) { this.status = status; } diff --git a/src/main/java/com/corbado/generated/model/Credential.java b/src/main/java/com/corbado/generated/model/Credential.java index 2752d29..cc3d3f8 100644 --- a/src/main/java/com/corbado/generated/model/Credential.java +++ b/src/main/java/com/corbado/generated/model/Credential.java @@ -14,6 +14,7 @@ package com.corbado.generated.model; import java.util.Objects; +import com.corbado.generated.model.AaguidDetails; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -39,7 +40,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,18 +51,21 @@ /** * Credential */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class Credential { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull private String id; public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + @javax.annotation.Nonnull private String credentialID; public static final String SERIALIZED_NAME_ATTESTATION_TYPE = "attestationType"; @SerializedName(SERIALIZED_NAME_ATTESTATION_TYPE) + @javax.annotation.Nonnull private String attestationType; /** @@ -127,36 +130,54 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_TRANSPORT = "transport"; @SerializedName(SERIALIZED_NAME_TRANSPORT) + @javax.annotation.Nonnull private List transport = new ArrayList<>(); public static final String SERIALIZED_NAME_BACKUP_ELIGIBLE = "backupEligible"; @SerializedName(SERIALIZED_NAME_BACKUP_ELIGIBLE) + @javax.annotation.Nonnull private Boolean backupEligible; public static final String SERIALIZED_NAME_BACKUP_STATE = "backupState"; @SerializedName(SERIALIZED_NAME_BACKUP_STATE) + @javax.annotation.Nonnull private Boolean backupState; public static final String SERIALIZED_NAME_AUTHENTICATOR_A_A_G_U_I_D = "authenticatorAAGUID"; @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_A_A_G_U_I_D) + @javax.annotation.Nonnull private String authenticatorAAGUID; public static final String SERIALIZED_NAME_SOURCE_O_S = "sourceOS"; @SerializedName(SERIALIZED_NAME_SOURCE_O_S) + @javax.annotation.Nonnull private String sourceOS; public static final String SERIALIZED_NAME_SOURCE_BROWSER = "sourceBrowser"; @SerializedName(SERIALIZED_NAME_SOURCE_BROWSER) + @javax.annotation.Nonnull private String sourceBrowser; public static final String SERIALIZED_NAME_LAST_USED = "lastUsed"; @SerializedName(SERIALIZED_NAME_LAST_USED) + @javax.annotation.Nonnull private String lastUsed; + public static final String SERIALIZED_NAME_LAST_USED_MS = "lastUsedMs"; + @SerializedName(SERIALIZED_NAME_LAST_USED_MS) + @javax.annotation.Nonnull + private Long lastUsedMs; + public static final String SERIALIZED_NAME_CREATED = "created"; @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nonnull private String created; + public static final String SERIALIZED_NAME_CREATED_MS = "createdMs"; + @SerializedName(SERIALIZED_NAME_CREATED_MS) + @javax.annotation.Nonnull + private Long createdMs; + /** * Status */ @@ -211,12 +232,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private StatusEnum status; + public static final String SERIALIZED_NAME_AAGUID_DETAILS = "aaguidDetails"; + @SerializedName(SERIALIZED_NAME_AAGUID_DETAILS) + @javax.annotation.Nonnull + private AaguidDetails aaguidDetails; + public Credential() { } - public Credential id(String id) { + public Credential id(@javax.annotation.Nonnull String id) { this.id = id; return this; } @@ -230,12 +257,12 @@ public String getId() { return id; } - public void setId(String id) { + public void setId(@javax.annotation.Nonnull String id) { this.id = id; } - public Credential credentialID(String credentialID) { + public Credential credentialID(@javax.annotation.Nonnull String credentialID) { this.credentialID = credentialID; return this; } @@ -249,12 +276,12 @@ public String getCredentialID() { return credentialID; } - public void setCredentialID(String credentialID) { + public void setCredentialID(@javax.annotation.Nonnull String credentialID) { this.credentialID = credentialID; } - public Credential attestationType(String attestationType) { + public Credential attestationType(@javax.annotation.Nonnull String attestationType) { this.attestationType = attestationType; return this; } @@ -268,12 +295,12 @@ public String getAttestationType() { return attestationType; } - public void setAttestationType(String attestationType) { + public void setAttestationType(@javax.annotation.Nonnull String attestationType) { this.attestationType = attestationType; } - public Credential transport(List transport) { + public Credential transport(@javax.annotation.Nonnull List transport) { this.transport = transport; return this; } @@ -295,12 +322,12 @@ public List getTransport() { return transport; } - public void setTransport(List transport) { + public void setTransport(@javax.annotation.Nonnull List transport) { this.transport = transport; } - public Credential backupEligible(Boolean backupEligible) { + public Credential backupEligible(@javax.annotation.Nonnull Boolean backupEligible) { this.backupEligible = backupEligible; return this; } @@ -314,12 +341,12 @@ public Boolean getBackupEligible() { return backupEligible; } - public void setBackupEligible(Boolean backupEligible) { + public void setBackupEligible(@javax.annotation.Nonnull Boolean backupEligible) { this.backupEligible = backupEligible; } - public Credential backupState(Boolean backupState) { + public Credential backupState(@javax.annotation.Nonnull Boolean backupState) { this.backupState = backupState; return this; } @@ -333,12 +360,12 @@ public Boolean getBackupState() { return backupState; } - public void setBackupState(Boolean backupState) { + public void setBackupState(@javax.annotation.Nonnull Boolean backupState) { this.backupState = backupState; } - public Credential authenticatorAAGUID(String authenticatorAAGUID) { + public Credential authenticatorAAGUID(@javax.annotation.Nonnull String authenticatorAAGUID) { this.authenticatorAAGUID = authenticatorAAGUID; return this; } @@ -352,12 +379,12 @@ public String getAuthenticatorAAGUID() { return authenticatorAAGUID; } - public void setAuthenticatorAAGUID(String authenticatorAAGUID) { + public void setAuthenticatorAAGUID(@javax.annotation.Nonnull String authenticatorAAGUID) { this.authenticatorAAGUID = authenticatorAAGUID; } - public Credential sourceOS(String sourceOS) { + public Credential sourceOS(@javax.annotation.Nonnull String sourceOS) { this.sourceOS = sourceOS; return this; } @@ -371,12 +398,12 @@ public String getSourceOS() { return sourceOS; } - public void setSourceOS(String sourceOS) { + public void setSourceOS(@javax.annotation.Nonnull String sourceOS) { this.sourceOS = sourceOS; } - public Credential sourceBrowser(String sourceBrowser) { + public Credential sourceBrowser(@javax.annotation.Nonnull String sourceBrowser) { this.sourceBrowser = sourceBrowser; return this; } @@ -390,12 +417,12 @@ public String getSourceBrowser() { return sourceBrowser; } - public void setSourceBrowser(String sourceBrowser) { + public void setSourceBrowser(@javax.annotation.Nonnull String sourceBrowser) { this.sourceBrowser = sourceBrowser; } - public Credential lastUsed(String lastUsed) { + public Credential lastUsed(@javax.annotation.Nonnull String lastUsed) { this.lastUsed = lastUsed; return this; } @@ -409,12 +436,31 @@ public String getLastUsed() { return lastUsed; } - public void setLastUsed(String lastUsed) { + public void setLastUsed(@javax.annotation.Nonnull String lastUsed) { this.lastUsed = lastUsed; } - public Credential created(String created) { + public Credential lastUsedMs(@javax.annotation.Nonnull Long lastUsedMs) { + this.lastUsedMs = lastUsedMs; + return this; + } + + /** + * Get lastUsedMs + * @return lastUsedMs + */ + @javax.annotation.Nonnull + public Long getLastUsedMs() { + return lastUsedMs; + } + + public void setLastUsedMs(@javax.annotation.Nonnull Long lastUsedMs) { + this.lastUsedMs = lastUsedMs; + } + + + public Credential created(@javax.annotation.Nonnull String created) { this.created = created; return this; } @@ -428,12 +474,31 @@ public String getCreated() { return created; } - public void setCreated(String created) { + public void setCreated(@javax.annotation.Nonnull String created) { this.created = created; } - public Credential status(StatusEnum status) { + public Credential createdMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + return this; + } + + /** + * Get createdMs + * @return createdMs + */ + @javax.annotation.Nonnull + public Long getCreatedMs() { + return createdMs; + } + + public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + } + + + public Credential status(@javax.annotation.Nonnull StatusEnum status) { this.status = status; return this; } @@ -447,11 +512,30 @@ public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { this.status = status; } + public Credential aaguidDetails(@javax.annotation.Nonnull AaguidDetails aaguidDetails) { + this.aaguidDetails = aaguidDetails; + return this; + } + + /** + * Get aaguidDetails + * @return aaguidDetails + */ + @javax.annotation.Nonnull + public AaguidDetails getAaguidDetails() { + return aaguidDetails; + } + + public void setAaguidDetails(@javax.annotation.Nonnull AaguidDetails aaguidDetails) { + this.aaguidDetails = aaguidDetails; + } + + @Override public boolean equals(Object o) { @@ -472,13 +556,16 @@ public boolean equals(Object o) { Objects.equals(this.sourceOS, credential.sourceOS) && Objects.equals(this.sourceBrowser, credential.sourceBrowser) && Objects.equals(this.lastUsed, credential.lastUsed) && + Objects.equals(this.lastUsedMs, credential.lastUsedMs) && Objects.equals(this.created, credential.created) && - Objects.equals(this.status, credential.status); + Objects.equals(this.createdMs, credential.createdMs) && + Objects.equals(this.status, credential.status) && + Objects.equals(this.aaguidDetails, credential.aaguidDetails); } @Override public int hashCode() { - return Objects.hash(id, credentialID, attestationType, transport, backupEligible, backupState, authenticatorAAGUID, sourceOS, sourceBrowser, lastUsed, created, status); + return Objects.hash(id, credentialID, attestationType, transport, backupEligible, backupState, authenticatorAAGUID, sourceOS, sourceBrowser, lastUsed, lastUsedMs, created, createdMs, status, aaguidDetails); } @Override @@ -495,8 +582,11 @@ public String toString() { sb.append(" sourceOS: ").append(toIndentedString(sourceOS)).append("\n"); sb.append(" sourceBrowser: ").append(toIndentedString(sourceBrowser)).append("\n"); sb.append(" lastUsed: ").append(toIndentedString(lastUsed)).append("\n"); + sb.append(" lastUsedMs: ").append(toIndentedString(lastUsedMs)).append("\n"); sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" aaguidDetails: ").append(toIndentedString(aaguidDetails)).append("\n"); sb.append("}"); return sb.toString(); } @@ -529,8 +619,11 @@ private String toIndentedString(Object o) { openapiFields.add("sourceOS"); openapiFields.add("sourceBrowser"); openapiFields.add("lastUsed"); + openapiFields.add("lastUsedMs"); openapiFields.add("created"); + openapiFields.add("createdMs"); openapiFields.add("status"); + openapiFields.add("aaguidDetails"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -544,8 +637,11 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("sourceOS"); openapiRequiredFields.add("sourceBrowser"); openapiRequiredFields.add("lastUsed"); + openapiRequiredFields.add("lastUsedMs"); openapiRequiredFields.add("created"); + openapiRequiredFields.add("createdMs"); openapiRequiredFields.add("status"); + openapiRequiredFields.add("aaguidDetails"); } /** @@ -611,6 +707,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `status` StatusEnum.validateJsonElement(jsonObj.get("status")); + // validate the required field `aaguidDetails` + AaguidDetails.validateJsonElement(jsonObj.get("aaguidDetails")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/CredentialList.java b/src/main/java/com/corbado/generated/model/CredentialList.java index 214b19c..6bccb97 100644 --- a/src/main/java/com/corbado/generated/model/CredentialList.java +++ b/src/main/java/com/corbado/generated/model/CredentialList.java @@ -41,7 +41,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,20 +52,22 @@ /** * CredentialList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class CredentialList { public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; @SerializedName(SERIALIZED_NAME_CREDENTIALS) + @javax.annotation.Nonnull private List credentials = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGING = "paging"; @SerializedName(SERIALIZED_NAME_PAGING) + @javax.annotation.Nonnull private Paging paging; public CredentialList() { } - public CredentialList credentials(List credentials) { + public CredentialList credentials(@javax.annotation.Nonnull List credentials) { this.credentials = credentials; return this; } @@ -88,12 +89,12 @@ public List getCredentials() { return credentials; } - public void setCredentials(List credentials) { + public void setCredentials(@javax.annotation.Nonnull List credentials) { this.credentials = credentials; } - public CredentialList paging(Paging paging) { + public CredentialList paging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; return this; } @@ -107,7 +108,7 @@ public Paging getPaging() { return paging; } - public void setPaging(Paging paging) { + public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } diff --git a/src/main/java/com/corbado/generated/model/DecisionInsights.java b/src/main/java/com/corbado/generated/model/DecisionInsights.java new file mode 100644 index 0000000..cc388bb --- /dev/null +++ b/src/main/java/com/corbado/generated/model/DecisionInsights.java @@ -0,0 +1,314 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.DecisionTag; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * DecisionInsights + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class DecisionInsights { + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + @javax.annotation.Nonnull + private DecisionTag tag; + + public static final String SERIALIZED_NAME_IS_C_D_A_CANDIDATE = "isCDACandidate"; + @SerializedName(SERIALIZED_NAME_IS_C_D_A_CANDIDATE) + @javax.annotation.Nonnull + private Boolean isCDACandidate; + + public static final String SERIALIZED_NAME_IS_RESTRICTED_BROWSER = "isRestrictedBrowser"; + @SerializedName(SERIALIZED_NAME_IS_RESTRICTED_BROWSER) + @javax.annotation.Nonnull + private Boolean isRestrictedBrowser; + + public static final String SERIALIZED_NAME_EXPERIMENTS = "experiments"; + @SerializedName(SERIALIZED_NAME_EXPERIMENTS) + @javax.annotation.Nonnull + private List experiments = new ArrayList<>(); + + public DecisionInsights() { + } + + public DecisionInsights tag(@javax.annotation.Nonnull DecisionTag tag) { + this.tag = tag; + return this; + } + + /** + * Get tag + * @return tag + */ + @javax.annotation.Nonnull + public DecisionTag getTag() { + return tag; + } + + public void setTag(@javax.annotation.Nonnull DecisionTag tag) { + this.tag = tag; + } + + + public DecisionInsights isCDACandidate(@javax.annotation.Nonnull Boolean isCDACandidate) { + this.isCDACandidate = isCDACandidate; + return this; + } + + /** + * Get isCDACandidate + * @return isCDACandidate + */ + @javax.annotation.Nonnull + public Boolean getIsCDACandidate() { + return isCDACandidate; + } + + public void setIsCDACandidate(@javax.annotation.Nonnull Boolean isCDACandidate) { + this.isCDACandidate = isCDACandidate; + } + + + public DecisionInsights isRestrictedBrowser(@javax.annotation.Nonnull Boolean isRestrictedBrowser) { + this.isRestrictedBrowser = isRestrictedBrowser; + return this; + } + + /** + * Get isRestrictedBrowser + * @return isRestrictedBrowser + */ + @javax.annotation.Nonnull + public Boolean getIsRestrictedBrowser() { + return isRestrictedBrowser; + } + + public void setIsRestrictedBrowser(@javax.annotation.Nonnull Boolean isRestrictedBrowser) { + this.isRestrictedBrowser = isRestrictedBrowser; + } + + + public DecisionInsights experiments(@javax.annotation.Nonnull List experiments) { + this.experiments = experiments; + return this; + } + + public DecisionInsights addExperimentsItem(String experimentsItem) { + if (this.experiments == null) { + this.experiments = new ArrayList<>(); + } + this.experiments.add(experimentsItem); + return this; + } + + /** + * Get experiments + * @return experiments + */ + @javax.annotation.Nonnull + public List getExperiments() { + return experiments; + } + + public void setExperiments(@javax.annotation.Nonnull List experiments) { + this.experiments = experiments; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DecisionInsights decisionInsights = (DecisionInsights) o; + return Objects.equals(this.tag, decisionInsights.tag) && + Objects.equals(this.isCDACandidate, decisionInsights.isCDACandidate) && + Objects.equals(this.isRestrictedBrowser, decisionInsights.isRestrictedBrowser) && + Objects.equals(this.experiments, decisionInsights.experiments); + } + + @Override + public int hashCode() { + return Objects.hash(tag, isCDACandidate, isRestrictedBrowser, experiments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DecisionInsights {\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" isCDACandidate: ").append(toIndentedString(isCDACandidate)).append("\n"); + sb.append(" isRestrictedBrowser: ").append(toIndentedString(isRestrictedBrowser)).append("\n"); + sb.append(" experiments: ").append(toIndentedString(experiments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("tag"); + openapiFields.add("isCDACandidate"); + openapiFields.add("isRestrictedBrowser"); + openapiFields.add("experiments"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("tag"); + openapiRequiredFields.add("isCDACandidate"); + openapiRequiredFields.add("isRestrictedBrowser"); + openapiRequiredFields.add("experiments"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DecisionInsights + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DecisionInsights.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DecisionInsights is not found in the empty JSON string", DecisionInsights.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DecisionInsights.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DecisionInsights` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DecisionInsights.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `tag` + DecisionTag.validateJsonElement(jsonObj.get("tag")); + // ensure the required json array is present + if (jsonObj.get("experiments") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("experiments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `experiments` to be an array in the JSON string but got `%s`", jsonObj.get("experiments").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DecisionInsights.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DecisionInsights' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DecisionInsights.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DecisionInsights value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DecisionInsights read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DecisionInsights given an JSON string + * + * @param jsonString JSON string + * @return An instance of DecisionInsights + * @throws IOException if the JSON string is invalid with respect to DecisionInsights + */ + public static DecisionInsights fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DecisionInsights.class); + } + + /** + * Convert an instance of DecisionInsights to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/DecisionTag.java b/src/main/java/com/corbado/generated/model/DecisionTag.java index b52aac0..de02582 100644 --- a/src/main/java/com/corbado/generated/model/DecisionTag.java +++ b/src/main/java/com/corbado/generated/model/DecisionTag.java @@ -29,6 +29,8 @@ @JsonAdapter(DecisionTag.Adapter.class) public enum DecisionTag { + ENV_NO_PLATFORM_PK_SUPPORT("env-no-platform-pk-support"), + ENV_NO_PK_SUPPORT("env-no-pk-support"), USER_NO_PKS("user-no-pks"), @@ -63,7 +65,11 @@ public enum DecisionTag { PROCESS_PK_LOGIN_INCOMPLETE("process-pk-login-incomplete"), - PROCESS_PK_LOGIN_CROSS_PLATFORM_COMPLETED("process-pk-login-cross-platform-completed"); + PROCESS_PK_LOGIN_CROSS_PLATFORM_COMPLETED("process-pk-login-cross-platform-completed"), + + DEVICE_LOCAL_PLATFORM_PASSKEY_EXPERIMENT("device-local-platform-passkey-experiment"), + + ENV_BROKEN("env-broken"); private String value; diff --git a/src/main/java/com/corbado/generated/model/DetectionInsights.java b/src/main/java/com/corbado/generated/model/DetectionInsights.java new file mode 100644 index 0000000..ddba22b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/DetectionInsights.java @@ -0,0 +1,358 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.DetectionTag; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * DetectionInsights + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class DetectionInsights { + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + @javax.annotation.Nonnull + private List tags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CREDENTIAL_IDS = "credentialIds"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_IDS) + @javax.annotation.Nonnull + private List credentialIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CLIENT_ENV_IDS = "clientEnvIds"; + @SerializedName(SERIALIZED_NAME_CLIENT_ENV_IDS) + @javax.annotation.Nonnull + private List clientEnvIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PASSWORD_MANAGER_IDS = "passwordManagerIds"; + @SerializedName(SERIALIZED_NAME_PASSWORD_MANAGER_IDS) + @javax.annotation.Nonnull + private List passwordManagerIds = new ArrayList<>(); + + public DetectionInsights() { + } + + public DetectionInsights tags(@javax.annotation.Nonnull List tags) { + this.tags = tags; + return this; + } + + public DetectionInsights addTagsItem(DetectionTag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @javax.annotation.Nonnull + public List getTags() { + return tags; + } + + public void setTags(@javax.annotation.Nonnull List tags) { + this.tags = tags; + } + + + public DetectionInsights credentialIds(@javax.annotation.Nonnull List credentialIds) { + this.credentialIds = credentialIds; + return this; + } + + public DetectionInsights addCredentialIdsItem(String credentialIdsItem) { + if (this.credentialIds == null) { + this.credentialIds = new ArrayList<>(); + } + this.credentialIds.add(credentialIdsItem); + return this; + } + + /** + * Get credentialIds + * @return credentialIds + */ + @javax.annotation.Nonnull + public List getCredentialIds() { + return credentialIds; + } + + public void setCredentialIds(@javax.annotation.Nonnull List credentialIds) { + this.credentialIds = credentialIds; + } + + + public DetectionInsights clientEnvIds(@javax.annotation.Nonnull List clientEnvIds) { + this.clientEnvIds = clientEnvIds; + return this; + } + + public DetectionInsights addClientEnvIdsItem(String clientEnvIdsItem) { + if (this.clientEnvIds == null) { + this.clientEnvIds = new ArrayList<>(); + } + this.clientEnvIds.add(clientEnvIdsItem); + return this; + } + + /** + * Get clientEnvIds + * @return clientEnvIds + */ + @javax.annotation.Nonnull + public List getClientEnvIds() { + return clientEnvIds; + } + + public void setClientEnvIds(@javax.annotation.Nonnull List clientEnvIds) { + this.clientEnvIds = clientEnvIds; + } + + + public DetectionInsights passwordManagerIds(@javax.annotation.Nonnull List passwordManagerIds) { + this.passwordManagerIds = passwordManagerIds; + return this; + } + + public DetectionInsights addPasswordManagerIdsItem(String passwordManagerIdsItem) { + if (this.passwordManagerIds == null) { + this.passwordManagerIds = new ArrayList<>(); + } + this.passwordManagerIds.add(passwordManagerIdsItem); + return this; + } + + /** + * Get passwordManagerIds + * @return passwordManagerIds + */ + @javax.annotation.Nonnull + public List getPasswordManagerIds() { + return passwordManagerIds; + } + + public void setPasswordManagerIds(@javax.annotation.Nonnull List passwordManagerIds) { + this.passwordManagerIds = passwordManagerIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DetectionInsights detectionInsights = (DetectionInsights) o; + return Objects.equals(this.tags, detectionInsights.tags) && + Objects.equals(this.credentialIds, detectionInsights.credentialIds) && + Objects.equals(this.clientEnvIds, detectionInsights.clientEnvIds) && + Objects.equals(this.passwordManagerIds, detectionInsights.passwordManagerIds); + } + + @Override + public int hashCode() { + return Objects.hash(tags, credentialIds, clientEnvIds, passwordManagerIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DetectionInsights {\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" credentialIds: ").append(toIndentedString(credentialIds)).append("\n"); + sb.append(" clientEnvIds: ").append(toIndentedString(clientEnvIds)).append("\n"); + sb.append(" passwordManagerIds: ").append(toIndentedString(passwordManagerIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("tags"); + openapiFields.add("credentialIds"); + openapiFields.add("clientEnvIds"); + openapiFields.add("passwordManagerIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("tags"); + openapiRequiredFields.add("credentialIds"); + openapiRequiredFields.add("clientEnvIds"); + openapiRequiredFields.add("passwordManagerIds"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DetectionInsights + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DetectionInsights.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DetectionInsights is not found in the empty JSON string", DetectionInsights.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DetectionInsights.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DetectionInsights` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DetectionInsights.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the required field `tags` (array) + for (int i = 0; i < jsonArraytags.size(); i++) { + DetectionTag.validateJsonElement(jsonArraytags.get(i)); + }; + // ensure the required json array is present + if (jsonObj.get("credentialIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("credentialIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialIds` to be an array in the JSON string but got `%s`", jsonObj.get("credentialIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("clientEnvIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("clientEnvIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `clientEnvIds` to be an array in the JSON string but got `%s`", jsonObj.get("clientEnvIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("passwordManagerIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("passwordManagerIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `passwordManagerIds` to be an array in the JSON string but got `%s`", jsonObj.get("passwordManagerIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DetectionInsights.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DetectionInsights' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DetectionInsights.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DetectionInsights value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DetectionInsights read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DetectionInsights given an JSON string + * + * @param jsonString JSON string + * @return An instance of DetectionInsights + * @throws IOException if the JSON string is invalid with respect to DetectionInsights + */ + public static DetectionInsights fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DetectionInsights.class); + } + + /** + * Convert an instance of DetectionInsights to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/DetectionTag.java b/src/main/java/com/corbado/generated/model/DetectionTag.java index e958e18..9bbacc2 100644 --- a/src/main/java/com/corbado/generated/model/DetectionTag.java +++ b/src/main/java/com/corbado/generated/model/DetectionTag.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,7 +48,7 @@ /** * DetectionTag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class DetectionTag { /** * Gets or Sets category @@ -109,16 +108,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_CATEGORY = "category"; @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nonnull private CategoryEnum category; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull private String name; public DetectionTag() { } - public DetectionTag category(CategoryEnum category) { + public DetectionTag category(@javax.annotation.Nonnull CategoryEnum category) { this.category = category; return this; } @@ -132,12 +133,12 @@ public CategoryEnum getCategory() { return category; } - public void setCategory(CategoryEnum category) { + public void setCategory(@javax.annotation.Nonnull CategoryEnum category) { this.category = category; } - public DetectionTag name(String name) { + public DetectionTag name(@javax.annotation.Nonnull String name) { this.name = name; return this; } @@ -151,7 +152,7 @@ public String getName() { return name; } - public void setName(String name) { + public void setName(@javax.annotation.Nonnull String name) { this.name = name; } diff --git a/src/main/java/com/corbado/generated/model/ErrorRsp.java b/src/main/java/com/corbado/generated/model/ErrorRsp.java index 59c25a1..f690348 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRsp.java +++ b/src/main/java/com/corbado/generated/model/ErrorRsp.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,44 +50,48 @@ /** * ErrorRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ErrorRsp { public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + @javax.annotation.Nonnull private Integer httpStatusCode; public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull private String message; public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + @javax.annotation.Nonnull private RequestData requestData; public static final String SERIALIZED_NAME_RUNTIME = "runtime"; @SerializedName(SERIALIZED_NAME_RUNTIME) + @javax.annotation.Nonnull private Float runtime; public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable private Object data; public static final String SERIALIZED_NAME_ERROR = "error"; @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nonnull private ErrorRspAllOfError error; public ErrorRsp() { } - public ErrorRsp httpStatusCode(Integer httpStatusCode) { + public ErrorRsp httpStatusCode(@javax.annotation.Nonnull Integer httpStatusCode) { this.httpStatusCode = httpStatusCode; return this; } /** * HTTP status code of operation - * minimum: 200 - * maximum: 599 * @return httpStatusCode */ @javax.annotation.Nonnull @@ -96,12 +99,12 @@ public Integer getHttpStatusCode() { return httpStatusCode; } - public void setHttpStatusCode(Integer httpStatusCode) { + public void setHttpStatusCode(@javax.annotation.Nonnull Integer httpStatusCode) { this.httpStatusCode = httpStatusCode; } - public ErrorRsp message(String message) { + public ErrorRsp message(@javax.annotation.Nonnull String message) { this.message = message; return this; } @@ -115,12 +118,12 @@ public String getMessage() { return message; } - public void setMessage(String message) { + public void setMessage(@javax.annotation.Nonnull String message) { this.message = message; } - public ErrorRsp requestData(RequestData requestData) { + public ErrorRsp requestData(@javax.annotation.Nonnull RequestData requestData) { this.requestData = requestData; return this; } @@ -134,12 +137,12 @@ public RequestData getRequestData() { return requestData; } - public void setRequestData(RequestData requestData) { + public void setRequestData(@javax.annotation.Nonnull RequestData requestData) { this.requestData = requestData; } - public ErrorRsp runtime(Float runtime) { + public ErrorRsp runtime(@javax.annotation.Nonnull Float runtime) { this.runtime = runtime; return this; } @@ -153,12 +156,12 @@ public Float getRuntime() { return runtime; } - public void setRuntime(Float runtime) { + public void setRuntime(@javax.annotation.Nonnull Float runtime) { this.runtime = runtime; } - public ErrorRsp data(Object data) { + public ErrorRsp data(@javax.annotation.Nullable Object data) { this.data = data; return this; } @@ -172,12 +175,12 @@ public Object getData() { return data; } - public void setData(Object data) { + public void setData(@javax.annotation.Nullable Object data) { this.data = data; } - public ErrorRsp error(ErrorRspAllOfError error) { + public ErrorRsp error(@javax.annotation.Nonnull ErrorRspAllOfError error) { this.error = error; return this; } @@ -191,7 +194,7 @@ public ErrorRspAllOfError getError() { return error; } - public void setError(ErrorRspAllOfError error) { + public void setError(@javax.annotation.Nonnull ErrorRspAllOfError error) { this.error = error; } diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java index 4cc8f65..22d4329 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java @@ -40,7 +40,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -52,28 +51,32 @@ /** * ErrorRspAllOfError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ErrorRspAllOfError { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull private String type; public static final String SERIALIZED_NAME_DETAILS = "details"; @SerializedName(SERIALIZED_NAME_DETAILS) + @javax.annotation.Nullable private String details; public static final String SERIALIZED_NAME_VALIDATION = "validation"; @SerializedName(SERIALIZED_NAME_VALIDATION) + @javax.annotation.Nullable private List validation = new ArrayList<>(); public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nullable private List links = new ArrayList<>(); public ErrorRspAllOfError() { } - public ErrorRspAllOfError type(String type) { + public ErrorRspAllOfError type(@javax.annotation.Nonnull String type) { this.type = type; return this; } @@ -87,12 +90,12 @@ public String getType() { return type; } - public void setType(String type) { + public void setType(@javax.annotation.Nonnull String type) { this.type = type; } - public ErrorRspAllOfError details(String details) { + public ErrorRspAllOfError details(@javax.annotation.Nullable String details) { this.details = details; return this; } @@ -106,12 +109,12 @@ public String getDetails() { return details; } - public void setDetails(String details) { + public void setDetails(@javax.annotation.Nullable String details) { this.details = details; } - public ErrorRspAllOfError validation(List validation) { + public ErrorRspAllOfError validation(@javax.annotation.Nullable List validation) { this.validation = validation; return this; } @@ -133,12 +136,12 @@ public List getValidation() { return validation; } - public void setValidation(List validation) { + public void setValidation(@javax.annotation.Nullable List validation) { this.validation = validation; } - public ErrorRspAllOfError links(List links) { + public ErrorRspAllOfError links(@javax.annotation.Nullable List links) { this.links = links; return this; } @@ -155,12 +158,12 @@ public ErrorRspAllOfError addLinksItem(String linksItem) { * Additional links to help understand the error * @return links */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public List getLinks() { return links; } - public void setLinks(List links) { + public void setLinks(@javax.annotation.Nullable List links) { this.links = links; } @@ -224,7 +227,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); - openapiRequiredFields.add("links"); } /** @@ -275,10 +277,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // ensure the required json array is present - if (jsonObj.get("links") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("links").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("links") != null && !jsonObj.get("links").isJsonNull() && !jsonObj.get("links").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString())); } } diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java index 8a8a509..2d964e4 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,20 +48,22 @@ /** * ErrorRspAllOfErrorValidation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ErrorRspAllOfErrorValidation { public static final String SERIALIZED_NAME_FIELD = "field"; @SerializedName(SERIALIZED_NAME_FIELD) + @javax.annotation.Nonnull private String field; public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull private String message; public ErrorRspAllOfErrorValidation() { } - public ErrorRspAllOfErrorValidation field(String field) { + public ErrorRspAllOfErrorValidation field(@javax.annotation.Nonnull String field) { this.field = field; return this; } @@ -76,12 +77,12 @@ public String getField() { return field; } - public void setField(String field) { + public void setField(@javax.annotation.Nonnull String field) { this.field = field; } - public ErrorRspAllOfErrorValidation message(String message) { + public ErrorRspAllOfErrorValidation message(@javax.annotation.Nonnull String message) { this.message = message; return this; } @@ -95,7 +96,7 @@ public String getMessage() { return message; } - public void setMessage(String message) { + public void setMessage(@javax.annotation.Nonnull String message) { this.message = message; } diff --git a/src/main/java/com/corbado/generated/model/GenericRsp.java b/src/main/java/com/corbado/generated/model/GenericRsp.java index e748774..865d1ad 100644 --- a/src/main/java/com/corbado/generated/model/GenericRsp.java +++ b/src/main/java/com/corbado/generated/model/GenericRsp.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,36 +49,38 @@ /** * GenericRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class GenericRsp { public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + @javax.annotation.Nonnull private Integer httpStatusCode; public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull private String message; public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + @javax.annotation.Nonnull private RequestData requestData; public static final String SERIALIZED_NAME_RUNTIME = "runtime"; @SerializedName(SERIALIZED_NAME_RUNTIME) + @javax.annotation.Nonnull private Float runtime; public GenericRsp() { } - public GenericRsp httpStatusCode(Integer httpStatusCode) { + public GenericRsp httpStatusCode(@javax.annotation.Nonnull Integer httpStatusCode) { this.httpStatusCode = httpStatusCode; return this; } /** * HTTP status code of operation - * minimum: 200 - * maximum: 599 * @return httpStatusCode */ @javax.annotation.Nonnull @@ -87,12 +88,12 @@ public Integer getHttpStatusCode() { return httpStatusCode; } - public void setHttpStatusCode(Integer httpStatusCode) { + public void setHttpStatusCode(@javax.annotation.Nonnull Integer httpStatusCode) { this.httpStatusCode = httpStatusCode; } - public GenericRsp message(String message) { + public GenericRsp message(@javax.annotation.Nonnull String message) { this.message = message; return this; } @@ -106,12 +107,12 @@ public String getMessage() { return message; } - public void setMessage(String message) { + public void setMessage(@javax.annotation.Nonnull String message) { this.message = message; } - public GenericRsp requestData(RequestData requestData) { + public GenericRsp requestData(@javax.annotation.Nonnull RequestData requestData) { this.requestData = requestData; return this; } @@ -125,12 +126,12 @@ public RequestData getRequestData() { return requestData; } - public void setRequestData(RequestData requestData) { + public void setRequestData(@javax.annotation.Nonnull RequestData requestData) { this.requestData = requestData; } - public GenericRsp runtime(Float runtime) { + public GenericRsp runtime(@javax.annotation.Nonnull Float runtime) { this.runtime = runtime; return this; } @@ -144,7 +145,7 @@ public Float getRuntime() { return runtime; } - public void setRuntime(Float runtime) { + public void setRuntime(@javax.annotation.Nonnull Float runtime) { this.runtime = runtime; } diff --git a/src/main/java/com/corbado/generated/model/Identifier.java b/src/main/java/com/corbado/generated/model/Identifier.java index e83fd2f..03f004f 100644 --- a/src/main/java/com/corbado/generated/model/Identifier.java +++ b/src/main/java/com/corbado/generated/model/Identifier.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,32 +50,37 @@ /** * Identifier */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class Identifier { public static final String SERIALIZED_NAME_IDENTIFIER_I_D = "identifierID"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_I_D) + @javax.annotation.Nonnull private String identifierID; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull private IdentifierType type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull private String value; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private IdentifierStatus status; public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public Identifier() { } - public Identifier identifierID(String identifierID) { + public Identifier identifierID(@javax.annotation.Nonnull String identifierID) { this.identifierID = identifierID; return this; } @@ -90,12 +94,12 @@ public String getIdentifierID() { return identifierID; } - public void setIdentifierID(String identifierID) { + public void setIdentifierID(@javax.annotation.Nonnull String identifierID) { this.identifierID = identifierID; } - public Identifier type(IdentifierType type) { + public Identifier type(@javax.annotation.Nonnull IdentifierType type) { this.type = type; return this; } @@ -109,12 +113,12 @@ public IdentifierType getType() { return type; } - public void setType(IdentifierType type) { + public void setType(@javax.annotation.Nonnull IdentifierType type) { this.type = type; } - public Identifier value(String value) { + public Identifier value(@javax.annotation.Nonnull String value) { this.value = value; return this; } @@ -128,12 +132,12 @@ public String getValue() { return value; } - public void setValue(String value) { + public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } - public Identifier status(IdentifierStatus status) { + public Identifier status(@javax.annotation.Nonnull IdentifierStatus status) { this.status = status; return this; } @@ -147,12 +151,12 @@ public IdentifierStatus getStatus() { return status; } - public void setStatus(IdentifierStatus status) { + public void setStatus(@javax.annotation.Nonnull IdentifierStatus status) { this.status = status; } - public Identifier userID(String userID) { + public Identifier userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -166,7 +170,7 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } diff --git a/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java b/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java index 7b9f256..1f8e5fd 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java +++ b/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,24 +50,27 @@ /** * IdentifierCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class IdentifierCreateReq { public static final String SERIALIZED_NAME_IDENTIFIER_TYPE = "identifierType"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_TYPE) + @javax.annotation.Nonnull private IdentifierType identifierType; public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + @javax.annotation.Nonnull private String identifierValue; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private IdentifierStatus status; public IdentifierCreateReq() { } - public IdentifierCreateReq identifierType(IdentifierType identifierType) { + public IdentifierCreateReq identifierType(@javax.annotation.Nonnull IdentifierType identifierType) { this.identifierType = identifierType; return this; } @@ -82,12 +84,12 @@ public IdentifierType getIdentifierType() { return identifierType; } - public void setIdentifierType(IdentifierType identifierType) { + public void setIdentifierType(@javax.annotation.Nonnull IdentifierType identifierType) { this.identifierType = identifierType; } - public IdentifierCreateReq identifierValue(String identifierValue) { + public IdentifierCreateReq identifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; return this; } @@ -101,12 +103,12 @@ public String getIdentifierValue() { return identifierValue; } - public void setIdentifierValue(String identifierValue) { + public void setIdentifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; } - public IdentifierCreateReq status(IdentifierStatus status) { + public IdentifierCreateReq status(@javax.annotation.Nonnull IdentifierStatus status) { this.status = status; return this; } @@ -120,7 +122,7 @@ public IdentifierStatus getStatus() { return status; } - public void setStatus(IdentifierStatus status) { + public void setStatus(@javax.annotation.Nonnull IdentifierStatus status) { this.status = status; } diff --git a/src/main/java/com/corbado/generated/model/IdentifierList.java b/src/main/java/com/corbado/generated/model/IdentifierList.java index d32d040..7385ecf 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierList.java +++ b/src/main/java/com/corbado/generated/model/IdentifierList.java @@ -41,7 +41,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,20 +52,22 @@ /** * IdentifierList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class IdentifierList { public static final String SERIALIZED_NAME_IDENTIFIERS = "identifiers"; @SerializedName(SERIALIZED_NAME_IDENTIFIERS) + @javax.annotation.Nonnull private List identifiers = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGING = "paging"; @SerializedName(SERIALIZED_NAME_PAGING) + @javax.annotation.Nonnull private Paging paging; public IdentifierList() { } - public IdentifierList identifiers(List identifiers) { + public IdentifierList identifiers(@javax.annotation.Nonnull List identifiers) { this.identifiers = identifiers; return this; } @@ -88,12 +89,12 @@ public List getIdentifiers() { return identifiers; } - public void setIdentifiers(List identifiers) { + public void setIdentifiers(@javax.annotation.Nonnull List identifiers) { this.identifiers = identifiers; } - public IdentifierList paging(Paging paging) { + public IdentifierList paging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; return this; } @@ -107,7 +108,7 @@ public Paging getPaging() { return paging; } - public void setPaging(Paging paging) { + public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } diff --git a/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java b/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java index 7ca6590..3db0c30 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,16 +49,17 @@ /** * IdentifierUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class IdentifierUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private IdentifierStatus status; public IdentifierUpdateReq() { } - public IdentifierUpdateReq status(IdentifierStatus status) { + public IdentifierUpdateReq status(@javax.annotation.Nonnull IdentifierStatus status) { this.status = status; return this; } @@ -73,7 +73,7 @@ public IdentifierStatus getStatus() { return status; } - public void setStatus(IdentifierStatus status) { + public void setStatus(@javax.annotation.Nonnull IdentifierStatus status) { this.status = status; } diff --git a/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java b/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java index b434791..a0db4f2 100644 --- a/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java +++ b/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,24 +48,27 @@ /** * JavaScriptHighEntropy */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class JavaScriptHighEntropy { public static final String SERIALIZED_NAME_PLATFORM = "platform"; @SerializedName(SERIALIZED_NAME_PLATFORM) + @javax.annotation.Nonnull private String platform; public static final String SERIALIZED_NAME_PLATFORM_VERSION = "platformVersion"; @SerializedName(SERIALIZED_NAME_PLATFORM_VERSION) + @javax.annotation.Nonnull private String platformVersion; public static final String SERIALIZED_NAME_MOBILE = "mobile"; @SerializedName(SERIALIZED_NAME_MOBILE) + @javax.annotation.Nonnull private Boolean mobile; public JavaScriptHighEntropy() { } - public JavaScriptHighEntropy platform(String platform) { + public JavaScriptHighEntropy platform(@javax.annotation.Nonnull String platform) { this.platform = platform; return this; } @@ -80,12 +82,12 @@ public String getPlatform() { return platform; } - public void setPlatform(String platform) { + public void setPlatform(@javax.annotation.Nonnull String platform) { this.platform = platform; } - public JavaScriptHighEntropy platformVersion(String platformVersion) { + public JavaScriptHighEntropy platformVersion(@javax.annotation.Nonnull String platformVersion) { this.platformVersion = platformVersion; return this; } @@ -99,12 +101,12 @@ public String getPlatformVersion() { return platformVersion; } - public void setPlatformVersion(String platformVersion) { + public void setPlatformVersion(@javax.annotation.Nonnull String platformVersion) { this.platformVersion = platformVersion; } - public JavaScriptHighEntropy mobile(Boolean mobile) { + public JavaScriptHighEntropy mobile(@javax.annotation.Nonnull Boolean mobile) { this.mobile = mobile; return this; } @@ -118,7 +120,7 @@ public Boolean getMobile() { return mobile; } - public void setMobile(Boolean mobile) { + public void setMobile(@javax.annotation.Nonnull Boolean mobile) { this.mobile = mobile; } diff --git a/src/main/java/com/corbado/generated/model/Paging.java b/src/main/java/com/corbado/generated/model/Paging.java index 223a5e2..44965c0 100644 --- a/src/main/java/com/corbado/generated/model/Paging.java +++ b/src/main/java/com/corbado/generated/model/Paging.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,24 +48,27 @@ /** * Paging */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class Paging { public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) + @javax.annotation.Nonnull private Integer page = 1; public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages"; @SerializedName(SERIALIZED_NAME_TOTAL_PAGES) + @javax.annotation.Nonnull private Integer totalPages; public static final String SERIALIZED_NAME_TOTAL_ITEMS = "totalItems"; @SerializedName(SERIALIZED_NAME_TOTAL_ITEMS) + @javax.annotation.Nonnull private Integer totalItems; public Paging() { } - public Paging page(Integer page) { + public Paging page(@javax.annotation.Nonnull Integer page) { this.page = page; return this; } @@ -80,12 +82,12 @@ public Integer getPage() { return page; } - public void setPage(Integer page) { + public void setPage(@javax.annotation.Nonnull Integer page) { this.page = page; } - public Paging totalPages(Integer totalPages) { + public Paging totalPages(@javax.annotation.Nonnull Integer totalPages) { this.totalPages = totalPages; return this; } @@ -99,12 +101,12 @@ public Integer getTotalPages() { return totalPages; } - public void setTotalPages(Integer totalPages) { + public void setTotalPages(@javax.annotation.Nonnull Integer totalPages) { this.totalPages = totalPages; } - public Paging totalItems(Integer totalItems) { + public Paging totalItems(@javax.annotation.Nonnull Integer totalItems) { this.totalItems = totalItems; return this; } @@ -118,7 +120,7 @@ public Integer getTotalItems() { return totalItems; } - public void setTotalItems(Integer totalItems) { + public void setTotalItems(@javax.annotation.Nonnull Integer totalItems) { this.totalItems = totalItems; } diff --git a/src/main/java/com/corbado/generated/model/ParsedDeviceInfo.java b/src/main/java/com/corbado/generated/model/ParsedDeviceInfo.java new file mode 100644 index 0000000..77593a0 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ParsedDeviceInfo.java @@ -0,0 +1,307 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ParsedDeviceInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ParsedDeviceInfo { + public static final String SERIALIZED_NAME_BROWSER_NAME = "browserName"; + @SerializedName(SERIALIZED_NAME_BROWSER_NAME) + @javax.annotation.Nonnull + private String browserName; + + public static final String SERIALIZED_NAME_BROWSER_VERSION = "browserVersion"; + @SerializedName(SERIALIZED_NAME_BROWSER_VERSION) + @javax.annotation.Nonnull + private String browserVersion; + + public static final String SERIALIZED_NAME_OS_NAME = "osName"; + @SerializedName(SERIALIZED_NAME_OS_NAME) + @javax.annotation.Nonnull + private String osName; + + public static final String SERIALIZED_NAME_OS_VERSION = "osVersion"; + @SerializedName(SERIALIZED_NAME_OS_VERSION) + @javax.annotation.Nonnull + private String osVersion; + + public ParsedDeviceInfo() { + } + + public ParsedDeviceInfo browserName(@javax.annotation.Nonnull String browserName) { + this.browserName = browserName; + return this; + } + + /** + * Get browserName + * @return browserName + */ + @javax.annotation.Nonnull + public String getBrowserName() { + return browserName; + } + + public void setBrowserName(@javax.annotation.Nonnull String browserName) { + this.browserName = browserName; + } + + + public ParsedDeviceInfo browserVersion(@javax.annotation.Nonnull String browserVersion) { + this.browserVersion = browserVersion; + return this; + } + + /** + * Get browserVersion + * @return browserVersion + */ + @javax.annotation.Nonnull + public String getBrowserVersion() { + return browserVersion; + } + + public void setBrowserVersion(@javax.annotation.Nonnull String browserVersion) { + this.browserVersion = browserVersion; + } + + + public ParsedDeviceInfo osName(@javax.annotation.Nonnull String osName) { + this.osName = osName; + return this; + } + + /** + * Get osName + * @return osName + */ + @javax.annotation.Nonnull + public String getOsName() { + return osName; + } + + public void setOsName(@javax.annotation.Nonnull String osName) { + this.osName = osName; + } + + + public ParsedDeviceInfo osVersion(@javax.annotation.Nonnull String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get osVersion + * @return osVersion + */ + @javax.annotation.Nonnull + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(@javax.annotation.Nonnull String osVersion) { + this.osVersion = osVersion; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParsedDeviceInfo parsedDeviceInfo = (ParsedDeviceInfo) o; + return Objects.equals(this.browserName, parsedDeviceInfo.browserName) && + Objects.equals(this.browserVersion, parsedDeviceInfo.browserVersion) && + Objects.equals(this.osName, parsedDeviceInfo.osName) && + Objects.equals(this.osVersion, parsedDeviceInfo.osVersion); + } + + @Override + public int hashCode() { + return Objects.hash(browserName, browserVersion, osName, osVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParsedDeviceInfo {\n"); + sb.append(" browserName: ").append(toIndentedString(browserName)).append("\n"); + sb.append(" browserVersion: ").append(toIndentedString(browserVersion)).append("\n"); + sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); + sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("browserName"); + openapiFields.add("browserVersion"); + openapiFields.add("osName"); + openapiFields.add("osVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("browserName"); + openapiRequiredFields.add("browserVersion"); + openapiRequiredFields.add("osName"); + openapiRequiredFields.add("osVersion"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ParsedDeviceInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ParsedDeviceInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ParsedDeviceInfo is not found in the empty JSON string", ParsedDeviceInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ParsedDeviceInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ParsedDeviceInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ParsedDeviceInfo.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("browserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `browserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserName").toString())); + } + if (!jsonObj.get("browserVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `browserVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserVersion").toString())); + } + if (!jsonObj.get("osName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `osName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osName").toString())); + } + if (!jsonObj.get("osVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ParsedDeviceInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ParsedDeviceInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ParsedDeviceInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ParsedDeviceInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ParsedDeviceInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ParsedDeviceInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of ParsedDeviceInfo + * @throws IOException if the JSON string is invalid with respect to ParsedDeviceInfo + */ + public static ParsedDeviceInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ParsedDeviceInfo.class); + } + + /** + * Convert an instance of ParsedDeviceInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java index 93c935b..3b89f62 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,32 +49,37 @@ /** * PasskeyAppendFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyAppendFinishReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + @javax.annotation.Nonnull private String processID; public static final String SERIALIZED_NAME_ATTESTATION_RESPONSE = "attestationResponse"; @SerializedName(SERIALIZED_NAME_ATTESTATION_RESPONSE) + @javax.annotation.Nonnull private String attestationResponse; public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + @javax.annotation.Nonnull private ClientInformation clientInformation; public static final String SERIALIZED_NAME_SEND_NOTIFICATION = "sendNotification"; @SerializedName(SERIALIZED_NAME_SEND_NOTIFICATION) + @javax.annotation.Nullable private Boolean sendNotification; public PasskeyAppendFinishReq() { } - public PasskeyAppendFinishReq userID(String userID) { + public PasskeyAppendFinishReq userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -89,12 +93,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public PasskeyAppendFinishReq processID(String processID) { + public PasskeyAppendFinishReq processID(@javax.annotation.Nonnull String processID) { this.processID = processID; return this; } @@ -108,12 +112,12 @@ public String getProcessID() { return processID; } - public void setProcessID(String processID) { + public void setProcessID(@javax.annotation.Nonnull String processID) { this.processID = processID; } - public PasskeyAppendFinishReq attestationResponse(String attestationResponse) { + public PasskeyAppendFinishReq attestationResponse(@javax.annotation.Nonnull String attestationResponse) { this.attestationResponse = attestationResponse; return this; } @@ -127,12 +131,12 @@ public String getAttestationResponse() { return attestationResponse; } - public void setAttestationResponse(String attestationResponse) { + public void setAttestationResponse(@javax.annotation.Nonnull String attestationResponse) { this.attestationResponse = attestationResponse; } - public PasskeyAppendFinishReq clientInformation(ClientInformation clientInformation) { + public PasskeyAppendFinishReq clientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; return this; } @@ -146,12 +150,12 @@ public ClientInformation getClientInformation() { return clientInformation; } - public void setClientInformation(ClientInformation clientInformation) { + public void setClientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; } - public PasskeyAppendFinishReq sendNotification(Boolean sendNotification) { + public PasskeyAppendFinishReq sendNotification(@javax.annotation.Nullable Boolean sendNotification) { this.sendNotification = sendNotification; return this; } @@ -165,7 +169,7 @@ public Boolean getSendNotification() { return sendNotification; } - public void setSendNotification(Boolean sendNotification) { + public void setSendNotification(@javax.annotation.Nullable Boolean sendNotification) { this.sendNotification = sendNotification; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java index 81cd800..28c71f9 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,16 +49,17 @@ /** * PasskeyAppendFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyAppendFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) + @javax.annotation.Nonnull private PasskeyData passkeyData; public PasskeyAppendFinishRsp() { } - public PasskeyAppendFinishRsp passkeyData(PasskeyData passkeyData) { + public PasskeyAppendFinishRsp passkeyData(@javax.annotation.Nonnull PasskeyData passkeyData) { this.passkeyData = passkeyData; return this; } @@ -73,7 +73,7 @@ public PasskeyData getPasskeyData() { return passkeyData; } - public void setPasskeyData(PasskeyData passkeyData) { + public void setPasskeyData(@javax.annotation.Nonnull PasskeyData passkeyData) { this.passkeyData = passkeyData; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java index 36d0820..b837ae3 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,32 +50,37 @@ /** * PasskeyAppendStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyAppendStartReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + @javax.annotation.Nonnull private String processID; public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull private String username; public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + @javax.annotation.Nonnull private ClientInformation clientInformation; public static final String SERIALIZED_NAME_PASSKEY_INTEL_FLAGS = "passkeyIntelFlags"; @SerializedName(SERIALIZED_NAME_PASSKEY_INTEL_FLAGS) + @javax.annotation.Nonnull private PasskeyIntelFlags passkeyIntelFlags; public PasskeyAppendStartReq() { } - public PasskeyAppendStartReq userID(String userID) { + public PasskeyAppendStartReq userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -90,12 +94,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public PasskeyAppendStartReq processID(String processID) { + public PasskeyAppendStartReq processID(@javax.annotation.Nonnull String processID) { this.processID = processID; return this; } @@ -109,12 +113,12 @@ public String getProcessID() { return processID; } - public void setProcessID(String processID) { + public void setProcessID(@javax.annotation.Nonnull String processID) { this.processID = processID; } - public PasskeyAppendStartReq username(String username) { + public PasskeyAppendStartReq username(@javax.annotation.Nonnull String username) { this.username = username; return this; } @@ -128,12 +132,12 @@ public String getUsername() { return username; } - public void setUsername(String username) { + public void setUsername(@javax.annotation.Nonnull String username) { this.username = username; } - public PasskeyAppendStartReq clientInformation(ClientInformation clientInformation) { + public PasskeyAppendStartReq clientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; return this; } @@ -147,12 +151,12 @@ public ClientInformation getClientInformation() { return clientInformation; } - public void setClientInformation(ClientInformation clientInformation) { + public void setClientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; } - public PasskeyAppendStartReq passkeyIntelFlags(PasskeyIntelFlags passkeyIntelFlags) { + public PasskeyAppendStartReq passkeyIntelFlags(@javax.annotation.Nonnull PasskeyIntelFlags passkeyIntelFlags) { this.passkeyIntelFlags = passkeyIntelFlags; return this; } @@ -166,7 +170,7 @@ public PasskeyIntelFlags getPasskeyIntelFlags() { return passkeyIntelFlags; } - public void setPasskeyIntelFlags(PasskeyIntelFlags passkeyIntelFlags) { + public void setPasskeyIntelFlags(@javax.annotation.Nonnull PasskeyIntelFlags passkeyIntelFlags) { this.passkeyIntelFlags = passkeyIntelFlags; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java index ea2025e..cc95594 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java @@ -14,17 +14,15 @@ package com.corbado.generated.model; import java.util.Objects; -import com.corbado.generated.model.DecisionTag; -import com.corbado.generated.model.DetectionTag; +import com.corbado.generated.model.DecisionInsights; +import com.corbado.generated.model.DetectionInsights; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -41,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,28 +50,32 @@ /** * PasskeyAppendStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyAppendStartRsp { public static final String SERIALIZED_NAME_APPEND_ALLOW = "appendAllow"; @SerializedName(SERIALIZED_NAME_APPEND_ALLOW) + @javax.annotation.Nonnull private Boolean appendAllow; - public static final String SERIALIZED_NAME_DETECTION_TAGS = "detectionTags"; - @SerializedName(SERIALIZED_NAME_DETECTION_TAGS) - private List detectionTags = new ArrayList<>(); - - public static final String SERIALIZED_NAME_DECISION_TAG = "decisionTag"; - @SerializedName(SERIALIZED_NAME_DECISION_TAG) - private DecisionTag decisionTag; - public static final String SERIALIZED_NAME_ATTESTATION_OPTIONS = "attestationOptions"; @SerializedName(SERIALIZED_NAME_ATTESTATION_OPTIONS) + @javax.annotation.Nonnull private String attestationOptions; + public static final String SERIALIZED_NAME_DETECTION_INSIGHTS = "detectionInsights"; + @SerializedName(SERIALIZED_NAME_DETECTION_INSIGHTS) + @javax.annotation.Nonnull + private DetectionInsights detectionInsights; + + public static final String SERIALIZED_NAME_DECISION_INSIGHTS = "decisionInsights"; + @SerializedName(SERIALIZED_NAME_DECISION_INSIGHTS) + @javax.annotation.Nonnull + private DecisionInsights decisionInsights; + public PasskeyAppendStartRsp() { } - public PasskeyAppendStartRsp appendAllow(Boolean appendAllow) { + public PasskeyAppendStartRsp appendAllow(@javax.annotation.Nonnull Boolean appendAllow) { this.appendAllow = appendAllow; return this; } @@ -88,73 +89,65 @@ public Boolean getAppendAllow() { return appendAllow; } - public void setAppendAllow(Boolean appendAllow) { + public void setAppendAllow(@javax.annotation.Nonnull Boolean appendAllow) { this.appendAllow = appendAllow; } - public PasskeyAppendStartRsp detectionTags(List detectionTags) { - this.detectionTags = detectionTags; - return this; - } - - public PasskeyAppendStartRsp addDetectionTagsItem(DetectionTag detectionTagsItem) { - if (this.detectionTags == null) { - this.detectionTags = new ArrayList<>(); - } - this.detectionTags.add(detectionTagsItem); + public PasskeyAppendStartRsp attestationOptions(@javax.annotation.Nonnull String attestationOptions) { + this.attestationOptions = attestationOptions; return this; } /** - * Get detectionTags - * @return detectionTags + * Get attestationOptions + * @return attestationOptions */ @javax.annotation.Nonnull - public List getDetectionTags() { - return detectionTags; + public String getAttestationOptions() { + return attestationOptions; } - public void setDetectionTags(List detectionTags) { - this.detectionTags = detectionTags; + public void setAttestationOptions(@javax.annotation.Nonnull String attestationOptions) { + this.attestationOptions = attestationOptions; } - public PasskeyAppendStartRsp decisionTag(DecisionTag decisionTag) { - this.decisionTag = decisionTag; + public PasskeyAppendStartRsp detectionInsights(@javax.annotation.Nonnull DetectionInsights detectionInsights) { + this.detectionInsights = detectionInsights; return this; } /** - * Get decisionTag - * @return decisionTag + * Get detectionInsights + * @return detectionInsights */ @javax.annotation.Nonnull - public DecisionTag getDecisionTag() { - return decisionTag; + public DetectionInsights getDetectionInsights() { + return detectionInsights; } - public void setDecisionTag(DecisionTag decisionTag) { - this.decisionTag = decisionTag; + public void setDetectionInsights(@javax.annotation.Nonnull DetectionInsights detectionInsights) { + this.detectionInsights = detectionInsights; } - public PasskeyAppendStartRsp attestationOptions(String attestationOptions) { - this.attestationOptions = attestationOptions; + public PasskeyAppendStartRsp decisionInsights(@javax.annotation.Nonnull DecisionInsights decisionInsights) { + this.decisionInsights = decisionInsights; return this; } /** - * Get attestationOptions - * @return attestationOptions + * Get decisionInsights + * @return decisionInsights */ @javax.annotation.Nonnull - public String getAttestationOptions() { - return attestationOptions; + public DecisionInsights getDecisionInsights() { + return decisionInsights; } - public void setAttestationOptions(String attestationOptions) { - this.attestationOptions = attestationOptions; + public void setDecisionInsights(@javax.annotation.Nonnull DecisionInsights decisionInsights) { + this.decisionInsights = decisionInsights; } @@ -169,14 +162,14 @@ public boolean equals(Object o) { } PasskeyAppendStartRsp passkeyAppendStartRsp = (PasskeyAppendStartRsp) o; return Objects.equals(this.appendAllow, passkeyAppendStartRsp.appendAllow) && - Objects.equals(this.detectionTags, passkeyAppendStartRsp.detectionTags) && - Objects.equals(this.decisionTag, passkeyAppendStartRsp.decisionTag) && - Objects.equals(this.attestationOptions, passkeyAppendStartRsp.attestationOptions); + Objects.equals(this.attestationOptions, passkeyAppendStartRsp.attestationOptions) && + Objects.equals(this.detectionInsights, passkeyAppendStartRsp.detectionInsights) && + Objects.equals(this.decisionInsights, passkeyAppendStartRsp.decisionInsights); } @Override public int hashCode() { - return Objects.hash(appendAllow, detectionTags, decisionTag, attestationOptions); + return Objects.hash(appendAllow, attestationOptions, detectionInsights, decisionInsights); } @Override @@ -184,9 +177,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyAppendStartRsp {\n"); sb.append(" appendAllow: ").append(toIndentedString(appendAllow)).append("\n"); - sb.append(" detectionTags: ").append(toIndentedString(detectionTags)).append("\n"); - sb.append(" decisionTag: ").append(toIndentedString(decisionTag)).append("\n"); sb.append(" attestationOptions: ").append(toIndentedString(attestationOptions)).append("\n"); + sb.append(" detectionInsights: ").append(toIndentedString(detectionInsights)).append("\n"); + sb.append(" decisionInsights: ").append(toIndentedString(decisionInsights)).append("\n"); sb.append("}"); return sb.toString(); } @@ -210,16 +203,16 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("appendAllow"); - openapiFields.add("detectionTags"); - openapiFields.add("decisionTag"); openapiFields.add("attestationOptions"); + openapiFields.add("detectionInsights"); + openapiFields.add("decisionInsights"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("appendAllow"); - openapiRequiredFields.add("detectionTags"); - openapiRequiredFields.add("decisionTag"); openapiRequiredFields.add("attestationOptions"); + openapiRequiredFields.add("detectionInsights"); + openapiRequiredFields.add("decisionInsights"); } /** @@ -250,21 +243,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("detectionTags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `detectionTags` to be an array in the JSON string but got `%s`", jsonObj.get("detectionTags").toString())); - } - - JsonArray jsonArraydetectionTags = jsonObj.getAsJsonArray("detectionTags"); - // validate the required field `detectionTags` (array) - for (int i = 0; i < jsonArraydetectionTags.size(); i++) { - DetectionTag.validateJsonElement(jsonArraydetectionTags.get(i)); - }; - // validate the required field `decisionTag` - DecisionTag.validateJsonElement(jsonObj.get("decisionTag")); if (!jsonObj.get("attestationOptions").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `attestationOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attestationOptions").toString())); } + // validate the required field `detectionInsights` + DetectionInsights.validateJsonElement(jsonObj.get("detectionInsights")); + // validate the required field `decisionInsights` + DecisionInsights.validateJsonElement(jsonObj.get("decisionInsights")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallenge.java b/src/main/java/com/corbado/generated/model/PasskeyChallenge.java index 97780a6..afabd46 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyChallenge.java +++ b/src/main/java/com/corbado/generated/model/PasskeyChallenge.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,36 +50,47 @@ /** * PasskeyChallenge */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyChallenge { public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) + @javax.annotation.Nonnull private String challengeID; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull private PasskeyChallengeType type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull private String value; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private PasskeyChallengeStatus status; public static final String SERIALIZED_NAME_CREATED = "created"; @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nonnull private Long created; + public static final String SERIALIZED_NAME_CREATED_MS = "createdMs"; + @SerializedName(SERIALIZED_NAME_CREATED_MS) + @javax.annotation.Nonnull + private Long createdMs; + public static final String SERIALIZED_NAME_EXPIRES = "expires"; @SerializedName(SERIALIZED_NAME_EXPIRES) + @javax.annotation.Nonnull private Long expires; public PasskeyChallenge() { } - public PasskeyChallenge challengeID(String challengeID) { + public PasskeyChallenge challengeID(@javax.annotation.Nonnull String challengeID) { this.challengeID = challengeID; return this; } @@ -94,12 +104,12 @@ public String getChallengeID() { return challengeID; } - public void setChallengeID(String challengeID) { + public void setChallengeID(@javax.annotation.Nonnull String challengeID) { this.challengeID = challengeID; } - public PasskeyChallenge type(PasskeyChallengeType type) { + public PasskeyChallenge type(@javax.annotation.Nonnull PasskeyChallengeType type) { this.type = type; return this; } @@ -113,12 +123,12 @@ public PasskeyChallengeType getType() { return type; } - public void setType(PasskeyChallengeType type) { + public void setType(@javax.annotation.Nonnull PasskeyChallengeType type) { this.type = type; } - public PasskeyChallenge value(String value) { + public PasskeyChallenge value(@javax.annotation.Nonnull String value) { this.value = value; return this; } @@ -132,12 +142,12 @@ public String getValue() { return value; } - public void setValue(String value) { + public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } - public PasskeyChallenge status(PasskeyChallengeStatus status) { + public PasskeyChallenge status(@javax.annotation.Nonnull PasskeyChallengeStatus status) { this.status = status; return this; } @@ -151,12 +161,12 @@ public PasskeyChallengeStatus getStatus() { return status; } - public void setStatus(PasskeyChallengeStatus status) { + public void setStatus(@javax.annotation.Nonnull PasskeyChallengeStatus status) { this.status = status; } - public PasskeyChallenge created(Long created) { + public PasskeyChallenge created(@javax.annotation.Nonnull Long created) { this.created = created; return this; } @@ -170,12 +180,31 @@ public Long getCreated() { return created; } - public void setCreated(Long created) { + public void setCreated(@javax.annotation.Nonnull Long created) { this.created = created; } - public PasskeyChallenge expires(Long expires) { + public PasskeyChallenge createdMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + return this; + } + + /** + * Get createdMs + * @return createdMs + */ + @javax.annotation.Nonnull + public Long getCreatedMs() { + return createdMs; + } + + public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + } + + + public PasskeyChallenge expires(@javax.annotation.Nonnull Long expires) { this.expires = expires; return this; } @@ -189,7 +218,7 @@ public Long getExpires() { return expires; } - public void setExpires(Long expires) { + public void setExpires(@javax.annotation.Nonnull Long expires) { this.expires = expires; } @@ -209,12 +238,13 @@ public boolean equals(Object o) { Objects.equals(this.value, passkeyChallenge.value) && Objects.equals(this.status, passkeyChallenge.status) && Objects.equals(this.created, passkeyChallenge.created) && + Objects.equals(this.createdMs, passkeyChallenge.createdMs) && Objects.equals(this.expires, passkeyChallenge.expires); } @Override public int hashCode() { - return Objects.hash(challengeID, type, value, status, created, expires); + return Objects.hash(challengeID, type, value, status, created, createdMs, expires); } @Override @@ -226,6 +256,7 @@ public String toString() { sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); sb.append("}"); return sb.toString(); @@ -254,6 +285,7 @@ private String toIndentedString(Object o) { openapiFields.add("value"); openapiFields.add("status"); openapiFields.add("created"); + openapiFields.add("createdMs"); openapiFields.add("expires"); // a set of required properties/fields (JSON key names) @@ -263,6 +295,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("value"); openapiRequiredFields.add("status"); openapiRequiredFields.add("created"); + openapiRequiredFields.add("createdMs"); openapiRequiredFields.add("expires"); } diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java b/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java index a25864c..61f67d8 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java +++ b/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java @@ -41,7 +41,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,20 +52,22 @@ /** * PasskeyChallengeList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyChallengeList { public static final String SERIALIZED_NAME_PASSKEY_CHALLENGES = "passkeyChallenges"; @SerializedName(SERIALIZED_NAME_PASSKEY_CHALLENGES) + @javax.annotation.Nonnull private List passkeyChallenges = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGING = "paging"; @SerializedName(SERIALIZED_NAME_PAGING) + @javax.annotation.Nonnull private Paging paging; public PasskeyChallengeList() { } - public PasskeyChallengeList passkeyChallenges(List passkeyChallenges) { + public PasskeyChallengeList passkeyChallenges(@javax.annotation.Nonnull List passkeyChallenges) { this.passkeyChallenges = passkeyChallenges; return this; } @@ -88,12 +89,12 @@ public List getPasskeyChallenges() { return passkeyChallenges; } - public void setPasskeyChallenges(List passkeyChallenges) { + public void setPasskeyChallenges(@javax.annotation.Nonnull List passkeyChallenges) { this.passkeyChallenges = passkeyChallenges; } - public PasskeyChallengeList paging(Paging paging) { + public PasskeyChallengeList paging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; return this; } @@ -107,7 +108,7 @@ public Paging getPaging() { return paging; } - public void setPaging(Paging paging) { + public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java b/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java index 5193eb6..b586c18 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,16 +49,17 @@ /** * PasskeyChallengeUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyChallengeUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private PasskeyChallengeStatus status; public PasskeyChallengeUpdateReq() { } - public PasskeyChallengeUpdateReq status(PasskeyChallengeStatus status) { + public PasskeyChallengeUpdateReq status(@javax.annotation.Nonnull PasskeyChallengeStatus status) { this.status = status; return this; } @@ -73,7 +73,7 @@ public PasskeyChallengeStatus getStatus() { return status; } - public void setStatus(PasskeyChallengeStatus status) { + public void setStatus(@javax.annotation.Nonnull PasskeyChallengeStatus status) { this.status = status; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyData.java b/src/main/java/com/corbado/generated/model/PasskeyData.java index 22bfa5b..91b7ef6 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyData.java +++ b/src/main/java/com/corbado/generated/model/PasskeyData.java @@ -14,6 +14,7 @@ package com.corbado.generated.model; import java.util.Objects; +import com.corbado.generated.model.AaguidDetails; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -37,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,18 +49,21 @@ /** * PasskeyData */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyData { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull private String id; public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull private String username; /** @@ -119,16 +122,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_CEREMONY_TYPE = "ceremonyType"; @SerializedName(SERIALIZED_NAME_CEREMONY_TYPE) + @javax.annotation.Nonnull private CeremonyTypeEnum ceremonyType; public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) + @javax.annotation.Nonnull private String challengeID; + public static final String SERIALIZED_NAME_AAGUID_DETAILS = "aaguidDetails"; + @SerializedName(SERIALIZED_NAME_AAGUID_DETAILS) + @javax.annotation.Nonnull + private AaguidDetails aaguidDetails; + public PasskeyData() { } - public PasskeyData id(String id) { + public PasskeyData id(@javax.annotation.Nonnull String id) { this.id = id; return this; } @@ -142,12 +152,12 @@ public String getId() { return id; } - public void setId(String id) { + public void setId(@javax.annotation.Nonnull String id) { this.id = id; } - public PasskeyData userID(String userID) { + public PasskeyData userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -161,12 +171,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public PasskeyData username(String username) { + public PasskeyData username(@javax.annotation.Nonnull String username) { this.username = username; return this; } @@ -180,12 +190,12 @@ public String getUsername() { return username; } - public void setUsername(String username) { + public void setUsername(@javax.annotation.Nonnull String username) { this.username = username; } - public PasskeyData ceremonyType(CeremonyTypeEnum ceremonyType) { + public PasskeyData ceremonyType(@javax.annotation.Nonnull CeremonyTypeEnum ceremonyType) { this.ceremonyType = ceremonyType; return this; } @@ -199,12 +209,12 @@ public CeremonyTypeEnum getCeremonyType() { return ceremonyType; } - public void setCeremonyType(CeremonyTypeEnum ceremonyType) { + public void setCeremonyType(@javax.annotation.Nonnull CeremonyTypeEnum ceremonyType) { this.ceremonyType = ceremonyType; } - public PasskeyData challengeID(String challengeID) { + public PasskeyData challengeID(@javax.annotation.Nonnull String challengeID) { this.challengeID = challengeID; return this; } @@ -218,11 +228,30 @@ public String getChallengeID() { return challengeID; } - public void setChallengeID(String challengeID) { + public void setChallengeID(@javax.annotation.Nonnull String challengeID) { this.challengeID = challengeID; } + public PasskeyData aaguidDetails(@javax.annotation.Nonnull AaguidDetails aaguidDetails) { + this.aaguidDetails = aaguidDetails; + return this; + } + + /** + * Get aaguidDetails + * @return aaguidDetails + */ + @javax.annotation.Nonnull + public AaguidDetails getAaguidDetails() { + return aaguidDetails; + } + + public void setAaguidDetails(@javax.annotation.Nonnull AaguidDetails aaguidDetails) { + this.aaguidDetails = aaguidDetails; + } + + @Override public boolean equals(Object o) { @@ -237,12 +266,13 @@ public boolean equals(Object o) { Objects.equals(this.userID, passkeyData.userID) && Objects.equals(this.username, passkeyData.username) && Objects.equals(this.ceremonyType, passkeyData.ceremonyType) && - Objects.equals(this.challengeID, passkeyData.challengeID); + Objects.equals(this.challengeID, passkeyData.challengeID) && + Objects.equals(this.aaguidDetails, passkeyData.aaguidDetails); } @Override public int hashCode() { - return Objects.hash(id, userID, username, ceremonyType, challengeID); + return Objects.hash(id, userID, username, ceremonyType, challengeID, aaguidDetails); } @Override @@ -254,6 +284,7 @@ public String toString() { sb.append(" username: ").append(toIndentedString(username)).append("\n"); sb.append(" ceremonyType: ").append(toIndentedString(ceremonyType)).append("\n"); sb.append(" challengeID: ").append(toIndentedString(challengeID)).append("\n"); + sb.append(" aaguidDetails: ").append(toIndentedString(aaguidDetails)).append("\n"); sb.append("}"); return sb.toString(); } @@ -281,6 +312,7 @@ private String toIndentedString(Object o) { openapiFields.add("username"); openapiFields.add("ceremonyType"); openapiFields.add("challengeID"); + openapiFields.add("aaguidDetails"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -289,6 +321,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("username"); openapiRequiredFields.add("ceremonyType"); openapiRequiredFields.add("challengeID"); + openapiRequiredFields.add("aaguidDetails"); } /** @@ -336,6 +369,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("challengeID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `challengeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challengeID").toString())); } + // validate the required field `aaguidDetails` + AaguidDetails.validateJsonElement(jsonObj.get("aaguidDetails")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyEvent.java b/src/main/java/com/corbado/generated/model/PasskeyEvent.java index b8fb1a3..0bbd233 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEvent.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEvent.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,44 +49,57 @@ /** * PasskeyEvent */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyEvent { public static final String SERIALIZED_NAME_PASSKEY_EVENT_I_D = "passkeyEventID"; @SerializedName(SERIALIZED_NAME_PASSKEY_EVENT_I_D) + @javax.annotation.Nonnull private String passkeyEventID; public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + @javax.annotation.Nonnull private PasskeyEventType eventType; public static final String SERIALIZED_NAME_CLIENT_ENV_I_D = "clientEnvID"; @SerializedName(SERIALIZED_NAME_CLIENT_ENV_I_D) + @javax.annotation.Nullable private String clientEnvID; public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + @javax.annotation.Nullable private String processID; public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + @javax.annotation.Nullable private String credentialID; public static final String SERIALIZED_NAME_EXPIRES = "expires"; @SerializedName(SERIALIZED_NAME_EXPIRES) + @javax.annotation.Nullable private Integer expires; public static final String SERIALIZED_NAME_CREATED = "created"; @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nonnull private String created; + public static final String SERIALIZED_NAME_CREATED_MS = "createdMs"; + @SerializedName(SERIALIZED_NAME_CREATED_MS) + @javax.annotation.Nonnull + private Long createdMs; + public PasskeyEvent() { } - public PasskeyEvent passkeyEventID(String passkeyEventID) { + public PasskeyEvent passkeyEventID(@javax.annotation.Nonnull String passkeyEventID) { this.passkeyEventID = passkeyEventID; return this; } @@ -101,12 +113,12 @@ public String getPasskeyEventID() { return passkeyEventID; } - public void setPasskeyEventID(String passkeyEventID) { + public void setPasskeyEventID(@javax.annotation.Nonnull String passkeyEventID) { this.passkeyEventID = passkeyEventID; } - public PasskeyEvent userID(String userID) { + public PasskeyEvent userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -120,12 +132,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public PasskeyEvent eventType(PasskeyEventType eventType) { + public PasskeyEvent eventType(@javax.annotation.Nonnull PasskeyEventType eventType) { this.eventType = eventType; return this; } @@ -139,12 +151,12 @@ public PasskeyEventType getEventType() { return eventType; } - public void setEventType(PasskeyEventType eventType) { + public void setEventType(@javax.annotation.Nonnull PasskeyEventType eventType) { this.eventType = eventType; } - public PasskeyEvent clientEnvID(String clientEnvID) { + public PasskeyEvent clientEnvID(@javax.annotation.Nullable String clientEnvID) { this.clientEnvID = clientEnvID; return this; } @@ -158,12 +170,12 @@ public String getClientEnvID() { return clientEnvID; } - public void setClientEnvID(String clientEnvID) { + public void setClientEnvID(@javax.annotation.Nullable String clientEnvID) { this.clientEnvID = clientEnvID; } - public PasskeyEvent processID(String processID) { + public PasskeyEvent processID(@javax.annotation.Nullable String processID) { this.processID = processID; return this; } @@ -177,12 +189,12 @@ public String getProcessID() { return processID; } - public void setProcessID(String processID) { + public void setProcessID(@javax.annotation.Nullable String processID) { this.processID = processID; } - public PasskeyEvent credentialID(String credentialID) { + public PasskeyEvent credentialID(@javax.annotation.Nullable String credentialID) { this.credentialID = credentialID; return this; } @@ -196,12 +208,12 @@ public String getCredentialID() { return credentialID; } - public void setCredentialID(String credentialID) { + public void setCredentialID(@javax.annotation.Nullable String credentialID) { this.credentialID = credentialID; } - public PasskeyEvent expires(Integer expires) { + public PasskeyEvent expires(@javax.annotation.Nullable Integer expires) { this.expires = expires; return this; } @@ -215,12 +227,12 @@ public Integer getExpires() { return expires; } - public void setExpires(Integer expires) { + public void setExpires(@javax.annotation.Nullable Integer expires) { this.expires = expires; } - public PasskeyEvent created(String created) { + public PasskeyEvent created(@javax.annotation.Nonnull String created) { this.created = created; return this; } @@ -234,11 +246,30 @@ public String getCreated() { return created; } - public void setCreated(String created) { + public void setCreated(@javax.annotation.Nonnull String created) { this.created = created; } + public PasskeyEvent createdMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + return this; + } + + /** + * Get createdMs + * @return createdMs + */ + @javax.annotation.Nonnull + public Long getCreatedMs() { + return createdMs; + } + + public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + } + + @Override public boolean equals(Object o) { @@ -256,12 +287,13 @@ public boolean equals(Object o) { Objects.equals(this.processID, passkeyEvent.processID) && Objects.equals(this.credentialID, passkeyEvent.credentialID) && Objects.equals(this.expires, passkeyEvent.expires) && - Objects.equals(this.created, passkeyEvent.created); + Objects.equals(this.created, passkeyEvent.created) && + Objects.equals(this.createdMs, passkeyEvent.createdMs); } @Override public int hashCode() { - return Objects.hash(passkeyEventID, userID, eventType, clientEnvID, processID, credentialID, expires, created); + return Objects.hash(passkeyEventID, userID, eventType, clientEnvID, processID, credentialID, expires, created, createdMs); } @Override @@ -276,6 +308,7 @@ public String toString() { sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); sb.append("}"); return sb.toString(); } @@ -306,6 +339,7 @@ private String toIndentedString(Object o) { openapiFields.add("credentialID"); openapiFields.add("expires"); openapiFields.add("created"); + openapiFields.add("createdMs"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -313,6 +347,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("userID"); openapiRequiredFields.add("eventType"); openapiRequiredFields.add("created"); + openapiRequiredFields.add("createdMs"); } /** diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java b/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java index 68f4685..879504f 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,32 +49,42 @@ /** * PasskeyEventCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyEventCreateReq { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + @javax.annotation.Nonnull private PasskeyEventType eventType; public static final String SERIALIZED_NAME_EXPIRES = "expires"; @SerializedName(SERIALIZED_NAME_EXPIRES) + @javax.annotation.Nullable private Integer expires; public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + @javax.annotation.Nullable private String processID; public static final String SERIALIZED_NAME_CLIENT_ENV_I_D = "clientEnvID"; @SerializedName(SERIALIZED_NAME_CLIENT_ENV_I_D) + @javax.annotation.Nullable private String clientEnvID; public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + @javax.annotation.Nullable private String credentialID; + public static final String SERIALIZED_NAME_CHALLENGE = "challenge"; + @SerializedName(SERIALIZED_NAME_CHALLENGE) + @javax.annotation.Nullable + private String challenge; + public PasskeyEventCreateReq() { } - public PasskeyEventCreateReq eventType(PasskeyEventType eventType) { + public PasskeyEventCreateReq eventType(@javax.annotation.Nonnull PasskeyEventType eventType) { this.eventType = eventType; return this; } @@ -89,12 +98,12 @@ public PasskeyEventType getEventType() { return eventType; } - public void setEventType(PasskeyEventType eventType) { + public void setEventType(@javax.annotation.Nonnull PasskeyEventType eventType) { this.eventType = eventType; } - public PasskeyEventCreateReq expires(Integer expires) { + public PasskeyEventCreateReq expires(@javax.annotation.Nullable Integer expires) { this.expires = expires; return this; } @@ -108,12 +117,12 @@ public Integer getExpires() { return expires; } - public void setExpires(Integer expires) { + public void setExpires(@javax.annotation.Nullable Integer expires) { this.expires = expires; } - public PasskeyEventCreateReq processID(String processID) { + public PasskeyEventCreateReq processID(@javax.annotation.Nullable String processID) { this.processID = processID; return this; } @@ -127,12 +136,12 @@ public String getProcessID() { return processID; } - public void setProcessID(String processID) { + public void setProcessID(@javax.annotation.Nullable String processID) { this.processID = processID; } - public PasskeyEventCreateReq clientEnvID(String clientEnvID) { + public PasskeyEventCreateReq clientEnvID(@javax.annotation.Nullable String clientEnvID) { this.clientEnvID = clientEnvID; return this; } @@ -146,12 +155,12 @@ public String getClientEnvID() { return clientEnvID; } - public void setClientEnvID(String clientEnvID) { + public void setClientEnvID(@javax.annotation.Nullable String clientEnvID) { this.clientEnvID = clientEnvID; } - public PasskeyEventCreateReq credentialID(String credentialID) { + public PasskeyEventCreateReq credentialID(@javax.annotation.Nullable String credentialID) { this.credentialID = credentialID; return this; } @@ -165,11 +174,30 @@ public String getCredentialID() { return credentialID; } - public void setCredentialID(String credentialID) { + public void setCredentialID(@javax.annotation.Nullable String credentialID) { this.credentialID = credentialID; } + public PasskeyEventCreateReq challenge(@javax.annotation.Nullable String challenge) { + this.challenge = challenge; + return this; + } + + /** + * Get challenge + * @return challenge + */ + @javax.annotation.Nullable + public String getChallenge() { + return challenge; + } + + public void setChallenge(@javax.annotation.Nullable String challenge) { + this.challenge = challenge; + } + + @Override public boolean equals(Object o) { @@ -184,12 +212,13 @@ public boolean equals(Object o) { Objects.equals(this.expires, passkeyEventCreateReq.expires) && Objects.equals(this.processID, passkeyEventCreateReq.processID) && Objects.equals(this.clientEnvID, passkeyEventCreateReq.clientEnvID) && - Objects.equals(this.credentialID, passkeyEventCreateReq.credentialID); + Objects.equals(this.credentialID, passkeyEventCreateReq.credentialID) && + Objects.equals(this.challenge, passkeyEventCreateReq.challenge); } @Override public int hashCode() { - return Objects.hash(eventType, expires, processID, clientEnvID, credentialID); + return Objects.hash(eventType, expires, processID, clientEnvID, credentialID, challenge); } @Override @@ -201,6 +230,7 @@ public String toString() { sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); sb.append(" clientEnvID: ").append(toIndentedString(clientEnvID)).append("\n"); sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); + sb.append(" challenge: ").append(toIndentedString(challenge)).append("\n"); sb.append("}"); return sb.toString(); } @@ -228,6 +258,7 @@ private String toIndentedString(Object o) { openapiFields.add("processID"); openapiFields.add("clientEnvID"); openapiFields.add("credentialID"); + openapiFields.add("challenge"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -273,6 +304,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("credentialID") != null && !jsonObj.get("credentialID").isJsonNull()) && !jsonObj.get("credentialID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); } + if ((jsonObj.get("challenge") != null && !jsonObj.get("challenge").isJsonNull()) && !jsonObj.get("challenge").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `challenge` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challenge").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventList.java b/src/main/java/com/corbado/generated/model/PasskeyEventList.java index f7126f1..e4cec1e 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEventList.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEventList.java @@ -41,7 +41,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,20 +52,22 @@ /** * PasskeyEventList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyEventList { public static final String SERIALIZED_NAME_PASSKEY_EVENTS = "passkeyEvents"; @SerializedName(SERIALIZED_NAME_PASSKEY_EVENTS) + @javax.annotation.Nonnull private List passkeyEvents = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGING = "paging"; @SerializedName(SERIALIZED_NAME_PAGING) + @javax.annotation.Nonnull private Paging paging; public PasskeyEventList() { } - public PasskeyEventList passkeyEvents(List passkeyEvents) { + public PasskeyEventList passkeyEvents(@javax.annotation.Nonnull List passkeyEvents) { this.passkeyEvents = passkeyEvents; return this; } @@ -88,12 +89,12 @@ public List getPasskeyEvents() { return passkeyEvents; } - public void setPasskeyEvents(List passkeyEvents) { + public void setPasskeyEvents(@javax.annotation.Nonnull List passkeyEvents) { this.passkeyEvents = passkeyEvents; } - public PasskeyEventList paging(Paging paging) { + public PasskeyEventList paging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; return this; } @@ -107,7 +108,7 @@ public Paging getPaging() { return paging; } - public void setPaging(Paging paging) { + public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventType.java b/src/main/java/com/corbado/generated/model/PasskeyEventType.java index 164dbe3..c597468 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEventType.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEventType.java @@ -35,11 +35,19 @@ public enum PasskeyEventType { LOGIN_ERROR("login-error"), + LOGIN_ERROR_UNTYPED("login-error-untyped"), + LOGIN_ONE_TAP_SWITCH("login-one-tap-switch"), USER_APPEND_AFTER_CROSS_PLATFORM_BLACKLISTED("user-append-after-cross-platform-blacklisted"), - USER_APPEND_AFTER_LOGIN_ERROR_BLACKLISTED("user-append-after-login-error-blacklisted"); + USER_APPEND_AFTER_LOGIN_ERROR_BLACKLISTED("user-append-after-login-error-blacklisted"), + + APPEND_CREDENTIAL_EXISTS("append-credential-exists"), + + APPEND_EXPLICIT_ABORT("append-explicit-abort"), + + APPEND_ERROR("append-error"); private String value; diff --git a/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java b/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java index c1f3ed2..416999e 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java +++ b/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,16 +48,17 @@ /** * PasskeyIntelFlags */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyIntelFlags { public static final String SERIALIZED_NAME_FORCE_PASSKEY_APPEND = "forcePasskeyAppend"; @SerializedName(SERIALIZED_NAME_FORCE_PASSKEY_APPEND) + @javax.annotation.Nonnull private Boolean forcePasskeyAppend; public PasskeyIntelFlags() { } - public PasskeyIntelFlags forcePasskeyAppend(Boolean forcePasskeyAppend) { + public PasskeyIntelFlags forcePasskeyAppend(@javax.annotation.Nonnull Boolean forcePasskeyAppend) { this.forcePasskeyAppend = forcePasskeyAppend; return this; } @@ -72,7 +72,7 @@ public Boolean getForcePasskeyAppend() { return forcePasskeyAppend; } - public void setForcePasskeyAppend(Boolean forcePasskeyAppend) { + public void setForcePasskeyAppend(@javax.annotation.Nonnull Boolean forcePasskeyAppend) { this.forcePasskeyAppend = forcePasskeyAppend; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java index 3dc266d..585c0fa 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,28 +49,37 @@ /** * PasskeyLoginFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyLoginFinishReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_ASSERTION_RESPONSE = "assertionResponse"; @SerializedName(SERIALIZED_NAME_ASSERTION_RESPONSE) + @javax.annotation.Nonnull private String assertionResponse; public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + @javax.annotation.Nonnull private ClientInformation clientInformation; public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + @javax.annotation.Nonnull private String processID; + public static final String SERIALIZED_NAME_SIGN_PASSKEY_DATA = "signPasskeyData"; + @SerializedName(SERIALIZED_NAME_SIGN_PASSKEY_DATA) + @javax.annotation.Nullable + private Boolean signPasskeyData; + public PasskeyLoginFinishReq() { } - public PasskeyLoginFinishReq userID(String userID) { + public PasskeyLoginFinishReq userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -85,12 +93,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public PasskeyLoginFinishReq assertionResponse(String assertionResponse) { + public PasskeyLoginFinishReq assertionResponse(@javax.annotation.Nonnull String assertionResponse) { this.assertionResponse = assertionResponse; return this; } @@ -104,12 +112,12 @@ public String getAssertionResponse() { return assertionResponse; } - public void setAssertionResponse(String assertionResponse) { + public void setAssertionResponse(@javax.annotation.Nonnull String assertionResponse) { this.assertionResponse = assertionResponse; } - public PasskeyLoginFinishReq clientInformation(ClientInformation clientInformation) { + public PasskeyLoginFinishReq clientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; return this; } @@ -123,12 +131,12 @@ public ClientInformation getClientInformation() { return clientInformation; } - public void setClientInformation(ClientInformation clientInformation) { + public void setClientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; } - public PasskeyLoginFinishReq processID(String processID) { + public PasskeyLoginFinishReq processID(@javax.annotation.Nonnull String processID) { this.processID = processID; return this; } @@ -142,11 +150,30 @@ public String getProcessID() { return processID; } - public void setProcessID(String processID) { + public void setProcessID(@javax.annotation.Nonnull String processID) { this.processID = processID; } + public PasskeyLoginFinishReq signPasskeyData(@javax.annotation.Nullable Boolean signPasskeyData) { + this.signPasskeyData = signPasskeyData; + return this; + } + + /** + * Get signPasskeyData + * @return signPasskeyData + */ + @javax.annotation.Nullable + public Boolean getSignPasskeyData() { + return signPasskeyData; + } + + public void setSignPasskeyData(@javax.annotation.Nullable Boolean signPasskeyData) { + this.signPasskeyData = signPasskeyData; + } + + @Override public boolean equals(Object o) { @@ -160,12 +187,13 @@ public boolean equals(Object o) { return Objects.equals(this.userID, passkeyLoginFinishReq.userID) && Objects.equals(this.assertionResponse, passkeyLoginFinishReq.assertionResponse) && Objects.equals(this.clientInformation, passkeyLoginFinishReq.clientInformation) && - Objects.equals(this.processID, passkeyLoginFinishReq.processID); + Objects.equals(this.processID, passkeyLoginFinishReq.processID) && + Objects.equals(this.signPasskeyData, passkeyLoginFinishReq.signPasskeyData); } @Override public int hashCode() { - return Objects.hash(userID, assertionResponse, clientInformation, processID); + return Objects.hash(userID, assertionResponse, clientInformation, processID, signPasskeyData); } @Override @@ -176,6 +204,7 @@ public String toString() { sb.append(" assertionResponse: ").append(toIndentedString(assertionResponse)).append("\n"); sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append(" signPasskeyData: ").append(toIndentedString(signPasskeyData)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,6 +231,7 @@ private String toIndentedString(Object o) { openapiFields.add("assertionResponse"); openapiFields.add("clientInformation"); openapiFields.add("processID"); + openapiFields.add("signPasskeyData"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java index da682af..35e64f4 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,16 +49,22 @@ /** * PasskeyLoginFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyLoginFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) + @javax.annotation.Nonnull private PasskeyData passkeyData; + public static final String SERIALIZED_NAME_SIGNED_PASSKEY_DATA = "signedPasskeyData"; + @SerializedName(SERIALIZED_NAME_SIGNED_PASSKEY_DATA) + @javax.annotation.Nullable + private String signedPasskeyData; + public PasskeyLoginFinishRsp() { } - public PasskeyLoginFinishRsp passkeyData(PasskeyData passkeyData) { + public PasskeyLoginFinishRsp passkeyData(@javax.annotation.Nonnull PasskeyData passkeyData) { this.passkeyData = passkeyData; return this; } @@ -73,11 +78,30 @@ public PasskeyData getPasskeyData() { return passkeyData; } - public void setPasskeyData(PasskeyData passkeyData) { + public void setPasskeyData(@javax.annotation.Nonnull PasskeyData passkeyData) { this.passkeyData = passkeyData; } + public PasskeyLoginFinishRsp signedPasskeyData(@javax.annotation.Nullable String signedPasskeyData) { + this.signedPasskeyData = signedPasskeyData; + return this; + } + + /** + * Get signedPasskeyData + * @return signedPasskeyData + */ + @javax.annotation.Nullable + public String getSignedPasskeyData() { + return signedPasskeyData; + } + + public void setSignedPasskeyData(@javax.annotation.Nullable String signedPasskeyData) { + this.signedPasskeyData = signedPasskeyData; + } + + @Override public boolean equals(Object o) { @@ -88,12 +112,13 @@ public boolean equals(Object o) { return false; } PasskeyLoginFinishRsp passkeyLoginFinishRsp = (PasskeyLoginFinishRsp) o; - return Objects.equals(this.passkeyData, passkeyLoginFinishRsp.passkeyData); + return Objects.equals(this.passkeyData, passkeyLoginFinishRsp.passkeyData) && + Objects.equals(this.signedPasskeyData, passkeyLoginFinishRsp.signedPasskeyData); } @Override public int hashCode() { - return Objects.hash(passkeyData); + return Objects.hash(passkeyData, signedPasskeyData); } @Override @@ -101,6 +126,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyLoginFinishRsp {\n"); sb.append(" passkeyData: ").append(toIndentedString(passkeyData)).append("\n"); + sb.append(" signedPasskeyData: ").append(toIndentedString(signedPasskeyData)).append("\n"); sb.append("}"); return sb.toString(); } @@ -124,6 +150,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("passkeyData"); + openapiFields.add("signedPasskeyData"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -160,6 +187,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `passkeyData` PasskeyData.validateJsonElement(jsonObj.get("passkeyData")); + if ((jsonObj.get("signedPasskeyData") != null && !jsonObj.get("signedPasskeyData").isJsonNull()) && !jsonObj.get("signedPasskeyData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedPasskeyData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedPasskeyData").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java index dec2ed6..6e0746f 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java @@ -39,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,28 +50,32 @@ /** * PasskeyLoginStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyLoginStartReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + @javax.annotation.Nonnull private ClientInformation clientInformation; public static final String SERIALIZED_NAME_CROSS_DEVICE_AUTHENTICATION_STRATEGY = "crossDeviceAuthenticationStrategy"; @SerializedName(SERIALIZED_NAME_CROSS_DEVICE_AUTHENTICATION_STRATEGY) + @javax.annotation.Nonnull private CrossDeviceAuthenticationStrategy crossDeviceAuthenticationStrategy; public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + @javax.annotation.Nonnull private String processID; public PasskeyLoginStartReq() { } - public PasskeyLoginStartReq userID(String userID) { + public PasskeyLoginStartReq userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -86,12 +89,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public PasskeyLoginStartReq clientInformation(ClientInformation clientInformation) { + public PasskeyLoginStartReq clientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; return this; } @@ -105,12 +108,12 @@ public ClientInformation getClientInformation() { return clientInformation; } - public void setClientInformation(ClientInformation clientInformation) { + public void setClientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; } - public PasskeyLoginStartReq crossDeviceAuthenticationStrategy(CrossDeviceAuthenticationStrategy crossDeviceAuthenticationStrategy) { + public PasskeyLoginStartReq crossDeviceAuthenticationStrategy(@javax.annotation.Nonnull CrossDeviceAuthenticationStrategy crossDeviceAuthenticationStrategy) { this.crossDeviceAuthenticationStrategy = crossDeviceAuthenticationStrategy; return this; } @@ -124,12 +127,12 @@ public CrossDeviceAuthenticationStrategy getCrossDeviceAuthenticationStrategy() return crossDeviceAuthenticationStrategy; } - public void setCrossDeviceAuthenticationStrategy(CrossDeviceAuthenticationStrategy crossDeviceAuthenticationStrategy) { + public void setCrossDeviceAuthenticationStrategy(@javax.annotation.Nonnull CrossDeviceAuthenticationStrategy crossDeviceAuthenticationStrategy) { this.crossDeviceAuthenticationStrategy = crossDeviceAuthenticationStrategy; } - public PasskeyLoginStartReq processID(String processID) { + public PasskeyLoginStartReq processID(@javax.annotation.Nonnull String processID) { this.processID = processID; return this; } @@ -143,7 +146,7 @@ public String getProcessID() { return processID; } - public void setProcessID(String processID) { + public void setProcessID(@javax.annotation.Nonnull String processID) { this.processID = processID; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java index 6c9c90c..5d64c36 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java @@ -14,17 +14,15 @@ package com.corbado.generated.model; import java.util.Objects; -import com.corbado.generated.model.DecisionTag; -import com.corbado.generated.model.DetectionTag; +import com.corbado.generated.model.DecisionInsights; +import com.corbado.generated.model.DetectionInsights; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -41,7 +39,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,32 +50,32 @@ /** * PasskeyLoginStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyLoginStartRsp { public static final String SERIALIZED_NAME_LOGIN_ALLOW = "loginAllow"; @SerializedName(SERIALIZED_NAME_LOGIN_ALLOW) + @javax.annotation.Nonnull private Boolean loginAllow; - public static final String SERIALIZED_NAME_DETECTION_TAGS = "detectionTags"; - @SerializedName(SERIALIZED_NAME_DETECTION_TAGS) - private List detectionTags = new ArrayList<>(); - - public static final String SERIALIZED_NAME_DECISION_TAG = "decisionTag"; - @SerializedName(SERIALIZED_NAME_DECISION_TAG) - private DecisionTag decisionTag; - public static final String SERIALIZED_NAME_ASSERTION_OPTIONS = "assertionOptions"; @SerializedName(SERIALIZED_NAME_ASSERTION_OPTIONS) + @javax.annotation.Nonnull private String assertionOptions; - public static final String SERIALIZED_NAME_IS_C_D_A_CANDIDATE = "isCDACandidate"; - @SerializedName(SERIALIZED_NAME_IS_C_D_A_CANDIDATE) - private Boolean isCDACandidate; + public static final String SERIALIZED_NAME_DETECTION_INSIGHTS = "detectionInsights"; + @SerializedName(SERIALIZED_NAME_DETECTION_INSIGHTS) + @javax.annotation.Nonnull + private DetectionInsights detectionInsights; + + public static final String SERIALIZED_NAME_DECISION_INSIGHTS = "decisionInsights"; + @SerializedName(SERIALIZED_NAME_DECISION_INSIGHTS) + @javax.annotation.Nonnull + private DecisionInsights decisionInsights; public PasskeyLoginStartRsp() { } - public PasskeyLoginStartRsp loginAllow(Boolean loginAllow) { + public PasskeyLoginStartRsp loginAllow(@javax.annotation.Nonnull Boolean loginAllow) { this.loginAllow = loginAllow; return this; } @@ -92,92 +89,65 @@ public Boolean getLoginAllow() { return loginAllow; } - public void setLoginAllow(Boolean loginAllow) { + public void setLoginAllow(@javax.annotation.Nonnull Boolean loginAllow) { this.loginAllow = loginAllow; } - public PasskeyLoginStartRsp detectionTags(List detectionTags) { - this.detectionTags = detectionTags; - return this; - } - - public PasskeyLoginStartRsp addDetectionTagsItem(DetectionTag detectionTagsItem) { - if (this.detectionTags == null) { - this.detectionTags = new ArrayList<>(); - } - this.detectionTags.add(detectionTagsItem); - return this; - } - - /** - * Get detectionTags - * @return detectionTags - */ - @javax.annotation.Nonnull - public List getDetectionTags() { - return detectionTags; - } - - public void setDetectionTags(List detectionTags) { - this.detectionTags = detectionTags; - } - - - public PasskeyLoginStartRsp decisionTag(DecisionTag decisionTag) { - this.decisionTag = decisionTag; + public PasskeyLoginStartRsp assertionOptions(@javax.annotation.Nonnull String assertionOptions) { + this.assertionOptions = assertionOptions; return this; } /** - * Get decisionTag - * @return decisionTag + * Get assertionOptions + * @return assertionOptions */ @javax.annotation.Nonnull - public DecisionTag getDecisionTag() { - return decisionTag; + public String getAssertionOptions() { + return assertionOptions; } - public void setDecisionTag(DecisionTag decisionTag) { - this.decisionTag = decisionTag; + public void setAssertionOptions(@javax.annotation.Nonnull String assertionOptions) { + this.assertionOptions = assertionOptions; } - public PasskeyLoginStartRsp assertionOptions(String assertionOptions) { - this.assertionOptions = assertionOptions; + public PasskeyLoginStartRsp detectionInsights(@javax.annotation.Nonnull DetectionInsights detectionInsights) { + this.detectionInsights = detectionInsights; return this; } /** - * Get assertionOptions - * @return assertionOptions + * Get detectionInsights + * @return detectionInsights */ @javax.annotation.Nonnull - public String getAssertionOptions() { - return assertionOptions; + public DetectionInsights getDetectionInsights() { + return detectionInsights; } - public void setAssertionOptions(String assertionOptions) { - this.assertionOptions = assertionOptions; + public void setDetectionInsights(@javax.annotation.Nonnull DetectionInsights detectionInsights) { + this.detectionInsights = detectionInsights; } - public PasskeyLoginStartRsp isCDACandidate(Boolean isCDACandidate) { - this.isCDACandidate = isCDACandidate; + public PasskeyLoginStartRsp decisionInsights(@javax.annotation.Nonnull DecisionInsights decisionInsights) { + this.decisionInsights = decisionInsights; return this; } /** - * Get isCDACandidate - * @return isCDACandidate + * Get decisionInsights + * @return decisionInsights */ @javax.annotation.Nonnull - public Boolean getIsCDACandidate() { - return isCDACandidate; + public DecisionInsights getDecisionInsights() { + return decisionInsights; } - public void setIsCDACandidate(Boolean isCDACandidate) { - this.isCDACandidate = isCDACandidate; + public void setDecisionInsights(@javax.annotation.Nonnull DecisionInsights decisionInsights) { + this.decisionInsights = decisionInsights; } @@ -192,15 +162,14 @@ public boolean equals(Object o) { } PasskeyLoginStartRsp passkeyLoginStartRsp = (PasskeyLoginStartRsp) o; return Objects.equals(this.loginAllow, passkeyLoginStartRsp.loginAllow) && - Objects.equals(this.detectionTags, passkeyLoginStartRsp.detectionTags) && - Objects.equals(this.decisionTag, passkeyLoginStartRsp.decisionTag) && Objects.equals(this.assertionOptions, passkeyLoginStartRsp.assertionOptions) && - Objects.equals(this.isCDACandidate, passkeyLoginStartRsp.isCDACandidate); + Objects.equals(this.detectionInsights, passkeyLoginStartRsp.detectionInsights) && + Objects.equals(this.decisionInsights, passkeyLoginStartRsp.decisionInsights); } @Override public int hashCode() { - return Objects.hash(loginAllow, detectionTags, decisionTag, assertionOptions, isCDACandidate); + return Objects.hash(loginAllow, assertionOptions, detectionInsights, decisionInsights); } @Override @@ -208,10 +177,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyLoginStartRsp {\n"); sb.append(" loginAllow: ").append(toIndentedString(loginAllow)).append("\n"); - sb.append(" detectionTags: ").append(toIndentedString(detectionTags)).append("\n"); - sb.append(" decisionTag: ").append(toIndentedString(decisionTag)).append("\n"); sb.append(" assertionOptions: ").append(toIndentedString(assertionOptions)).append("\n"); - sb.append(" isCDACandidate: ").append(toIndentedString(isCDACandidate)).append("\n"); + sb.append(" detectionInsights: ").append(toIndentedString(detectionInsights)).append("\n"); + sb.append(" decisionInsights: ").append(toIndentedString(decisionInsights)).append("\n"); sb.append("}"); return sb.toString(); } @@ -235,18 +203,16 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("loginAllow"); - openapiFields.add("detectionTags"); - openapiFields.add("decisionTag"); openapiFields.add("assertionOptions"); - openapiFields.add("isCDACandidate"); + openapiFields.add("detectionInsights"); + openapiFields.add("decisionInsights"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("loginAllow"); - openapiRequiredFields.add("detectionTags"); - openapiRequiredFields.add("decisionTag"); openapiRequiredFields.add("assertionOptions"); - openapiRequiredFields.add("isCDACandidate"); + openapiRequiredFields.add("detectionInsights"); + openapiRequiredFields.add("decisionInsights"); } /** @@ -277,21 +243,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("detectionTags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `detectionTags` to be an array in the JSON string but got `%s`", jsonObj.get("detectionTags").toString())); - } - - JsonArray jsonArraydetectionTags = jsonObj.getAsJsonArray("detectionTags"); - // validate the required field `detectionTags` (array) - for (int i = 0; i < jsonArraydetectionTags.size(); i++) { - DetectionTag.validateJsonElement(jsonArraydetectionTags.get(i)); - }; - // validate the required field `decisionTag` - DecisionTag.validateJsonElement(jsonObj.get("decisionTag")); if (!jsonObj.get("assertionOptions").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `assertionOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assertionOptions").toString())); } + // validate the required field `detectionInsights` + DetectionInsights.validateJsonElement(jsonObj.get("detectionInsights")); + // validate the required field `decisionInsights` + DecisionInsights.validateJsonElement(jsonObj.get("decisionInsights")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java index 6a20401..4c6ca75 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,24 +49,32 @@ /** * PasskeyMediationFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyMediationFinishReq { public static final String SERIALIZED_NAME_ASSERTION_RESPONSE = "assertionResponse"; @SerializedName(SERIALIZED_NAME_ASSERTION_RESPONSE) + @javax.annotation.Nonnull private String assertionResponse; public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + @javax.annotation.Nonnull private ClientInformation clientInformation; public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + @javax.annotation.Nonnull private String processID; + public static final String SERIALIZED_NAME_SIGN_PASSKEY_DATA = "signPasskeyData"; + @SerializedName(SERIALIZED_NAME_SIGN_PASSKEY_DATA) + @javax.annotation.Nullable + private Boolean signPasskeyData; + public PasskeyMediationFinishReq() { } - public PasskeyMediationFinishReq assertionResponse(String assertionResponse) { + public PasskeyMediationFinishReq assertionResponse(@javax.annotation.Nonnull String assertionResponse) { this.assertionResponse = assertionResponse; return this; } @@ -81,12 +88,12 @@ public String getAssertionResponse() { return assertionResponse; } - public void setAssertionResponse(String assertionResponse) { + public void setAssertionResponse(@javax.annotation.Nonnull String assertionResponse) { this.assertionResponse = assertionResponse; } - public PasskeyMediationFinishReq clientInformation(ClientInformation clientInformation) { + public PasskeyMediationFinishReq clientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; return this; } @@ -100,12 +107,12 @@ public ClientInformation getClientInformation() { return clientInformation; } - public void setClientInformation(ClientInformation clientInformation) { + public void setClientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; } - public PasskeyMediationFinishReq processID(String processID) { + public PasskeyMediationFinishReq processID(@javax.annotation.Nonnull String processID) { this.processID = processID; return this; } @@ -119,11 +126,30 @@ public String getProcessID() { return processID; } - public void setProcessID(String processID) { + public void setProcessID(@javax.annotation.Nonnull String processID) { this.processID = processID; } + public PasskeyMediationFinishReq signPasskeyData(@javax.annotation.Nullable Boolean signPasskeyData) { + this.signPasskeyData = signPasskeyData; + return this; + } + + /** + * Get signPasskeyData + * @return signPasskeyData + */ + @javax.annotation.Nullable + public Boolean getSignPasskeyData() { + return signPasskeyData; + } + + public void setSignPasskeyData(@javax.annotation.Nullable Boolean signPasskeyData) { + this.signPasskeyData = signPasskeyData; + } + + @Override public boolean equals(Object o) { @@ -136,12 +162,13 @@ public boolean equals(Object o) { PasskeyMediationFinishReq passkeyMediationFinishReq = (PasskeyMediationFinishReq) o; return Objects.equals(this.assertionResponse, passkeyMediationFinishReq.assertionResponse) && Objects.equals(this.clientInformation, passkeyMediationFinishReq.clientInformation) && - Objects.equals(this.processID, passkeyMediationFinishReq.processID); + Objects.equals(this.processID, passkeyMediationFinishReq.processID) && + Objects.equals(this.signPasskeyData, passkeyMediationFinishReq.signPasskeyData); } @Override public int hashCode() { - return Objects.hash(assertionResponse, clientInformation, processID); + return Objects.hash(assertionResponse, clientInformation, processID, signPasskeyData); } @Override @@ -151,6 +178,7 @@ public String toString() { sb.append(" assertionResponse: ").append(toIndentedString(assertionResponse)).append("\n"); sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append(" signPasskeyData: ").append(toIndentedString(signPasskeyData)).append("\n"); sb.append("}"); return sb.toString(); } @@ -176,6 +204,7 @@ private String toIndentedString(Object o) { openapiFields.add("assertionResponse"); openapiFields.add("clientInformation"); openapiFields.add("processID"); + openapiFields.add("signPasskeyData"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java index 72043b4..b63ef4c 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,16 +49,22 @@ /** * PasskeyMediationFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyMediationFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) + @javax.annotation.Nonnull private PasskeyData passkeyData; + public static final String SERIALIZED_NAME_SIGNED_PASSKEY_DATA = "signedPasskeyData"; + @SerializedName(SERIALIZED_NAME_SIGNED_PASSKEY_DATA) + @javax.annotation.Nullable + private String signedPasskeyData; + public PasskeyMediationFinishRsp() { } - public PasskeyMediationFinishRsp passkeyData(PasskeyData passkeyData) { + public PasskeyMediationFinishRsp passkeyData(@javax.annotation.Nonnull PasskeyData passkeyData) { this.passkeyData = passkeyData; return this; } @@ -73,11 +78,30 @@ public PasskeyData getPasskeyData() { return passkeyData; } - public void setPasskeyData(PasskeyData passkeyData) { + public void setPasskeyData(@javax.annotation.Nonnull PasskeyData passkeyData) { this.passkeyData = passkeyData; } + public PasskeyMediationFinishRsp signedPasskeyData(@javax.annotation.Nullable String signedPasskeyData) { + this.signedPasskeyData = signedPasskeyData; + return this; + } + + /** + * Get signedPasskeyData + * @return signedPasskeyData + */ + @javax.annotation.Nullable + public String getSignedPasskeyData() { + return signedPasskeyData; + } + + public void setSignedPasskeyData(@javax.annotation.Nullable String signedPasskeyData) { + this.signedPasskeyData = signedPasskeyData; + } + + @Override public boolean equals(Object o) { @@ -88,12 +112,13 @@ public boolean equals(Object o) { return false; } PasskeyMediationFinishRsp passkeyMediationFinishRsp = (PasskeyMediationFinishRsp) o; - return Objects.equals(this.passkeyData, passkeyMediationFinishRsp.passkeyData); + return Objects.equals(this.passkeyData, passkeyMediationFinishRsp.passkeyData) && + Objects.equals(this.signedPasskeyData, passkeyMediationFinishRsp.signedPasskeyData); } @Override public int hashCode() { - return Objects.hash(passkeyData); + return Objects.hash(passkeyData, signedPasskeyData); } @Override @@ -101,6 +126,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyMediationFinishRsp {\n"); sb.append(" passkeyData: ").append(toIndentedString(passkeyData)).append("\n"); + sb.append(" signedPasskeyData: ").append(toIndentedString(signedPasskeyData)).append("\n"); sb.append("}"); return sb.toString(); } @@ -124,6 +150,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("passkeyData"); + openapiFields.add("signedPasskeyData"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -160,6 +187,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `passkeyData` PasskeyData.validateJsonElement(jsonObj.get("passkeyData")); + if ((jsonObj.get("signedPasskeyData") != null && !jsonObj.get("signedPasskeyData").isJsonNull()) && !jsonObj.get("signedPasskeyData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedPasskeyData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedPasskeyData").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java index dc96f30..55efe61 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,16 +49,17 @@ /** * PasskeyMediationStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyMediationStartReq { public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + @javax.annotation.Nonnull private ClientInformation clientInformation; public PasskeyMediationStartReq() { } - public PasskeyMediationStartReq clientInformation(ClientInformation clientInformation) { + public PasskeyMediationStartReq clientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; return this; } @@ -73,7 +73,7 @@ public ClientInformation getClientInformation() { return clientInformation; } - public void setClientInformation(ClientInformation clientInformation) { + public void setClientInformation(@javax.annotation.Nonnull ClientInformation clientInformation) { this.clientInformation = clientInformation; } diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java index 0886171..f50bc38 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,20 +48,22 @@ /** * PasskeyMediationStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class PasskeyMediationStartRsp { public static final String SERIALIZED_NAME_LOGIN_ALLOW = "loginAllow"; @SerializedName(SERIALIZED_NAME_LOGIN_ALLOW) + @javax.annotation.Nonnull private Boolean loginAllow; public static final String SERIALIZED_NAME_ASSERTION_OPTIONS = "assertionOptions"; @SerializedName(SERIALIZED_NAME_ASSERTION_OPTIONS) + @javax.annotation.Nonnull private String assertionOptions; public PasskeyMediationStartRsp() { } - public PasskeyMediationStartRsp loginAllow(Boolean loginAllow) { + public PasskeyMediationStartRsp loginAllow(@javax.annotation.Nonnull Boolean loginAllow) { this.loginAllow = loginAllow; return this; } @@ -76,12 +77,12 @@ public Boolean getLoginAllow() { return loginAllow; } - public void setLoginAllow(Boolean loginAllow) { + public void setLoginAllow(@javax.annotation.Nonnull Boolean loginAllow) { this.loginAllow = loginAllow; } - public PasskeyMediationStartRsp assertionOptions(String assertionOptions) { + public PasskeyMediationStartRsp assertionOptions(@javax.annotation.Nonnull String assertionOptions) { this.assertionOptions = assertionOptions; return this; } @@ -95,7 +96,7 @@ public String getAssertionOptions() { return assertionOptions; } - public void setAssertionOptions(String assertionOptions) { + public void setAssertionOptions(@javax.annotation.Nonnull String assertionOptions) { this.assertionOptions = assertionOptions; } diff --git a/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java b/src/main/java/com/corbado/generated/model/PasskeyPostLoginReq.java similarity index 60% rename from src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java rename to src/main/java/com/corbado/generated/model/PasskeyPostLoginReq.java index 8ee786b..40e61f5 100644 --- a/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyPostLoginReq.java @@ -14,7 +14,6 @@ package com.corbado.generated.model; import java.util.Objects; -import com.corbado.generated.model.LongSessionStatus; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -38,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -48,33 +46,34 @@ import com.corbado.generated.invoker.JSON; /** - * LongSessionUpdateReq + * PasskeyPostLoginReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") -public class LongSessionUpdateReq { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private LongSessionStatus status; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class PasskeyPostLoginReq { + public static final String SERIALIZED_NAME_SIGNED_PASSKEY_DATA = "signedPasskeyData"; + @SerializedName(SERIALIZED_NAME_SIGNED_PASSKEY_DATA) + @javax.annotation.Nonnull + private String signedPasskeyData; - public LongSessionUpdateReq() { + public PasskeyPostLoginReq() { } - public LongSessionUpdateReq status(LongSessionStatus status) { - this.status = status; + public PasskeyPostLoginReq signedPasskeyData(@javax.annotation.Nonnull String signedPasskeyData) { + this.signedPasskeyData = signedPasskeyData; return this; } /** - * Get status - * @return status + * Get signedPasskeyData + * @return signedPasskeyData */ @javax.annotation.Nonnull - public LongSessionStatus getStatus() { - return status; + public String getSignedPasskeyData() { + return signedPasskeyData; } - public void setStatus(LongSessionStatus status) { - this.status = status; + public void setSignedPasskeyData(@javax.annotation.Nonnull String signedPasskeyData) { + this.signedPasskeyData = signedPasskeyData; } @@ -87,20 +86,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - LongSessionUpdateReq longSessionUpdateReq = (LongSessionUpdateReq) o; - return Objects.equals(this.status, longSessionUpdateReq.status); + PasskeyPostLoginReq passkeyPostLoginReq = (PasskeyPostLoginReq) o; + return Objects.equals(this.signedPasskeyData, passkeyPostLoginReq.signedPasskeyData); } @Override public int hashCode() { - return Objects.hash(status); + return Objects.hash(signedPasskeyData); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class LongSessionUpdateReq {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("class PasskeyPostLoginReq {\n"); + sb.append(" signedPasskeyData: ").append(toIndentedString(signedPasskeyData)).append("\n"); sb.append("}"); return sb.toString(); } @@ -123,65 +122,66 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("status"); + openapiFields.add("signedPasskeyData"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); + openapiRequiredFields.add("signedPasskeyData"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSessionUpdateReq + * @throws IOException if the JSON Element is invalid with respect to PasskeyPostLoginReq */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!LongSessionUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionUpdateReq is not found in the empty JSON string", LongSessionUpdateReq.openapiRequiredFields.toString())); + if (!PasskeyPostLoginReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyPostLoginReq is not found in the empty JSON string", PasskeyPostLoginReq.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!LongSessionUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!PasskeyPostLoginReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyPostLoginReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : LongSessionUpdateReq.openapiRequiredFields) { + for (String requiredField : PasskeyPostLoginReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `status` - LongSessionStatus.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("signedPasskeyData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedPasskeyData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedPasskeyData").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!LongSessionUpdateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'LongSessionUpdateReq' and its subtypes + if (!PasskeyPostLoginReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyPostLoginReq' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(LongSessionUpdateReq.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyPostLoginReq.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, LongSessionUpdateReq value) throws IOException { + public void write(JsonWriter out, PasskeyPostLoginReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public LongSessionUpdateReq read(JsonReader in) throws IOException { + public PasskeyPostLoginReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -192,18 +192,18 @@ public LongSessionUpdateReq read(JsonReader in) throws IOException { } /** - * Create an instance of LongSessionUpdateReq given an JSON string + * Create an instance of PasskeyPostLoginReq given an JSON string * * @param jsonString JSON string - * @return An instance of LongSessionUpdateReq - * @throws IOException if the JSON string is invalid with respect to LongSessionUpdateReq + * @return An instance of PasskeyPostLoginReq + * @throws IOException if the JSON string is invalid with respect to PasskeyPostLoginReq */ - public static LongSessionUpdateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, LongSessionUpdateReq.class); + public static PasskeyPostLoginReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyPostLoginReq.class); } /** - * Convert an instance of LongSessionUpdateReq to an JSON string + * Convert an instance of PasskeyPostLoginReq to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/corbado/generated/model/ShortSession.java b/src/main/java/com/corbado/generated/model/PasskeyPostLoginRsp.java similarity index 63% rename from src/main/java/com/corbado/generated/model/ShortSession.java rename to src/main/java/com/corbado/generated/model/PasskeyPostLoginRsp.java index abbdf37..f3d61e9 100644 --- a/src/main/java/com/corbado/generated/model/ShortSession.java +++ b/src/main/java/com/corbado/generated/model/PasskeyPostLoginRsp.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -47,33 +46,34 @@ import com.corbado.generated.invoker.JSON; /** - * ShortSession + * PasskeyPostLoginRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") -public class ShortSession { - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class PasskeyPostLoginRsp { + public static final String SERIALIZED_NAME_SESSION = "session"; + @SerializedName(SERIALIZED_NAME_SESSION) + @javax.annotation.Nonnull + private String session; - public ShortSession() { + public PasskeyPostLoginRsp() { } - public ShortSession value(String value) { - this.value = value; + public PasskeyPostLoginRsp session(@javax.annotation.Nonnull String session) { + this.session = session; return this; } /** - * Get value - * @return value + * Get session + * @return session */ @javax.annotation.Nonnull - public String getValue() { - return value; + public String getSession() { + return session; } - public void setValue(String value) { - this.value = value; + public void setSession(@javax.annotation.Nonnull String session) { + this.session = session; } @@ -86,20 +86,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ShortSession shortSession = (ShortSession) o; - return Objects.equals(this.value, shortSession.value); + PasskeyPostLoginRsp passkeyPostLoginRsp = (PasskeyPostLoginRsp) o; + return Objects.equals(this.session, passkeyPostLoginRsp.session); } @Override public int hashCode() { - return Objects.hash(value); + return Objects.hash(session); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ShortSession {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("class PasskeyPostLoginRsp {\n"); + sb.append(" session: ").append(toIndentedString(session)).append("\n"); sb.append("}"); return sb.toString(); } @@ -122,43 +122,43 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("value"); + openapiFields.add("session"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("value"); + openapiRequiredFields.add("session"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ShortSession + * @throws IOException if the JSON Element is invalid with respect to PasskeyPostLoginRsp */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ShortSession.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ShortSession is not found in the empty JSON string", ShortSession.openapiRequiredFields.toString())); + if (!PasskeyPostLoginRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyPostLoginRsp is not found in the empty JSON string", PasskeyPostLoginRsp.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ShortSession.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShortSession` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!PasskeyPostLoginRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyPostLoginRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ShortSession.openapiRequiredFields) { + for (String requiredField : PasskeyPostLoginRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + if (!jsonObj.get("session").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `session` to be a primitive type in the JSON string but got `%s`", jsonObj.get("session").toString())); } } @@ -166,22 +166,22 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ShortSession.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ShortSession' and its subtypes + if (!PasskeyPostLoginRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyPostLoginRsp' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ShortSession.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyPostLoginRsp.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ShortSession value) throws IOException { + public void write(JsonWriter out, PasskeyPostLoginRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ShortSession read(JsonReader in) throws IOException { + public PasskeyPostLoginRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -192,18 +192,18 @@ public ShortSession read(JsonReader in) throws IOException { } /** - * Create an instance of ShortSession given an JSON string + * Create an instance of PasskeyPostLoginRsp given an JSON string * * @param jsonString JSON string - * @return An instance of ShortSession - * @throws IOException if the JSON string is invalid with respect to ShortSession + * @return An instance of PasskeyPostLoginRsp + * @throws IOException if the JSON string is invalid with respect to PasskeyPostLoginRsp */ - public static ShortSession fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ShortSession.class); + public static PasskeyPostLoginRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyPostLoginRsp.class); } /** - * Convert an instance of ShortSession to an JSON string + * Convert an instance of PasskeyPostLoginRsp to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/corbado/generated/model/PasswordManager.java b/src/main/java/com/corbado/generated/model/PasswordManager.java new file mode 100644 index 0000000..48957b4 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasswordManager.java @@ -0,0 +1,425 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasswordManager + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class PasswordManager { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull + private String userID; + + public static final String SERIALIZED_NAME_CLIENT_ENV_I_D = "clientEnvID"; + @SerializedName(SERIALIZED_NAME_CLIENT_ENV_I_D) + @javax.annotation.Nonnull + private String clientEnvID; + + public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + @javax.annotation.Nonnull + private String credentialID; + + public static final String SERIALIZED_NAME_AAGUID = "aaguid"; + @SerializedName(SERIALIZED_NAME_AAGUID) + @javax.annotation.Nonnull + private String aaguid; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private String status; + + public static final String SERIALIZED_NAME_SCORE = "score"; + @SerializedName(SERIALIZED_NAME_SCORE) + @javax.annotation.Nonnull + private Integer score; + + public static final String SERIALIZED_NAME_CREATED_MS = "createdMs"; + @SerializedName(SERIALIZED_NAME_CREATED_MS) + @javax.annotation.Nonnull + private Long createdMs; + + public PasswordManager() { + } + + public PasswordManager id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public PasswordManager userID(@javax.annotation.Nonnull String userID) { + this.userID = userID; + return this; + } + + /** + * Get userID + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(@javax.annotation.Nonnull String userID) { + this.userID = userID; + } + + + public PasswordManager clientEnvID(@javax.annotation.Nonnull String clientEnvID) { + this.clientEnvID = clientEnvID; + return this; + } + + /** + * Get clientEnvID + * @return clientEnvID + */ + @javax.annotation.Nonnull + public String getClientEnvID() { + return clientEnvID; + } + + public void setClientEnvID(@javax.annotation.Nonnull String clientEnvID) { + this.clientEnvID = clientEnvID; + } + + + public PasswordManager credentialID(@javax.annotation.Nonnull String credentialID) { + this.credentialID = credentialID; + return this; + } + + /** + * Get credentialID + * @return credentialID + */ + @javax.annotation.Nonnull + public String getCredentialID() { + return credentialID; + } + + public void setCredentialID(@javax.annotation.Nonnull String credentialID) { + this.credentialID = credentialID; + } + + + public PasswordManager aaguid(@javax.annotation.Nonnull String aaguid) { + this.aaguid = aaguid; + return this; + } + + /** + * Get aaguid + * @return aaguid + */ + @javax.annotation.Nonnull + public String getAaguid() { + return aaguid; + } + + public void setAaguid(@javax.annotation.Nonnull String aaguid) { + this.aaguid = aaguid; + } + + + public PasswordManager status(@javax.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; + } + + + public PasswordManager score(@javax.annotation.Nonnull Integer score) { + this.score = score; + return this; + } + + /** + * Get score + * @return score + */ + @javax.annotation.Nonnull + public Integer getScore() { + return score; + } + + public void setScore(@javax.annotation.Nonnull Integer score) { + this.score = score; + } + + + public PasswordManager createdMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + return this; + } + + /** + * Get createdMs + * @return createdMs + */ + @javax.annotation.Nonnull + public Long getCreatedMs() { + return createdMs; + } + + public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordManager passwordManager = (PasswordManager) o; + return Objects.equals(this.id, passwordManager.id) && + Objects.equals(this.userID, passwordManager.userID) && + Objects.equals(this.clientEnvID, passwordManager.clientEnvID) && + Objects.equals(this.credentialID, passwordManager.credentialID) && + Objects.equals(this.aaguid, passwordManager.aaguid) && + Objects.equals(this.status, passwordManager.status) && + Objects.equals(this.score, passwordManager.score) && + Objects.equals(this.createdMs, passwordManager.createdMs); + } + + @Override + public int hashCode() { + return Objects.hash(id, userID, clientEnvID, credentialID, aaguid, status, score, createdMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordManager {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" clientEnvID: ").append(toIndentedString(clientEnvID)).append("\n"); + sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); + sb.append(" aaguid: ").append(toIndentedString(aaguid)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("userID"); + openapiFields.add("clientEnvID"); + openapiFields.add("credentialID"); + openapiFields.add("aaguid"); + openapiFields.add("status"); + openapiFields.add("score"); + openapiFields.add("createdMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("clientEnvID"); + openapiRequiredFields.add("credentialID"); + openapiRequiredFields.add("aaguid"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("score"); + openapiRequiredFields.add("createdMs"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasswordManager + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordManager.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordManager is not found in the empty JSON string", PasswordManager.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasswordManager.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasswordManager` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasswordManager.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("clientEnvID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientEnvID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientEnvID").toString())); + } + if (!jsonObj.get("credentialID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); + } + if (!jsonObj.get("aaguid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aaguid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aaguid").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasswordManager.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordManager' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordManager.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasswordManager value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasswordManager read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordManager given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordManager + * @throws IOException if the JSON string is invalid with respect to PasswordManager + */ + public static PasswordManager fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordManager.class); + } + + /** + * Convert an instance of PasswordManager to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java b/src/main/java/com/corbado/generated/model/PasswordManagerList.java similarity index 57% rename from src/main/java/com/corbado/generated/model/LongSessionCreateReq.java rename to src/main/java/com/corbado/generated/model/PasswordManagerList.java index 28f70a0..d31d657 100644 --- a/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java +++ b/src/main/java/com/corbado/generated/model/PasswordManagerList.java @@ -14,14 +14,16 @@ package com.corbado.generated.model; import java.util.Objects; -import com.corbado.generated.model.AppType; +import com.corbado.generated.model.PasswordManager; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -38,7 +40,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -48,56 +49,42 @@ import com.corbado.generated.invoker.JSON; /** - * LongSessionCreateReq + * PasswordManagerList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") -public class LongSessionCreateReq { - public static final String SERIALIZED_NAME_APP_TYPE = "appType"; - @SerializedName(SERIALIZED_NAME_APP_TYPE) - private AppType appType; - - public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; - @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) - private String identifierValue; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class PasswordManagerList { + public static final String SERIALIZED_NAME_PASSWORD_MANAGERS = "passwordManagers"; + @SerializedName(SERIALIZED_NAME_PASSWORD_MANAGERS) + @javax.annotation.Nonnull + private List passwordManagers = new ArrayList<>(); - public LongSessionCreateReq() { + public PasswordManagerList() { } - public LongSessionCreateReq appType(AppType appType) { - this.appType = appType; + public PasswordManagerList passwordManagers(@javax.annotation.Nonnull List passwordManagers) { + this.passwordManagers = passwordManagers; return this; } - /** - * Get appType - * @return appType - */ - @javax.annotation.Nonnull - public AppType getAppType() { - return appType; - } - - public void setAppType(AppType appType) { - this.appType = appType; - } - - - public LongSessionCreateReq identifierValue(String identifierValue) { - this.identifierValue = identifierValue; + public PasswordManagerList addPasswordManagersItem(PasswordManager passwordManagersItem) { + if (this.passwordManagers == null) { + this.passwordManagers = new ArrayList<>(); + } + this.passwordManagers.add(passwordManagersItem); return this; } /** - * Get identifierValue - * @return identifierValue + * Get passwordManagers + * @return passwordManagers */ @javax.annotation.Nonnull - public String getIdentifierValue() { - return identifierValue; + public List getPasswordManagers() { + return passwordManagers; } - public void setIdentifierValue(String identifierValue) { - this.identifierValue = identifierValue; + public void setPasswordManagers(@javax.annotation.Nonnull List passwordManagers) { + this.passwordManagers = passwordManagers; } @@ -110,22 +97,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - LongSessionCreateReq longSessionCreateReq = (LongSessionCreateReq) o; - return Objects.equals(this.appType, longSessionCreateReq.appType) && - Objects.equals(this.identifierValue, longSessionCreateReq.identifierValue); + PasswordManagerList passwordManagerList = (PasswordManagerList) o; + return Objects.equals(this.passwordManagers, passwordManagerList.passwordManagers); } @Override public int hashCode() { - return Objects.hash(appType, identifierValue); + return Objects.hash(passwordManagers); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class LongSessionCreateReq {\n"); - sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); - sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append("class PasswordManagerList {\n"); + sb.append(" passwordManagers: ").append(toIndentedString(passwordManagers)).append("\n"); sb.append("}"); return sb.toString(); } @@ -148,70 +133,73 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("appType"); - openapiFields.add("identifierValue"); + openapiFields.add("passwordManagers"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("appType"); - openapiRequiredFields.add("identifierValue"); + openapiRequiredFields.add("passwordManagers"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSessionCreateReq + * @throws IOException if the JSON Element is invalid with respect to PasswordManagerList */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!LongSessionCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionCreateReq is not found in the empty JSON string", LongSessionCreateReq.openapiRequiredFields.toString())); + if (!PasswordManagerList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordManagerList is not found in the empty JSON string", PasswordManagerList.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!LongSessionCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!PasswordManagerList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasswordManagerList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : LongSessionCreateReq.openapiRequiredFields) { + for (String requiredField : PasswordManagerList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `appType` - AppType.validateJsonElement(jsonObj.get("appType")); - if (!jsonObj.get("identifierValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); + // ensure the json data is an array + if (!jsonObj.get("passwordManagers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `passwordManagers` to be an array in the JSON string but got `%s`", jsonObj.get("passwordManagers").toString())); } + + JsonArray jsonArraypasswordManagers = jsonObj.getAsJsonArray("passwordManagers"); + // validate the required field `passwordManagers` (array) + for (int i = 0; i < jsonArraypasswordManagers.size(); i++) { + PasswordManager.validateJsonElement(jsonArraypasswordManagers.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!LongSessionCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'LongSessionCreateReq' and its subtypes + if (!PasswordManagerList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordManagerList' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(LongSessionCreateReq.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordManagerList.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, LongSessionCreateReq value) throws IOException { + public void write(JsonWriter out, PasswordManagerList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public LongSessionCreateReq read(JsonReader in) throws IOException { + public PasswordManagerList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -222,18 +210,18 @@ public LongSessionCreateReq read(JsonReader in) throws IOException { } /** - * Create an instance of LongSessionCreateReq given an JSON string + * Create an instance of PasswordManagerList given an JSON string * * @param jsonString JSON string - * @return An instance of LongSessionCreateReq - * @throws IOException if the JSON string is invalid with respect to LongSessionCreateReq + * @return An instance of PasswordManagerList + * @throws IOException if the JSON string is invalid with respect to PasswordManagerList */ - public static LongSessionCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, LongSessionCreateReq.class); + public static PasswordManagerList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordManagerList.class); } /** - * Convert an instance of LongSessionCreateReq to an JSON string + * Convert an instance of PasswordManagerList to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java b/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java index 305aa7d..1e6e38e 100644 --- a/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java +++ b/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,16 +48,17 @@ /** * ProjectConfigUpdateCnameReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class ProjectConfigUpdateCnameReq { public static final String SERIALIZED_NAME_CNAME = "cname"; @SerializedName(SERIALIZED_NAME_CNAME) + @javax.annotation.Nonnull private String cname; public ProjectConfigUpdateCnameReq() { } - public ProjectConfigUpdateCnameReq cname(String cname) { + public ProjectConfigUpdateCnameReq cname(@javax.annotation.Nonnull String cname) { this.cname = cname; return this; } @@ -72,7 +72,7 @@ public String getCname() { return cname; } - public void setCname(String cname) { + public void setCname(@javax.annotation.Nonnull String cname) { this.cname = cname; } diff --git a/src/main/java/com/corbado/generated/model/RequestData.java b/src/main/java/com/corbado/generated/model/RequestData.java index 907c522..10c5dd7 100644 --- a/src/main/java/com/corbado/generated/model/RequestData.java +++ b/src/main/java/com/corbado/generated/model/RequestData.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,20 +48,22 @@ /** * Data about the request itself, can be used for debugging */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class RequestData { public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + @javax.annotation.Nonnull private String requestID; public static final String SERIALIZED_NAME_LINK = "link"; @SerializedName(SERIALIZED_NAME_LINK) + @javax.annotation.Nullable private String link; public RequestData() { } - public RequestData requestID(String requestID) { + public RequestData requestID(@javax.annotation.Nonnull String requestID) { this.requestID = requestID; return this; } @@ -76,12 +77,12 @@ public String getRequestID() { return requestID; } - public void setRequestID(String requestID) { + public void setRequestID(@javax.annotation.Nonnull String requestID) { this.requestID = requestID; } - public RequestData link(String link) { + public RequestData link(@javax.annotation.Nullable String link) { this.link = link; return this; } @@ -90,12 +91,12 @@ public RequestData link(String link) { * Link to dashboard with details about request * @return link */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getLink() { return link; } - public void setLink(String link) { + public void setLink(@javax.annotation.Nullable String link) { this.link = link; } @@ -153,7 +154,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("requestID"); - openapiRequiredFields.add("link"); } /** @@ -187,7 +187,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("requestID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); } - if (!jsonObj.get("link").isJsonPrimitive()) { + if ((jsonObj.get("link") != null && !jsonObj.get("link").isJsonNull()) && !jsonObj.get("link").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("link").toString())); } } diff --git a/src/main/java/com/corbado/generated/model/LongSession.java b/src/main/java/com/corbado/generated/model/Session.java similarity index 55% rename from src/main/java/com/corbado/generated/model/LongSession.java rename to src/main/java/com/corbado/generated/model/Session.java index e3672f8..4350216 100644 --- a/src/main/java/com/corbado/generated/model/LongSession.java +++ b/src/main/java/com/corbado/generated/model/Session.java @@ -14,7 +14,7 @@ package com.corbado.generated.model; import java.util.Objects; -import com.corbado.generated.model.LongSessionStatus; +import com.corbado.generated.model.SessionStatus; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -48,53 +47,68 @@ import com.corbado.generated.invoker.JSON; /** - * LongSession + * Session */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") -public class LongSession { - public static final String SERIALIZED_NAME_LONG_SESSION_I_D = "longSessionID"; - @SerializedName(SERIALIZED_NAME_LONG_SESSION_I_D) - private String longSessionID; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Session { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + @javax.annotation.Nonnull + private String sessionID; public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + @javax.annotation.Nonnull private String identifierValue; + public static final String SERIALIZED_NAME_CREATED_MS = "createdMs"; + @SerializedName(SERIALIZED_NAME_CREATED_MS) + @javax.annotation.Nonnull + private Long createdMs; + + public static final String SERIALIZED_NAME_LAST_ACTION_MS = "lastActionMs"; + @SerializedName(SERIALIZED_NAME_LAST_ACTION_MS) + @javax.annotation.Nonnull + private Long lastActionMs; + + public static final String SERIALIZED_NAME_EXPIRES_MS = "expiresMs"; + @SerializedName(SERIALIZED_NAME_EXPIRES_MS) + @javax.annotation.Nonnull + private Long expiresMs; + public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) - private LongSessionStatus status; - - public static final String SERIALIZED_NAME_EXPIRES = "expires"; - @SerializedName(SERIALIZED_NAME_EXPIRES) - private String expires; + @javax.annotation.Nonnull + private SessionStatus status; - public LongSession() { + public Session() { } - public LongSession longSessionID(String longSessionID) { - this.longSessionID = longSessionID; + public Session sessionID(@javax.annotation.Nonnull String sessionID) { + this.sessionID = sessionID; return this; } /** - * Get longSessionID - * @return longSessionID + * Get sessionID + * @return sessionID */ @javax.annotation.Nonnull - public String getLongSessionID() { - return longSessionID; + public String getSessionID() { + return sessionID; } - public void setLongSessionID(String longSessionID) { - this.longSessionID = longSessionID; + public void setSessionID(@javax.annotation.Nonnull String sessionID) { + this.sessionID = sessionID; } - public LongSession userID(String userID) { + public Session userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -108,12 +122,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public LongSession identifierValue(String identifierValue) { + public Session identifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; return this; } @@ -127,46 +141,84 @@ public String getIdentifierValue() { return identifierValue; } - public void setIdentifierValue(String identifierValue) { + public void setIdentifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; } - public LongSession status(LongSessionStatus status) { - this.status = status; + public Session createdMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; return this; } /** - * Get status - * @return status + * Get createdMs + * @return createdMs */ @javax.annotation.Nonnull - public LongSessionStatus getStatus() { - return status; + public Long getCreatedMs() { + return createdMs; } - public void setStatus(LongSessionStatus status) { - this.status = status; + public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + } + + + public Session lastActionMs(@javax.annotation.Nonnull Long lastActionMs) { + this.lastActionMs = lastActionMs; + return this; + } + + /** + * Get lastActionMs + * @return lastActionMs + */ + @javax.annotation.Nonnull + public Long getLastActionMs() { + return lastActionMs; + } + + public void setLastActionMs(@javax.annotation.Nonnull Long lastActionMs) { + this.lastActionMs = lastActionMs; + } + + + public Session expiresMs(@javax.annotation.Nonnull Long expiresMs) { + this.expiresMs = expiresMs; + return this; + } + + /** + * Get expiresMs + * @return expiresMs + */ + @javax.annotation.Nonnull + public Long getExpiresMs() { + return expiresMs; + } + + public void setExpiresMs(@javax.annotation.Nonnull Long expiresMs) { + this.expiresMs = expiresMs; } - public LongSession expires(String expires) { - this.expires = expires; + public Session status(@javax.annotation.Nonnull SessionStatus status) { + this.status = status; return this; } /** - * Get expires - * @return expires + * Get status + * @return status */ @javax.annotation.Nonnull - public String getExpires() { - return expires; + public SessionStatus getStatus() { + return status; } - public void setExpires(String expires) { - this.expires = expires; + public void setStatus(@javax.annotation.Nonnull SessionStatus status) { + this.status = status; } @@ -179,28 +231,32 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - LongSession longSession = (LongSession) o; - return Objects.equals(this.longSessionID, longSession.longSessionID) && - Objects.equals(this.userID, longSession.userID) && - Objects.equals(this.identifierValue, longSession.identifierValue) && - Objects.equals(this.status, longSession.status) && - Objects.equals(this.expires, longSession.expires); + Session session = (Session) o; + return Objects.equals(this.sessionID, session.sessionID) && + Objects.equals(this.userID, session.userID) && + Objects.equals(this.identifierValue, session.identifierValue) && + Objects.equals(this.createdMs, session.createdMs) && + Objects.equals(this.lastActionMs, session.lastActionMs) && + Objects.equals(this.expiresMs, session.expiresMs) && + Objects.equals(this.status, session.status); } @Override public int hashCode() { - return Objects.hash(longSessionID, userID, identifierValue, status, expires); + return Objects.hash(sessionID, userID, identifierValue, createdMs, lastActionMs, expiresMs, status); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class LongSession {\n"); - sb.append(" longSessionID: ").append(toIndentedString(longSessionID)).append("\n"); + sb.append("class Session {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); + sb.append(" lastActionMs: ").append(toIndentedString(lastActionMs)).append("\n"); + sb.append(" expiresMs: ").append(toIndentedString(expiresMs)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); sb.append("}"); return sb.toString(); } @@ -223,51 +279,55 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("longSessionID"); + openapiFields.add("sessionID"); openapiFields.add("userID"); openapiFields.add("identifierValue"); + openapiFields.add("createdMs"); + openapiFields.add("lastActionMs"); + openapiFields.add("expiresMs"); openapiFields.add("status"); - openapiFields.add("expires"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("longSessionID"); + openapiRequiredFields.add("sessionID"); openapiRequiredFields.add("userID"); openapiRequiredFields.add("identifierValue"); + openapiRequiredFields.add("createdMs"); + openapiRequiredFields.add("lastActionMs"); + openapiRequiredFields.add("expiresMs"); openapiRequiredFields.add("status"); - openapiRequiredFields.add("expires"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSession + * @throws IOException if the JSON Element is invalid with respect to Session */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!LongSession.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in LongSession is not found in the empty JSON string", LongSession.openapiRequiredFields.toString())); + if (!Session.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Session is not found in the empty JSON string", Session.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!LongSession.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSession` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!Session.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Session` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : LongSession.openapiRequiredFields) { + for (String requiredField : Session.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("longSessionID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `longSessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longSessionID").toString())); + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); } if (!jsonObj.get("userID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); @@ -276,32 +336,29 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); } // validate the required field `status` - LongSessionStatus.validateJsonElement(jsonObj.get("status")); - if (!jsonObj.get("expires").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expires` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires").toString())); - } + SessionStatus.validateJsonElement(jsonObj.get("status")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!LongSession.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'LongSession' and its subtypes + if (!Session.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Session' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(LongSession.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Session.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, LongSession value) throws IOException { + public void write(JsonWriter out, Session value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public LongSession read(JsonReader in) throws IOException { + public Session read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -312,18 +369,18 @@ public LongSession read(JsonReader in) throws IOException { } /** - * Create an instance of LongSession given an JSON string + * Create an instance of Session given an JSON string * * @param jsonString JSON string - * @return An instance of LongSession - * @throws IOException if the JSON string is invalid with respect to LongSession + * @return An instance of Session + * @throws IOException if the JSON string is invalid with respect to Session */ - public static LongSession fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, LongSession.class); + public static Session fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Session.class); } /** - * Convert an instance of LongSession to an JSON string + * Convert an instance of Session to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/corbado/generated/model/SessionList.java b/src/main/java/com/corbado/generated/model/SessionList.java new file mode 100644 index 0000000..382ae97 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionList.java @@ -0,0 +1,263 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.Session; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class SessionList { + public static final String SERIALIZED_NAME_SESSIONS = "sessions"; + @SerializedName(SERIALIZED_NAME_SESSIONS) + @javax.annotation.Nonnull + private List sessions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + @javax.annotation.Nonnull + private Paging paging; + + public SessionList() { + } + + public SessionList sessions(@javax.annotation.Nonnull List sessions) { + this.sessions = sessions; + return this; + } + + public SessionList addSessionsItem(Session sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * @return sessions + */ + @javax.annotation.Nonnull + public List getSessions() { + return sessions; + } + + public void setSessions(@javax.annotation.Nonnull List sessions) { + this.sessions = sessions; + } + + + public SessionList paging(@javax.annotation.Nonnull Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + */ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(@javax.annotation.Nonnull Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionList sessionList = (SessionList) o; + return Objects.equals(this.sessions, sessionList.sessions) && + Objects.equals(this.paging, sessionList.paging); + } + + @Override + public int hashCode() { + return Objects.hash(sessions, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionList {\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessions"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessions"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionList is not found in the empty JSON string", SessionList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("sessions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sessions` to be an array in the JSON string but got `%s`", jsonObj.get("sessions").toString())); + } + + JsonArray jsonArraysessions = jsonObj.getAsJsonArray("sessions"); + // validate the required field `sessions` (array) + for (int i = 0; i < jsonArraysessions.size(); i++) { + Session.validateJsonElement(jsonArraysessions.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionList given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionList + * @throws IOException if the JSON string is invalid with respect to SessionList + */ + public static SessionList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionList.class); + } + + /** + * Convert an instance of SessionList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionStatus.java b/src/main/java/com/corbado/generated/model/SessionStatus.java similarity index 71% rename from src/main/java/com/corbado/generated/model/LongSessionStatus.java rename to src/main/java/com/corbado/generated/model/SessionStatus.java index 4c36f82..c93ffd2 100644 --- a/src/main/java/com/corbado/generated/model/LongSessionStatus.java +++ b/src/main/java/com/corbado/generated/model/SessionStatus.java @@ -24,10 +24,10 @@ import com.google.gson.stream.JsonWriter; /** - * Gets or Sets longSessionStatus + * Gets or Sets sessionStatus */ -@JsonAdapter(LongSessionStatus.Adapter.class) -public enum LongSessionStatus { +@JsonAdapter(SessionStatus.Adapter.class) +public enum SessionStatus { ACTIVE("active"), @@ -41,7 +41,7 @@ public enum LongSessionStatus { private String value; - LongSessionStatus(String value) { + SessionStatus(String value) { this.value = value; } @@ -54,8 +54,8 @@ public String toString() { return String.valueOf(value); } - public static LongSessionStatus fromValue(String value) { - for (LongSessionStatus b : LongSessionStatus.values()) { + public static SessionStatus fromValue(String value) { + for (SessionStatus b : SessionStatus.values()) { if (b.value.equals(value)) { return b; } @@ -63,22 +63,22 @@ public static LongSessionStatus fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final LongSessionStatus enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final SessionStatus enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public LongSessionStatus read(final JsonReader jsonReader) throws IOException { + public SessionStatus read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return LongSessionStatus.fromValue(value); + return SessionStatus.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); - LongSessionStatus.fromValue(value); + SessionStatus.fromValue(value); } } diff --git a/src/main/java/com/corbado/generated/model/SocialAccount.java b/src/main/java/com/corbado/generated/model/SocialAccount.java index fcad5ea..3e9b0a7 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccount.java +++ b/src/main/java/com/corbado/generated/model/SocialAccount.java @@ -37,7 +37,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,40 +48,47 @@ /** * SocialAccount */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class SocialAccount { public static final String SERIALIZED_NAME_SOCIAL_ACCOUNT_I_D = "socialAccountID"; @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNT_I_D) + @javax.annotation.Nonnull private String socialAccountID; public static final String SERIALIZED_NAME_PROVIDER_TYPE = "providerType"; @SerializedName(SERIALIZED_NAME_PROVIDER_TYPE) + @javax.annotation.Nonnull private String providerType; public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + @javax.annotation.Nonnull private String identifierValue; public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_FOREIGN_I_D = "foreignID"; @SerializedName(SERIALIZED_NAME_FOREIGN_I_D) + @javax.annotation.Nonnull private String foreignID; public static final String SERIALIZED_NAME_AVATAR_U_R_L = "avatarURL"; @SerializedName(SERIALIZED_NAME_AVATAR_U_R_L) + @javax.annotation.Nonnull private String avatarURL; public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) + @javax.annotation.Nonnull private String fullName; public SocialAccount() { } - public SocialAccount socialAccountID(String socialAccountID) { + public SocialAccount socialAccountID(@javax.annotation.Nonnull String socialAccountID) { this.socialAccountID = socialAccountID; return this; } @@ -96,12 +102,12 @@ public String getSocialAccountID() { return socialAccountID; } - public void setSocialAccountID(String socialAccountID) { + public void setSocialAccountID(@javax.annotation.Nonnull String socialAccountID) { this.socialAccountID = socialAccountID; } - public SocialAccount providerType(String providerType) { + public SocialAccount providerType(@javax.annotation.Nonnull String providerType) { this.providerType = providerType; return this; } @@ -115,12 +121,12 @@ public String getProviderType() { return providerType; } - public void setProviderType(String providerType) { + public void setProviderType(@javax.annotation.Nonnull String providerType) { this.providerType = providerType; } - public SocialAccount identifierValue(String identifierValue) { + public SocialAccount identifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; return this; } @@ -134,12 +140,12 @@ public String getIdentifierValue() { return identifierValue; } - public void setIdentifierValue(String identifierValue) { + public void setIdentifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; } - public SocialAccount userID(String userID) { + public SocialAccount userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -153,12 +159,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public SocialAccount foreignID(String foreignID) { + public SocialAccount foreignID(@javax.annotation.Nonnull String foreignID) { this.foreignID = foreignID; return this; } @@ -172,12 +178,12 @@ public String getForeignID() { return foreignID; } - public void setForeignID(String foreignID) { + public void setForeignID(@javax.annotation.Nonnull String foreignID) { this.foreignID = foreignID; } - public SocialAccount avatarURL(String avatarURL) { + public SocialAccount avatarURL(@javax.annotation.Nonnull String avatarURL) { this.avatarURL = avatarURL; return this; } @@ -191,12 +197,12 @@ public String getAvatarURL() { return avatarURL; } - public void setAvatarURL(String avatarURL) { + public void setAvatarURL(@javax.annotation.Nonnull String avatarURL) { this.avatarURL = avatarURL; } - public SocialAccount fullName(String fullName) { + public SocialAccount fullName(@javax.annotation.Nonnull String fullName) { this.fullName = fullName; return this; } @@ -210,7 +216,7 @@ public String getFullName() { return fullName; } - public void setFullName(String fullName) { + public void setFullName(@javax.annotation.Nonnull String fullName) { this.fullName = fullName; } diff --git a/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java b/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java index 22ce26a..db98664 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java +++ b/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,32 +49,37 @@ /** * SocialAccountCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class SocialAccountCreateReq { public static final String SERIALIZED_NAME_PROVIDER_TYPE = "providerType"; @SerializedName(SERIALIZED_NAME_PROVIDER_TYPE) + @javax.annotation.Nonnull private SocialProviderType providerType; public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + @javax.annotation.Nonnull private String identifierValue; public static final String SERIALIZED_NAME_FOREIGN_I_D = "foreignID"; @SerializedName(SERIALIZED_NAME_FOREIGN_I_D) + @javax.annotation.Nonnull private String foreignID; public static final String SERIALIZED_NAME_AVATAR_U_R_L = "avatarURL"; @SerializedName(SERIALIZED_NAME_AVATAR_U_R_L) + @javax.annotation.Nonnull private String avatarURL; public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) + @javax.annotation.Nonnull private String fullName; public SocialAccountCreateReq() { } - public SocialAccountCreateReq providerType(SocialProviderType providerType) { + public SocialAccountCreateReq providerType(@javax.annotation.Nonnull SocialProviderType providerType) { this.providerType = providerType; return this; } @@ -89,12 +93,12 @@ public SocialProviderType getProviderType() { return providerType; } - public void setProviderType(SocialProviderType providerType) { + public void setProviderType(@javax.annotation.Nonnull SocialProviderType providerType) { this.providerType = providerType; } - public SocialAccountCreateReq identifierValue(String identifierValue) { + public SocialAccountCreateReq identifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; return this; } @@ -108,12 +112,12 @@ public String getIdentifierValue() { return identifierValue; } - public void setIdentifierValue(String identifierValue) { + public void setIdentifierValue(@javax.annotation.Nonnull String identifierValue) { this.identifierValue = identifierValue; } - public SocialAccountCreateReq foreignID(String foreignID) { + public SocialAccountCreateReq foreignID(@javax.annotation.Nonnull String foreignID) { this.foreignID = foreignID; return this; } @@ -127,12 +131,12 @@ public String getForeignID() { return foreignID; } - public void setForeignID(String foreignID) { + public void setForeignID(@javax.annotation.Nonnull String foreignID) { this.foreignID = foreignID; } - public SocialAccountCreateReq avatarURL(String avatarURL) { + public SocialAccountCreateReq avatarURL(@javax.annotation.Nonnull String avatarURL) { this.avatarURL = avatarURL; return this; } @@ -146,12 +150,12 @@ public String getAvatarURL() { return avatarURL; } - public void setAvatarURL(String avatarURL) { + public void setAvatarURL(@javax.annotation.Nonnull String avatarURL) { this.avatarURL = avatarURL; } - public SocialAccountCreateReq fullName(String fullName) { + public SocialAccountCreateReq fullName(@javax.annotation.Nonnull String fullName) { this.fullName = fullName; return this; } @@ -165,7 +169,7 @@ public String getFullName() { return fullName; } - public void setFullName(String fullName) { + public void setFullName(@javax.annotation.Nonnull String fullName) { this.fullName = fullName; } diff --git a/src/main/java/com/corbado/generated/model/SocialAccountList.java b/src/main/java/com/corbado/generated/model/SocialAccountList.java index 1b9f92e..a733552 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccountList.java +++ b/src/main/java/com/corbado/generated/model/SocialAccountList.java @@ -41,7 +41,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -53,20 +52,22 @@ /** * SocialAccountList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class SocialAccountList { public static final String SERIALIZED_NAME_SOCIAL_ACCOUNTS = "socialAccounts"; @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNTS) + @javax.annotation.Nonnull private List socialAccounts = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGING = "paging"; @SerializedName(SERIALIZED_NAME_PAGING) + @javax.annotation.Nonnull private Paging paging; public SocialAccountList() { } - public SocialAccountList socialAccounts(List socialAccounts) { + public SocialAccountList socialAccounts(@javax.annotation.Nonnull List socialAccounts) { this.socialAccounts = socialAccounts; return this; } @@ -88,12 +89,12 @@ public List getSocialAccounts() { return socialAccounts; } - public void setSocialAccounts(List socialAccounts) { + public void setSocialAccounts(@javax.annotation.Nonnull List socialAccounts) { this.socialAccounts = socialAccounts; } - public SocialAccountList paging(Paging paging) { + public SocialAccountList paging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; return this; } @@ -107,7 +108,7 @@ public Paging getPaging() { return paging; } - public void setPaging(Paging paging) { + public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } diff --git a/src/main/java/com/corbado/generated/model/User.java b/src/main/java/com/corbado/generated/model/User.java index f8ac423..6efaf2c 100644 --- a/src/main/java/com/corbado/generated/model/User.java +++ b/src/main/java/com/corbado/generated/model/User.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,28 +49,32 @@ /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class User { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) + @javax.annotation.Nonnull private String userID; public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) + @javax.annotation.Nullable private String fullName; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private UserStatus status; public static final String SERIALIZED_NAME_EXPLICIT_WEBAUTHN_I_D = "explicitWebauthnID"; @SerializedName(SERIALIZED_NAME_EXPLICIT_WEBAUTHN_I_D) + @javax.annotation.Nullable private String explicitWebauthnID; public User() { } - public User userID(String userID) { + public User userID(@javax.annotation.Nonnull String userID) { this.userID = userID; return this; } @@ -85,12 +88,12 @@ public String getUserID() { return userID; } - public void setUserID(String userID) { + public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } - public User fullName(String fullName) { + public User fullName(@javax.annotation.Nullable String fullName) { this.fullName = fullName; return this; } @@ -104,12 +107,12 @@ public String getFullName() { return fullName; } - public void setFullName(String fullName) { + public void setFullName(@javax.annotation.Nullable String fullName) { this.fullName = fullName; } - public User status(UserStatus status) { + public User status(@javax.annotation.Nonnull UserStatus status) { this.status = status; return this; } @@ -123,12 +126,12 @@ public UserStatus getStatus() { return status; } - public void setStatus(UserStatus status) { + public void setStatus(@javax.annotation.Nonnull UserStatus status) { this.status = status; } - public User explicitWebauthnID(String explicitWebauthnID) { + public User explicitWebauthnID(@javax.annotation.Nullable String explicitWebauthnID) { this.explicitWebauthnID = explicitWebauthnID; return this; } @@ -142,7 +145,7 @@ public String getExplicitWebauthnID() { return explicitWebauthnID; } - public void setExplicitWebauthnID(String explicitWebauthnID) { + public void setExplicitWebauthnID(@javax.annotation.Nullable String explicitWebauthnID) { this.explicitWebauthnID = explicitWebauthnID; } diff --git a/src/main/java/com/corbado/generated/model/UserCreateReq.java b/src/main/java/com/corbado/generated/model/UserCreateReq.java index 8ffa903..78d3fbb 100644 --- a/src/main/java/com/corbado/generated/model/UserCreateReq.java +++ b/src/main/java/com/corbado/generated/model/UserCreateReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,24 +49,27 @@ /** * UserCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class UserCreateReq { public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) + @javax.annotation.Nullable private String fullName; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull private UserStatus status; public static final String SERIALIZED_NAME_EXPLICIT_WEBAUTHN_I_D = "explicitWebauthnID"; @SerializedName(SERIALIZED_NAME_EXPLICIT_WEBAUTHN_I_D) + @javax.annotation.Nullable private String explicitWebauthnID; public UserCreateReq() { } - public UserCreateReq fullName(String fullName) { + public UserCreateReq fullName(@javax.annotation.Nullable String fullName) { this.fullName = fullName; return this; } @@ -81,12 +83,12 @@ public String getFullName() { return fullName; } - public void setFullName(String fullName) { + public void setFullName(@javax.annotation.Nullable String fullName) { this.fullName = fullName; } - public UserCreateReq status(UserStatus status) { + public UserCreateReq status(@javax.annotation.Nonnull UserStatus status) { this.status = status; return this; } @@ -100,12 +102,12 @@ public UserStatus getStatus() { return status; } - public void setStatus(UserStatus status) { + public void setStatus(@javax.annotation.Nonnull UserStatus status) { this.status = status; } - public UserCreateReq explicitWebauthnID(String explicitWebauthnID) { + public UserCreateReq explicitWebauthnID(@javax.annotation.Nullable String explicitWebauthnID) { this.explicitWebauthnID = explicitWebauthnID; return this; } @@ -119,7 +121,7 @@ public String getExplicitWebauthnID() { return explicitWebauthnID; } - public void setExplicitWebauthnID(String explicitWebauthnID) { + public void setExplicitWebauthnID(@javax.annotation.Nullable String explicitWebauthnID) { this.explicitWebauthnID = explicitWebauthnID; } diff --git a/src/main/java/com/corbado/generated/model/UserUpdateReq.java b/src/main/java/com/corbado/generated/model/UserUpdateReq.java index a9caf55..8bb903e 100644 --- a/src/main/java/com/corbado/generated/model/UserUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/UserUpdateReq.java @@ -38,7 +38,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,20 +49,22 @@ /** * UserUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") public class UserUpdateReq { public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) + @javax.annotation.Nullable private String fullName; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private UserStatus status; public UserUpdateReq() { } - public UserUpdateReq fullName(String fullName) { + public UserUpdateReq fullName(@javax.annotation.Nullable String fullName) { this.fullName = fullName; return this; } @@ -77,12 +78,12 @@ public String getFullName() { return fullName; } - public void setFullName(String fullName) { + public void setFullName(@javax.annotation.Nullable String fullName) { this.fullName = fullName; } - public UserUpdateReq status(UserStatus status) { + public UserUpdateReq status(@javax.annotation.Nullable UserStatus status) { this.status = status; return this; } @@ -96,7 +97,7 @@ public UserStatus getStatus() { return status; } - public void setStatus(UserStatus status) { + public void setStatus(@javax.annotation.Nullable UserStatus status) { this.status = status; } diff --git a/src/main/java/com/corbado/generated/model/WebhookEndpoint.java b/src/main/java/com/corbado/generated/model/WebhookEndpoint.java new file mode 100644 index 0000000..caf54fd --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebhookEndpoint.java @@ -0,0 +1,436 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.WebhookEventType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebhookEndpoint + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class WebhookEndpoint { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull + private String url; + + public static final String SERIALIZED_NAME_CUSTOM_HEADERS = "customHeaders"; + @SerializedName(SERIALIZED_NAME_CUSTOM_HEADERS) + @javax.annotation.Nonnull + private Object customHeaders; + + public static final String SERIALIZED_NAME_SUBSCRIBED_EVENTS = "subscribedEvents"; + @SerializedName(SERIALIZED_NAME_SUBSCRIBED_EVENTS) + @javax.annotation.Nonnull + private List subscribedEvents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nonnull + private String created; + + public static final String SERIALIZED_NAME_CREATED_MS = "createdMs"; + @SerializedName(SERIALIZED_NAME_CREATED_MS) + @javax.annotation.Nonnull + private Long createdMs; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + @javax.annotation.Nonnull + private String updated; + + public static final String SERIALIZED_NAME_UPDATED_MS = "updatedMs"; + @SerializedName(SERIALIZED_NAME_UPDATED_MS) + @javax.annotation.Nonnull + private Long updatedMs; + + public WebhookEndpoint() { + } + + public WebhookEndpoint id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public WebhookEndpoint url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + + public WebhookEndpoint customHeaders(@javax.annotation.Nonnull Object customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get customHeaders + * @return customHeaders + */ + @javax.annotation.Nonnull + public Object getCustomHeaders() { + return customHeaders; + } + + public void setCustomHeaders(@javax.annotation.Nonnull Object customHeaders) { + this.customHeaders = customHeaders; + } + + + public WebhookEndpoint subscribedEvents(@javax.annotation.Nonnull List subscribedEvents) { + this.subscribedEvents = subscribedEvents; + return this; + } + + public WebhookEndpoint addSubscribedEventsItem(WebhookEventType subscribedEventsItem) { + if (this.subscribedEvents == null) { + this.subscribedEvents = new ArrayList<>(); + } + this.subscribedEvents.add(subscribedEventsItem); + return this; + } + + /** + * Get subscribedEvents + * @return subscribedEvents + */ + @javax.annotation.Nonnull + public List getSubscribedEvents() { + return subscribedEvents; + } + + public void setSubscribedEvents(@javax.annotation.Nonnull List subscribedEvents) { + this.subscribedEvents = subscribedEvents; + } + + + public WebhookEndpoint created(@javax.annotation.Nonnull String created) { + this.created = created; + return this; + } + + /** + * Get created + * @return created + */ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nonnull String created) { + this.created = created; + } + + + public WebhookEndpoint createdMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + return this; + } + + /** + * Get createdMs + * @return createdMs + */ + @javax.annotation.Nonnull + public Long getCreatedMs() { + return createdMs; + } + + public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { + this.createdMs = createdMs; + } + + + public WebhookEndpoint updated(@javax.annotation.Nonnull String updated) { + this.updated = updated; + return this; + } + + /** + * Get updated + * @return updated + */ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(@javax.annotation.Nonnull String updated) { + this.updated = updated; + } + + + public WebhookEndpoint updatedMs(@javax.annotation.Nonnull Long updatedMs) { + this.updatedMs = updatedMs; + return this; + } + + /** + * Get updatedMs + * @return updatedMs + */ + @javax.annotation.Nonnull + public Long getUpdatedMs() { + return updatedMs; + } + + public void setUpdatedMs(@javax.annotation.Nonnull Long updatedMs) { + this.updatedMs = updatedMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookEndpoint webhookEndpoint = (WebhookEndpoint) o; + return Objects.equals(this.id, webhookEndpoint.id) && + Objects.equals(this.url, webhookEndpoint.url) && + Objects.equals(this.customHeaders, webhookEndpoint.customHeaders) && + Objects.equals(this.subscribedEvents, webhookEndpoint.subscribedEvents) && + Objects.equals(this.created, webhookEndpoint.created) && + Objects.equals(this.createdMs, webhookEndpoint.createdMs) && + Objects.equals(this.updated, webhookEndpoint.updated) && + Objects.equals(this.updatedMs, webhookEndpoint.updatedMs); + } + + @Override + public int hashCode() { + return Objects.hash(id, url, customHeaders, subscribedEvents, created, createdMs, updated, updatedMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookEndpoint {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" customHeaders: ").append(toIndentedString(customHeaders)).append("\n"); + sb.append(" subscribedEvents: ").append(toIndentedString(subscribedEvents)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" updatedMs: ").append(toIndentedString(updatedMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("url"); + openapiFields.add("customHeaders"); + openapiFields.add("subscribedEvents"); + openapiFields.add("created"); + openapiFields.add("createdMs"); + openapiFields.add("updated"); + openapiFields.add("updatedMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("url"); + openapiRequiredFields.add("customHeaders"); + openapiRequiredFields.add("subscribedEvents"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("createdMs"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("updatedMs"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookEndpoint + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookEndpoint.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookEndpoint is not found in the empty JSON string", WebhookEndpoint.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookEndpoint.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookEndpoint` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookEndpoint.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + // ensure the required json array is present + if (jsonObj.get("subscribedEvents") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("subscribedEvents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscribedEvents` to be an array in the JSON string but got `%s`", jsonObj.get("subscribedEvents").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookEndpoint.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookEndpoint' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookEndpoint.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookEndpoint value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookEndpoint read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookEndpoint given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookEndpoint + * @throws IOException if the JSON string is invalid with respect to WebhookEndpoint + */ + public static WebhookEndpoint fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookEndpoint.class); + } + + /** + * Convert an instance of WebhookEndpoint to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebhookEndpointCreateReq.java b/src/main/java/com/corbado/generated/model/WebhookEndpointCreateReq.java new file mode 100644 index 0000000..fee823f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebhookEndpointCreateReq.java @@ -0,0 +1,287 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.WebhookEventType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebhookEndpointCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class WebhookEndpointCreateReq { + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull + private String url; + + public static final String SERIALIZED_NAME_SUBSCRIBED_EVENTS = "subscribedEvents"; + @SerializedName(SERIALIZED_NAME_SUBSCRIBED_EVENTS) + @javax.annotation.Nonnull + private List subscribedEvents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CUSTOM_HEADERS = "customHeaders"; + @SerializedName(SERIALIZED_NAME_CUSTOM_HEADERS) + @javax.annotation.Nonnull + private Object customHeaders; + + public WebhookEndpointCreateReq() { + } + + public WebhookEndpointCreateReq url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + + public WebhookEndpointCreateReq subscribedEvents(@javax.annotation.Nonnull List subscribedEvents) { + this.subscribedEvents = subscribedEvents; + return this; + } + + public WebhookEndpointCreateReq addSubscribedEventsItem(WebhookEventType subscribedEventsItem) { + if (this.subscribedEvents == null) { + this.subscribedEvents = new ArrayList<>(); + } + this.subscribedEvents.add(subscribedEventsItem); + return this; + } + + /** + * Get subscribedEvents + * @return subscribedEvents + */ + @javax.annotation.Nonnull + public List getSubscribedEvents() { + return subscribedEvents; + } + + public void setSubscribedEvents(@javax.annotation.Nonnull List subscribedEvents) { + this.subscribedEvents = subscribedEvents; + } + + + public WebhookEndpointCreateReq customHeaders(@javax.annotation.Nonnull Object customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get customHeaders + * @return customHeaders + */ + @javax.annotation.Nonnull + public Object getCustomHeaders() { + return customHeaders; + } + + public void setCustomHeaders(@javax.annotation.Nonnull Object customHeaders) { + this.customHeaders = customHeaders; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookEndpointCreateReq webhookEndpointCreateReq = (WebhookEndpointCreateReq) o; + return Objects.equals(this.url, webhookEndpointCreateReq.url) && + Objects.equals(this.subscribedEvents, webhookEndpointCreateReq.subscribedEvents) && + Objects.equals(this.customHeaders, webhookEndpointCreateReq.customHeaders); + } + + @Override + public int hashCode() { + return Objects.hash(url, subscribedEvents, customHeaders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookEndpointCreateReq {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" subscribedEvents: ").append(toIndentedString(subscribedEvents)).append("\n"); + sb.append(" customHeaders: ").append(toIndentedString(customHeaders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("url"); + openapiFields.add("subscribedEvents"); + openapiFields.add("customHeaders"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("url"); + openapiRequiredFields.add("subscribedEvents"); + openapiRequiredFields.add("customHeaders"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookEndpointCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookEndpointCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookEndpointCreateReq is not found in the empty JSON string", WebhookEndpointCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookEndpointCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookEndpointCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookEndpointCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + // ensure the required json array is present + if (jsonObj.get("subscribedEvents") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("subscribedEvents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscribedEvents` to be an array in the JSON string but got `%s`", jsonObj.get("subscribedEvents").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookEndpointCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookEndpointCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookEndpointCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookEndpointCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookEndpointCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookEndpointCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookEndpointCreateReq + * @throws IOException if the JSON string is invalid with respect to WebhookEndpointCreateReq + */ + public static WebhookEndpointCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookEndpointCreateReq.class); + } + + /** + * Convert an instance of WebhookEndpointCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebhookEndpointList.java b/src/main/java/com/corbado/generated/model/WebhookEndpointList.java new file mode 100644 index 0000000..fa0123c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebhookEndpointList.java @@ -0,0 +1,232 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.WebhookEndpoint; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebhookEndpointList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-02-08T15:52:19.373962904Z[Etc/UTC]", comments = "Generator version: 7.12.0-SNAPSHOT") +public class WebhookEndpointList { + public static final String SERIALIZED_NAME_WEBHOOK_ENDPOINTS = "webhookEndpoints"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_ENDPOINTS) + @javax.annotation.Nonnull + private List webhookEndpoints = new ArrayList<>(); + + public WebhookEndpointList() { + } + + public WebhookEndpointList webhookEndpoints(@javax.annotation.Nonnull List webhookEndpoints) { + this.webhookEndpoints = webhookEndpoints; + return this; + } + + public WebhookEndpointList addWebhookEndpointsItem(WebhookEndpoint webhookEndpointsItem) { + if (this.webhookEndpoints == null) { + this.webhookEndpoints = new ArrayList<>(); + } + this.webhookEndpoints.add(webhookEndpointsItem); + return this; + } + + /** + * Get webhookEndpoints + * @return webhookEndpoints + */ + @javax.annotation.Nonnull + public List getWebhookEndpoints() { + return webhookEndpoints; + } + + public void setWebhookEndpoints(@javax.annotation.Nonnull List webhookEndpoints) { + this.webhookEndpoints = webhookEndpoints; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookEndpointList webhookEndpointList = (WebhookEndpointList) o; + return Objects.equals(this.webhookEndpoints, webhookEndpointList.webhookEndpoints); + } + + @Override + public int hashCode() { + return Objects.hash(webhookEndpoints); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookEndpointList {\n"); + sb.append(" webhookEndpoints: ").append(toIndentedString(webhookEndpoints)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("webhookEndpoints"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("webhookEndpoints"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookEndpointList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookEndpointList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookEndpointList is not found in the empty JSON string", WebhookEndpointList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookEndpointList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookEndpointList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookEndpointList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("webhookEndpoints").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookEndpoints` to be an array in the JSON string but got `%s`", jsonObj.get("webhookEndpoints").toString())); + } + + JsonArray jsonArraywebhookEndpoints = jsonObj.getAsJsonArray("webhookEndpoints"); + // validate the required field `webhookEndpoints` (array) + for (int i = 0; i < jsonArraywebhookEndpoints.size(); i++) { + WebhookEndpoint.validateJsonElement(jsonArraywebhookEndpoints.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookEndpointList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookEndpointList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookEndpointList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookEndpointList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookEndpointList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookEndpointList given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookEndpointList + * @throws IOException if the JSON string is invalid with respect to WebhookEndpointList + */ + public static WebhookEndpointList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookEndpointList.class); + } + + /** + * Convert an instance of WebhookEndpointList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AppType.java b/src/main/java/com/corbado/generated/model/WebhookEventType.java similarity index 65% rename from src/main/java/com/corbado/generated/model/AppType.java rename to src/main/java/com/corbado/generated/model/WebhookEventType.java index 5f208e9..9556525 100644 --- a/src/main/java/com/corbado/generated/model/AppType.java +++ b/src/main/java/com/corbado/generated/model/WebhookEventType.java @@ -24,20 +24,20 @@ import com.google.gson.stream.JsonWriter; /** - * Application type + * Gets or Sets webhookEventType */ -@JsonAdapter(AppType.Adapter.class) -public enum AppType { +@JsonAdapter(WebhookEventType.Adapter.class) +public enum WebhookEventType { - EMPTY("empty"), + PASSKEY_LOGIN_COMPLETED("passkey-login.completed"), - WEB("web"), + PASSKEY_CREATED("passkey.created"), - NATIVE("native"); + PASSKEY_DELETED("passkey.deleted"); private String value; - AppType(String value) { + WebhookEventType(String value) { this.value = value; } @@ -50,8 +50,8 @@ public String toString() { return String.valueOf(value); } - public static AppType fromValue(String value) { - for (AppType b : AppType.values()) { + public static WebhookEventType fromValue(String value) { + for (WebhookEventType b : WebhookEventType.values()) { if (b.value.equals(value)) { return b; } @@ -59,22 +59,22 @@ public static AppType fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final AppType enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final WebhookEventType enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public AppType read(final JsonReader jsonReader) throws IOException { + public WebhookEventType read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return AppType.fromValue(value); + return WebhookEventType.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); - AppType.fromValue(value); + WebhookEventType.fromValue(value); } } diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java index ba279e8..adf7337 100644 --- a/src/main/java/com/corbado/sdk/Config.java +++ b/src/main/java/com/corbado/sdk/Config.java @@ -2,103 +2,85 @@ import java.net.MalformedURLException; import java.net.URL; -import org.apache.commons.lang3.StringUtils; import lombok.Builder; import lombok.Getter; import lombok.NonNull; import lombok.Setter; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; /** - * Configuration class for setting up project parameters. + * Configuration class for setting up project parameters in the Corbado SDK. + * + *

This class encapsulates all configuration details required to initialize and use the Corbado + * SDK, including project identification, API credentials, and service endpoints. It provides + * validation for these fields and computes derived properties like frontend API URL and issuer. + * + *

The configuration supports: + * + *

    + *
  • Project identification with project ID and API secret + *
  • Custom API endpoints for frontend and backend services + *
  • Session token configuration + *
  • Custom domain (CNAME) support + *
  • JWKS caching configuration + *
* - *

This class encapsulates project configuration details including project ID, API secret, - * backend API URL, and other parameters. It provides validation for these fields and computes - * derived properties like frontend API URL and issuer. + *

All mandatory fields are validated during initialization to ensure proper SDK operation. + * + * @see com.corbado.sdk.CorbadoSdk + * @see com.corbado.services.SessionService */ @Slf4j @Builder public class Config { - /** The Constant HTTPS prefix. */ + /** The HTTPS protocol prefix used for secure connections. */ private static final String HTTPS = "https://"; - // Fields - - /** The Constant API_VERSION. */ + /** The current version of the Corbado API. */ private static final String API_VERSION = "2"; - /** API secret must begin with this prefix. */ + /** The required prefix for API secrets. */ private static final String API_SERCRET_PREFIX = "corbado1_"; - /** Project Id must begin with this prefix. */ + /** The required prefix for project IDs. */ private static final String PROJECT_ID_PREFIX = "pro-"; - /** The project id with custom setter. Must be provided. */ + // ---------- Mandatory fields ---------- + /** The project ID used to identify the project in the Corbado system. Must start with "pro-". */ @NonNull @Getter private String projectId; - /** The api secret with custom setter. Must be provided. */ + /** The API secret used for authentication. Must start with "corbado1_". */ @NonNull @Getter private String apiSecret; - /** The backend api with custom setter. Default value: "https://backendapi.cloud.corbado.io/v2" */ - @Getter @Builder.Default private String backendApi = "https://backendapi.cloud.corbado.io/v2"; - - /** The short session cookie name. Default value: "cbo_short_session" */ - @Getter @Setter @Builder.Default private String shortSessionCookieName = "cbo_short_session"; - - /** The issuer. Used for session verification. */ - @Getter @Setter private String issuer; - - /** The frontend api with custom setter. */ + /** The frontend API endpoint URL. Used for client-side operations. */ @Getter private String frontendApi; - /** The short session length for session service. Default = 300. */ - @Getter @Setter @Builder.Default private Integer shortSessionLength = 300; - - /** Flag to cache keys in session service. Default = true. */ - @Getter @Setter @Builder.Default private boolean cacheKeys = true; + /** The backend API endpoint URL. Used for server-side operations. */ + @Getter private String backendApi; - /** The cname. Replaces issuer field if present. */ - @Getter @Setter private String cname; + // ---------- Non-mandatory fields ---------- + /** The issuer URL used for session verification. Defaults to frontend API if not specified. */ + @Getter @Setter private String issuer; - // Constructors /** - * Instantiates a new config. - * - * @param projectId the project id - * @param apiSecret the api secret + * The lifetime duration for session service tokens in seconds. Defaults to 300 seconds (5 + * minutes). */ - public Config(@NonNull final String projectId, @NonNull final String apiSecret) { + @Getter @Setter @Builder.Default private Integer sessionTokenLength = 300; - setProjectId(projectId); // set and validate - setApiSecret(apiSecret); - - // default values - setFrontendApi(projectId); - setIssuer(this.frontendApi); - } + /** Whether to cache JWKS keys in the session service. Defaults to true for better performance. */ + @Getter @Setter @Builder.Default private boolean cacheKeys = true; - /** - * Instantiates a new config. - * - * @param projectId the project id - * @param apiSecret the api secret - * @param backendApi the backend api - */ - public Config( - @NonNull final String projectId, - @NonNull final String apiSecret, - @NonNull final String backendApi) { - this(projectId, apiSecret); - setBackendApi(backendApi); - } + /** The custom domain (CNAME) that replaces the issuer field if present. */ + @Getter @Setter private String cname; - // Custom Getters and Setters /** - * Sets the api secret. + * Sets the API secret with validation. * - * @param apiSecret the new api secret - * @throws IllegalArgumentException If the API secret does not start with "corbado1_". + * @param apiSecret the new API secret to set + * @throws IllegalArgumentException if the API secret is null or doesn't start with "corbado1_" */ public void setApiSecret(String apiSecret) { apiSecret = StringUtils.trim(apiSecret); @@ -110,10 +92,10 @@ public void setApiSecret(String apiSecret) { } /** - * Sets the backend api. + * Sets the backend API URL with validation and version suffix. * - * @param backendApi the new backend api - * @throws IllegalArgumentException If the URL is invalid. + * @param backendApi the new backend API URL to set + * @throws IllegalArgumentException if the URL is invalid */ public void setBackendApi(String backendApi) { backendApi = StringUtils.trim(backendApi); @@ -129,15 +111,13 @@ public void setBackendApi(String backendApi) { } /** - * Sets the frontend api. + * Sets the frontend API URL with validation. * - * @param frontendApi the new frontend api - * @throws IllegalArgumentException If the URL is invalid. + * @param frontendApi the new frontend API URL to set + * @throws IllegalArgumentException if the URL is invalid */ public void setFrontendApi(String frontendApi) { frontendApi = StringUtils.trim(frontendApi); - frontendApi = StringUtils.prependIfMissing(frontendApi, HTTPS); - frontendApi = StringUtils.appendIfMissing(frontendApi, ".frontendapi.corbado.io"); try { new URL(frontendApi); // Validate URL syntax @@ -148,10 +128,10 @@ public void setFrontendApi(String frontendApi) { } /** - * Sets the project id. + * Sets the project ID with validation. * - * @param projectId the new project id - * @throws IllegalArgumentException If the project Id does not start with "pro-". + * @param projectId the new project ID to set + * @throws IllegalArgumentException if the project ID is null or doesn't start with "pro-" */ public void setProjectId(@NonNull String projectId) { projectId = StringUtils.trim(projectId); @@ -163,39 +143,42 @@ public void setProjectId(@NonNull String projectId) { } /** - * Instantiates a new config. + * Constructs a new Config instance with all parameters. + * + *

This constructor initializes all configuration fields and performs necessary validations. + * The issuer is set based on the following priority: + * + *

    + *
  1. CNAME if provided + *
  2. Explicit issuer if provided + *
  3. Frontend API URL as fallback + *
* - * @param projectId the project id - * @param apiSecret the api secret - * @param backendApi the backend api - * @param shortSessionCookieName the short session cookie name - * @param issuer the issuer - * @param frontendApi the frontend api - * @param shortSessionLength the short session length - * @param cacheKeys the cache keys - * @param cname the cname + * @param projectId the project ID (required) + * @param apiSecret the API secret (required) + * @param frontendApi the frontend API URL (optional) + * @param backendApi the backend API URL (optional) + * @param issuer the issuer URL (optional) + * @param sessionTokenLength the session token lifetime in seconds (optional) + * @param cacheKeys whether to cache JWKS keys (optional) + * @param cname the custom domain (optional) + * @throws IllegalArgumentException if any required field validation fails */ public Config( - @NonNull final String projectId, - @NonNull final String apiSecret, - final String backendApi, - final String shortSessionCookieName, - final String issuer, - final String frontendApi, - final Integer shortSessionLength, - final boolean cacheKeys, + @NonNull String projectId, + @NonNull String apiSecret, + String frontendApi, + String backendApi, + String issuer, + Integer sessionTokenLength, + boolean cacheKeys, String cname) { - setProjectId(projectId); setApiSecret(apiSecret); setBackendApi(backendApi); - setShortSessionCookieName(shortSessionCookieName); - if (StringUtils.isEmpty(frontendApi)) { - setFrontendApi(projectId); - } else { - setFrontendApi(frontendApi); - } - setShortSessionLength(shortSessionLength); + setFrontendApi(frontendApi); + + setSessionTokenLength(sessionTokenLength); setCacheKeys(cacheKeys); setCname(cname); diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index 5fd74ff..27f1547 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -1,8 +1,5 @@ package com.corbado.sdk; -import java.util.HashMap; -import java.util.Map; - import com.corbado.exceptions.StandardException; import com.corbado.generated.api.IdentifiersApi; import com.corbado.generated.api.UsersApi; @@ -12,47 +9,72 @@ import com.corbado.services.UserService; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; - +import java.util.HashMap; +import java.util.Map; import lombok.Getter; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; /** - * Entry point for the Corbado SDK. + * Main entry point for the Corbado SDK. + * + *

This class serves as the central hub for interacting with the Corbado authentication system. + * It provides access to all major services including user management, session handling, and + * identifier management. + * + *

The SDK supports: * - *

This class provides interfaces to interact with the Corbado API, including user, session and - * identifier services. + *

    + *
  • User management (creation, retrieval, deletion) + *
  • Session handling and validation + *
  • Login identifier management + *
  • Automatic API client configuration + *
  • Version tracking and reporting + *
+ * + *

It automatically handles API client initialization, authentication, and service management. + * + * @see com.corbado.services.UserService + * @see com.corbado.services.SessionService + * @see com.corbado.services.IdentifierService + * @see com.corbado.sdk.Config */ @Slf4j public class CorbadoSdk { - /** The Constant CORBADO_HEADER_NAME. */ + /** The current version of the SDK. */ + private static final String CURRENT_SDK_VERSION = "2.0.0b"; + + /** The header name used to identify SDK requests. */ private static final String CORBADO_HEADER_NAME = "X-Corbado-SDK"; - /** The configuration class. */ + /** The configuration instance containing all SDK settings. */ @Getter private final Config config; - /** The users API. */ + /** The user management service. Lazily initialized. */ @Getter(lazy = true) private final UserService users = new UserService(new UsersApi(this.client)); - /** The identifiers API. */ + /** The identifier management service. Lazily initialized. */ @Getter(lazy = true) private final IdentifierService identifiers = new IdentifierService(new IdentifiersApi(this.client)); - /** The sessions API. */ + /** The session management service. Lazily initialized. */ @Getter(lazy = true) private final SessionService sessions = new SessionService(this.config); - /** The client. */ + /** The API client used for making requests to the Corbado backend. */ private ApiClient client; /** - * Instantiates a new corbado sdk. + * Constructs a new CorbadoSdk instance with the specified configuration. + * + *

This constructor initializes the SDK with the provided configuration and sets up the API + * client with proper authentication and headers. * - * @param config the config - * @throws StandardException the standard exception + * @param config the configuration object containing all necessary settings + * @throws StandardException if there is an error initializing the API client */ public CorbadoSdk(final @NonNull Config config) throws StandardException { this.config = config; @@ -60,9 +82,18 @@ public CorbadoSdk(final @NonNull Config config) throws StandardException { } /** - * Initialize client. + * Initializes the API client with proper configuration and headers. * - * @throws StandardException the standard exception + *

This method sets up the API client with: + * + *

    + *
  • Base URL from configuration + *
  • Authentication credentials + *
  • SDK version information + *
  • Language version information + *
+ * + * @throws StandardException if there is an error setting up the API clients */ private void initializeClient() throws StandardException { final ApiClient tempClient = new ApiClient(); @@ -87,23 +118,25 @@ private void initializeClient() throws StandardException { this.client = tempClient; } - // Getters - /** - * Gets the language version. + * Gets the current Java runtime version. + * + *

This method retrieves the Java version from the system properties. In the extremely unlikely + * case that the "java.version" property is not set, it will return "unknown" instead of null. * - * @return the language version + * @return the Java version string, or "unknown" if the version cannot be determined */ private static String getLanguageVersion() { - return System.getProperty("java.version"); + final String version = System.getProperty("java.version"); + return version != null ? version : "unknown"; } /** - * Gets the version. + * Gets the current version of the SDK. * - * @return the version + * @return the SDK version string */ - public String getVersion() { - return "1.0.4"; + public static String getVersion() { + return CURRENT_SDK_VERSION; } } diff --git a/src/main/java/com/corbado/services/IdentifierService.java b/src/main/java/com/corbado/services/IdentifierService.java index fb163db..9723ad1 100644 --- a/src/main/java/com/corbado/services/IdentifierService.java +++ b/src/main/java/com/corbado/services/IdentifierService.java @@ -18,61 +18,91 @@ import javax.annotation.Nullable; import lombok.NonNull; -/** This class provides functionality for managing login identifiers. */ +/** + * Service class responsible for managing user login identifiers in the Corbado system. This class + * provides functionality for creating, updating, and managing various types of login identifiers + * (email, phone, username) associated with user accounts. + * + *

The service supports: + * + *

    + *
  • Creation of new login identifiers + *
  • Status management of identifiers (pending, verified, primary) + *
  • Listing and filtering of identifiers + *
  • Pagination support for large result sets + *
  • Deletion of identifiers + *
+ * + *

This service is typically used in conjunction with the UserService to manage the various ways + * users can authenticate with the system. + * + * @see com.corbado.generated.model.Identifier + * @see com.corbado.generated.model.IdentifierType + * @see com.corbado.generated.model.IdentifierStatus + * @see com.corbado.exceptions.CorbadoServerException + */ public class IdentifierService extends ApiService { - /** The user id prefix. */ + /** The prefix used for user IDs in the system. */ private static String USER_ID_PREFIX = "usr-"; /** - * Instantiates a new identifier service. + * Constructs a new IdentifierService with the specified API client. * - * @param client the client + * @param client the IdentifiersApi client for making requests to the Corbado backend */ public IdentifierService(final IdentifiersApi client) { super(client); } /** - * Create a new login identifier. + * Creates a new login identifier for a user. * - * @param userID ID of user (required) - * @param identifierCreateReq - * @return Identifier - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + *

This method creates an identifier with: + * + *

    + *
  • A specific type (email, phone, username) + *
  • A value (the actual identifier) + *
  • A status (pending, verified, primary) + *
+ * + * @param userID the ID of the user to create the identifier for + * @param identifierCreateReq the request containing identifier details + * @return the created identifier + * @throws CorbadoServerException if any server-side error occurs during creation */ public Identifier create( @NonNull final String userID, @NonNull final IdentifierCreateReq identifierCreateReq) throws CorbadoServerException { + // Validate required fields Objects.requireNonNull( identifierCreateReq.getIdentifierType(), - "Required field 'IdentifierCreateReq.identifierType' in 'identifierCreateReq' cannot be null\""); + "Required field 'IdentifierCreateReq.identifierType' in" + + " 'identifierCreateReq' cannot be null\""); Objects.requireNonNull( identifierCreateReq.getIdentifierValue(), - "Required field 'IdentifierCreateReq.identifierValue' in 'identifierCreateReq' cannot be null\""); + "Required field 'IdentifierCreateReq.identifierValue' in" + + " 'identifierCreateReq' cannot be null\""); Objects.requireNonNull( identifierCreateReq.getStatus(), "Required field 'IdentifierCreateReq.status' in 'identifierCreateReq' cannot be null\""); try { - return client.identifierCreate(userID, identifierCreateReq); - // client.identifierList(userID, null, null, null) + return this.client.identifierCreate(userID, identifierCreateReq); } catch (final ApiException e) { throw new CorbadoServerException(e); } } /** - * Returns a list of matching identifiers + * Returns a paginated list of identifiers with optional filtering and sorting. * - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return IdentifierList list of matching identifiers - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + * @param sort field to sort by (optional) + * @param filter list of filter criteria (optional) + * @param page page number (optional, defaults to 1) + * @param pageSize number of items per page (optional, defaults to 10) + * @return a list of matching identifiers with pagination information + * @throws CorbadoServerException if any server-side error occurs during retrieval */ public IdentifierList list( @Nullable final String sort, @@ -81,20 +111,19 @@ public IdentifierList list( @Nullable final Integer pageSize) throws CorbadoServerException { try { - return client.identifierList(sort, filter, page, pageSize); + return this.client.identifierList(sort, filter, page, pageSize); } catch (final ApiException e) { throw new CorbadoServerException(e); } } /** - * Returns a list of matching identifiers + * Returns a paginated list of all identifiers without filtering. * - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return IdentifierList list of matching identifiers - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + * @param page page number (optional, defaults to 1) + * @param pageSize number of items per page (optional, defaults to 10) + * @return a list of all identifiers with pagination information + * @throws CorbadoServerException if any server-side error occurs during retrieval */ public IdentifierList listAllWithPaging( @Nullable final Integer page, @Nullable final Integer pageSize) @@ -103,12 +132,12 @@ public IdentifierList listAllWithPaging( } /** - * Gets the by value and type. + * Retrieves identifiers matching a specific value and type. * - * @param value the value - * @param type the type - * @return the by value and type - * @throws CorbadoServerException the corbado server exception + * @param value the identifier value to search for + * @param type the type of identifier to search for + * @return a list of matching identifiers + * @throws CorbadoServerException if any server-side error occurs during retrieval */ public IdentifierList listByValueAndType( @NonNull final String value, @NonNull final IdentifierType type) @@ -121,16 +150,15 @@ public IdentifierList listByValueAndType( } /** - * Gets the identifiers matching identifier value and identifier type. + * Retrieves identifiers matching a specific value and type with pagination support. * - * @param sort the sort - * @param value the identifier value - * @param type the identifier type - * @param page the page - * @param pageSize the page size - * @return list of matching identifiers - * @throws CorbadoServerException tIf fail to call the API, e.g. server error or cannot - * deserialize the response body + * @param sort field to sort by (optional) + * @param value the identifier value to search for + * @param type the type of identifier to search for + * @param page page number (optional, defaults to 1) + * @param pageSize number of items per page (optional, defaults to 10) + * @return a list of matching identifiers with pagination information + * @throws CorbadoServerException if any server-side error occurs during retrieval */ public IdentifierList listByValueAndTypeWithPaging( @Nullable final String sort, @@ -147,17 +175,16 @@ public IdentifierList listByValueAndTypeWithPaging( } /** - * Exists by value and type. + * Checks if an identifier with the specified value and type exists. * - * @return the identifier list - * @throws ApiException the api exception - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + * @param value the identifier value to check + * @param type the type of identifier to check + * @return true if an identifier exists with the given value and type + * @throws CorbadoServerException if any server-side error occurs during the check */ public boolean existsByValueAndType( @NonNull final String value, @NonNull final IdentifierType type) throws CorbadoServerException { - final IdentifierList ret = list( null, @@ -168,20 +195,18 @@ public boolean existsByValueAndType( } /** - * List all identifiers (active and inactive) by user id with paging. + * Lists all identifiers associated with a specific user with pagination support. * * @param userID the user ID (with or without 'usr-' prefix) - * @param page the page - * @param pageSize the page size - * @return the identifier list - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + * @param page page number (optional, defaults to 1) + * @param pageSize number of items per page (optional, defaults to 10) + * @return a list of the user's identifiers with pagination information + * @throws CorbadoServerException if any server-side error occurs during retrieval */ public IdentifierList listAllByUserIdWithPaging( @NonNull String userID, @Nullable final Integer page, @Nullable final Integer pageSize) throws CorbadoServerException { - - // filter queries are using userID without prefix + // Remove prefix if present for filtering if (userID.startsWith(USER_ID_PREFIX)) { userID = userID.substring(USER_ID_PREFIX.length()); } @@ -189,15 +214,14 @@ public IdentifierList listAllByUserIdWithPaging( } /** - * List all identifiers (active and inactive) by user id and type with paging. + * Lists all identifiers of a specific type associated with a user with pagination support. * - * @param userID the user ID - * @param type the type of identifier (email, phone, username) - * @param page the page - * @param pageSize the page size - * @return the identifier list - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + * @param userID the user ID (with or without 'usr-' prefix) + * @param type the type of identifier to list + * @param page page number (optional, defaults to 1) + * @param pageSize number of items per page (optional, defaults to 10) + * @return a list of the user's identifiers of the specified type with pagination information + * @throws CorbadoServerException if any server-side error occurs during retrieval */ public IdentifierList listAllByUserIdAndTypeWithPaging( @NonNull String userID, @@ -205,8 +229,7 @@ public IdentifierList listAllByUserIdAndTypeWithPaging( @Nullable final Integer page, @Nullable final Integer pageSize) throws CorbadoServerException { - - // filter queries are using userID without prefix + // Remove prefix if present for filtering if (userID.startsWith(USER_ID_PREFIX)) { userID = userID.substring(USER_ID_PREFIX.length()); } @@ -215,12 +238,11 @@ public IdentifierList listAllByUserIdAndTypeWithPaging( } /** - * Gets list of all (active and inactive) email addresses by user id. + * Retrieves all email addresses associated with a user, handling pagination automatically. * - * @param userID the user ID - * @return the single email by user id - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + * @param userID the user ID to get email addresses for + * @return a complete list of all email addresses associated with the user + * @throws CorbadoServerException if any server-side error occurs during retrieval */ public List listAllEmailsByUserId(@NonNull final String userID) throws CorbadoServerException { @@ -229,14 +251,13 @@ public List listAllEmailsByUserId(@NonNull final String userID) listAllByUserIdAndTypeWithPaging(userID, IdentifierType.EMAIL, null, null); list.addAll(firstRes.getIdentifiers()); final Paging paging = firstRes.getPaging(); - // if there are more results unread + + // Fetch all remaining pages if they exist while (paging.getPage() < paging.getTotalPages()) { - // fetch further entries final Integer currentPage = paging.getPage(); paging.setPage(currentPage + 1); final IdentifierList temp = listAllByUserIdAndTypeWithPaging(userID, IdentifierType.EMAIL, paging.getPage(), null); - // update paging list.addAll(temp.getIdentifiers()); } @@ -244,14 +265,13 @@ public List listAllEmailsByUserId(@NonNull final String userID) } /** - * Updates a login identifier (e.g. from pending to verified) + * Updates the status of a login identifier. * - * @param userID ID of user (required) - * @param identifierID ID of login identifier (required) - * @param identifierUpdateReq (required) - * @return Identifier - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + * @param userID the ID of the user who owns the identifier + * @param identifierID the ID of the identifier to update + * @param identifierUpdateReq the update request containing the new status + * @return the updated identifier + * @throws CorbadoServerException if any server-side error occurs during the update */ public Identifier updateStatus( @NonNull final String userID, @@ -259,21 +279,20 @@ public Identifier updateStatus( @NonNull final IdentifierUpdateReq identifierUpdateReq) throws CorbadoServerException { try { - return client.identifierUpdate(userID, identifierID, identifierUpdateReq); + return this.client.identifierUpdate(userID, identifierID, identifierUpdateReq); } catch (final ApiException e) { throw new CorbadoServerException(e); } } /** - * Updates a login identifier (e.g. from pending to verified) + * Updates the status of a login identifier using a simplified interface. * - * @param userID ID of user (required) - * @param identifierID ID of login identifier (required) - * @param status IdentifierStatus (required) - * @return Identifier - * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize - * the response body + * @param userID the ID of the user who owns the identifier + * @param identifierID the ID of the identifier to update + * @param status the new status to set for the identifier + * @return the updated identifier + * @throws CorbadoServerException if any server-side error occurs during the update */ public Identifier updateStatus( @NonNull final String userID, @@ -284,16 +303,16 @@ public Identifier updateStatus( } /** - * Delete. + * Deletes a login identifier from a user's account. * - * @param userID the user ID - * @param identifierID the identifier ID - * @throws CorbadoServerException If fail to call the API or to delete the object. + * @param userID the ID of the user who owns the identifier + * @param identifierID the ID of the identifier to delete + * @throws CorbadoServerException if any server-side error occurs during deletion */ public void delete(@NonNull final String userID, @NonNull final String identifierID) throws CorbadoServerException { try { - client.identifierDelete(userID, identifierID); + this.client.identifierDelete(userID, identifierID); } catch (final ApiException e) { throw new CorbadoServerException(e); } diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java index 0a91ed5..492e179 100644 --- a/src/main/java/com/corbado/services/SessionService.java +++ b/src/main/java/com/corbado/services/SessionService.java @@ -1,88 +1,118 @@ package com.corbado.services; -import java.net.MalformedURLException; -import java.net.URL; -import java.security.interfaces.RSAPublicKey; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.lang3.StringUtils; - +import com.auth0.jwk.InvalidPublicKeyException; import com.auth0.jwk.Jwk; -import com.auth0.jwk.JwkException; import com.auth0.jwk.JwkProvider; import com.auth0.jwk.JwkProviderBuilder; import com.auth0.jwk.SigningKeyNotFoundException; import com.auth0.jwt.JWT; import com.auth0.jwt.JWTVerifier; import com.auth0.jwt.algorithms.Algorithm; -import com.auth0.jwt.exceptions.IncorrectClaimException; import com.auth0.jwt.exceptions.JWTVerificationException; +import com.auth0.jwt.exceptions.SignatureVerificationException; +import com.auth0.jwt.exceptions.TokenExpiredException; import com.auth0.jwt.interfaces.DecodedJWT; -import com.corbado.entities.SessionValidationResult; +import com.corbado.entities.UserEntity; +import com.corbado.enums.exception.ValidationErrorType; +import com.corbado.exceptions.TokenValidationException; import com.corbado.sdk.Config; import com.corbado.utils.ValidationUtils; - +import java.net.MalformedURLException; +import java.net.URL; +import java.security.interfaces.RSAPublicKey; +import java.util.concurrent.TimeUnit; import lombok.Getter; import lombok.NonNull; import lombok.Setter; +import org.apache.commons.lang3.StringUtils; /** - * This class provides functionality for managing sessions, including validation and retrieval of - * user information from short-term session tokens. + * Service class responsible for managing user sessions and validating session tokens. This class + * provides functionality to validate and extract user information from session tokens using JWT + * (JSON Web Token) verification. + * + *

The service supports: + * + *

    + *
  • JWT token validation using RSA256 algorithm + *
  • JWKS (JSON Web Key Set) integration for key management + *
  • Configurable session token length and caching + *
  • Issuer validation with support for both old and new Frontend API formats + *
  • Custom domain/CNAME support + *
+ * + *

This service is typically used in conjunction with the Corbado authentication system to manage + * user sessions and validate session tokens in a secure manner. + * + *

The service implements a robust token validation process that includes: + * + *

    + *
  • Signature verification using RSA256 + *
  • Token expiration checking + *
  • Issuer validation with backward compatibility + *
  • Comprehensive error handling with specific error types + *
+ * + * @see com.corbado.sdk.Config + * @see com.corbado.entities.UserEntity + * @see com.corbado.exceptions.TokenValidationException */ @Getter @Setter public class SessionService { - /** Number of keys that can be cached. */ + /** Maximum number of JWK keys that can be cached to optimize performance. */ private static final int JWK_CACHE_SIZE = 100; - /** The Constant DEFAULT_SESSION_LENGTH. */ + /** + * Default session token length in seconds (5 minutes). Used when no custom length is provided. + */ private static final int DEFAULT_SESSION_LENGTH = 300; - /** The short session cookie name. */ - private String shortSessionCookieName; - - /** The issuer. */ + /** The expected issuer of the JWT tokens. Can be a custom domain or CNAME. */ private String issuer; - /** The jwks uri. */ + /** URI for the JSON Web Key Set (JWKS) endpoint used to fetch public keys. */ private String jwksUri; - /** The last short session validation result. */ - private String lastShortSessionValidationResult; - - /** The jwk provider. */ + /** Provider for retrieving and caching JSON Web Keys to optimize key fetching. */ private JwkProvider jwkProvider; + /** The project ID used for issuer validation and constructing expected issuer URLs. */ + private final String projectId; + /** - * Instantiates a new session service. + * Constructs a new SessionService with the specified configuration parameters. * - * @param shortSessionCookieName the short session cookie name - * @param issuer the issuer - * @param jwksUri the jwks uri - * @param shortSessionLength the short session length - * @param cacheKeys the cache keys + * @param issuer the expected issuer of the JWT tokens + * @param jwksUri the URI for the JSON Web Key Set endpoint + * @param sessionTokenLength the length of the session token in seconds (if null, uses default) + * @param cacheKeys whether to enable JWK caching + * @param projectId the project ID used for issuer validation + * @throws IllegalArgumentException if any of the required parameters are empty or null */ public SessionService( - final String shortSessionCookieName, final String issuer, final String jwksUri, - Integer shortSessionLength, - final boolean cacheKeys) { + Integer sessionTokenLength, + final boolean cacheKeys, + final String projectId) { - ValidationUtils.validateNotEmpty(shortSessionCookieName, issuer, jwksUri); - shortSessionLength = (shortSessionLength != null) ? shortSessionLength : DEFAULT_SESSION_LENGTH; + // Validate required parameters + ValidationUtils.validateNotEmpty(issuer, jwksUri, projectId); + sessionTokenLength = (sessionTokenLength != null) ? sessionTokenLength : DEFAULT_SESSION_LENGTH; - this.shortSessionCookieName = shortSessionCookieName; this.issuer = issuer; this.jwksUri = jwksUri; + this.projectId = projectId; + // Initialize the JWK provider with optional caching JwkProviderBuilder jwkProviderBuilder; try { jwkProviderBuilder = new JwkProviderBuilder(new URL(jwksUri)); if (cacheKeys) { - jwkProviderBuilder.cached(JWK_CACHE_SIZE, shortSessionLength, TimeUnit.SECONDS); + // Configure caching with specified size and duration + jwkProviderBuilder.cached(JWK_CACHE_SIZE, sessionTokenLength, TimeUnit.SECONDS); } this.jwkProvider = jwkProviderBuilder.build(); } catch (final MalformedURLException e) { @@ -92,93 +122,155 @@ public SessionService( } /** - * Instantiates a new session service from config. + * Constructs a new SessionService using configuration from a Config object. This constructor + * provides a convenient way to initialize the service using the standard configuration format. * - * @param config the config + * @param config the configuration object containing all necessary parameters + * @throws IllegalArgumentException if any required configuration values are missing */ public SessionService(@NonNull final Config config) { this( - config.getShortSessionCookieName(), config.getIssuer(), config.getFrontendApi() + "/.well-known/jwks", - config.getShortSessionLength(), - config.isCacheKeys()); + config.getSessionTokenLength(), + config.isCacheKeys(), + config.getProjectId()); } /** - * Sets the issuer mismatch error. + * Validates a session token and extracts user information. This method performs the following + * validations: * - * @param issuer the new issuer mismatch error - */ - public void setIssuerMismatchError(final String issuer) { - this.lastShortSessionValidationResult = - String.format("Mismatch in issuer (configured: %s, JWT: %s)", this.issuer, issuer); - } - - /** - * Gets the and validate user from short session value. + *
    + *
  • Verifies the JWT signature using the appropriate public key + *
  • Validates the token expiration + *
  • Validates the token issuer + *
  • Extracts user information from the token claims + *
+ * + *

The validation process includes comprehensive error handling for various scenarios: + * + *

    + *
  • Empty or null tokens + *
  • Invalid public keys + *
  • Expired tokens + *
  • Invalid signatures + *
  • Tokens used before their valid date + *
  • General JWT verification failures + *
* - * @param shortSession the short session - * @return the and validate user from short session value - * @throws JWTVerificationException the JWT verification exception - * @throws JwkException the jwk exception - * @throws IncorrectClaimException the incorrect claim exception + * @param sessionToken the JWT token to validate + * @return a UserEntity containing the user's information + * @throws TokenValidationException if the token is invalid, expired, or has an incorrect issuer */ - private SessionValidationResult getAndValidateUserFromShortSessionValue(final String shortSession) - throws JWTVerificationException, JwkException, IncorrectClaimException { + public UserEntity validateToken(final String sessionToken) throws TokenValidationException { - if (shortSession == null || shortSession.isEmpty()) { - throw new IllegalArgumentException("Session value cannot be null or empty"); + // Validate token presence + if (sessionToken == null || sessionToken.isEmpty()) { + throw new TokenValidationException( + ValidationErrorType.CODE_EMPTY_SESSION_TOKEN, "Session token is empty"); } + DecodedJWT decodedJwt = null; try { - // Get the signing key - DecodedJWT decodedJwt = JWT.decode(shortSession); + // Decode the token to get the key ID + decodedJwt = JWT.decode(sessionToken); final Jwk jwk = this.jwkProvider.get(decodedJwt.getKeyId()); if (jwk == null) { - throw new SigningKeyNotFoundException(shortSession, null); + throw new SigningKeyNotFoundException(sessionToken, null); } final RSAPublicKey publicKey = (RSAPublicKey) jwk.getPublicKey(); - // Verify and decode the JWT using the signing key + // Verify the token signature and claims final Algorithm algorithm = Algorithm.RSA256(publicKey); - final JWTVerifier verifier = JWT.require(algorithm).withIssuer(this.issuer).build(); - decodedJwt = verifier.verify(shortSession); - - return SessionValidationResult.builder() - .fullName(decodedJwt.getClaim("name").asString()) - .userID(decodedJwt.getClaim("sub").asString()) - .build(); - - } catch (final IncorrectClaimException e) { - // Be careful of the case where issuer does not match. You have probably forgotten to set - // the cname in config class. We add an additional message to the exception and retrow it to - // underline its importance. - if (StringUtils.equals(e.getClaimName(), "iss")) { - final String message = - e.getMessage() - + "Be careful of the case where issuer does not match. " - + "You have probably forgotten to set the cname in config class."; - throw new IncorrectClaimException(message, e.getClaimName(), e.getClaimValue()); - } - throw e; + final JWTVerifier verifier = JWT.require(algorithm).build(); + decodedJwt = verifier.verify(sessionToken); + } catch (final InvalidPublicKeyException e) { + throw new TokenValidationException( + ValidationErrorType.CODE_INVALID_PUBLIC_KEY, e.getMessage(), e); + } catch (final TokenExpiredException e) { + throw new TokenValidationException(ValidationErrorType.CODE_JWT_EXPIRED, e.getMessage(), e); + + } catch (final SignatureVerificationException e) { + throw new TokenValidationException( + ValidationErrorType.CODE_JWT_INVALID_SIGNATURE, e.getMessage(), e); - } catch (final JwkException | JWTVerificationException e) { - throw e; + } catch (final JWTVerificationException e) { + // Handle specific JWT verification errors + ValidationErrorType errorType = null; + if (StringUtils.startsWith(e.getMessage(), "The Token can't be used before")) { + errorType = ValidationErrorType.CODE_JWT_BEFORE; + } else { + errorType = ValidationErrorType.CODE_INVALID_TOKEN; + } + throw new TokenValidationException( + errorType, + "JWTVerificationException exception during token validation: " + + sessionToken + + ". Detailed message: " + + e.getMessage(), + e); + } catch (final Exception e) { + // Handle unexpected errors + throw new TokenValidationException( + ValidationErrorType.CODE_INVALID_TOKEN, + "Unexpected exception during token validation: " + sessionToken, + e); } + + // Validate the token issuer + validateIssuer(decodedJwt.getClaim("iss").asString(), this.projectId); + + // Create and return user entity from token claims + return new UserEntity( + // TODO: add UserStatus + decodedJwt.getClaim("sub").asString(), null, decodedJwt.getClaim("name").asString(), null); } /** - * Retrieves userID and full name if 'shortSession' is valid. + * Validates the issuer of a JWT token. This method checks the token issuer against: + * + *
    + *
  • The old Frontend API format (without .cloud.) + *
  • The new Frontend API format (with .cloud.) + *
  • The configured issuer (for custom domains/CNAMEs) + *
+ * + *

This validation ensures backward compatibility with both old and new API formats while + * supporting custom domain configurations. * - * @param shortSession the short session - * @return the and validate current user - * @throws IncorrectClaimException the incorrect claim exception - * @throws JWTVerificationException the JWT verification exception - * @throws JwkException the jwk exception + * @param tokenIssuer the issuer from the JWT token + * @param sessionToken the session token for error reporting + * @throws TokenValidationException if the issuer is invalid or doesn't match any expected values */ - public SessionValidationResult getAndValidateCurrentUser(final String shortSession) - throws IncorrectClaimException, JWTVerificationException, JwkException { + private void validateIssuer(String tokenIssuer, String sessionToken) + throws TokenValidationException { + // Check if issuer is empty + if (tokenIssuer == null || StringUtils.isBlank(tokenIssuer)) { + throw new TokenValidationException( + ValidationErrorType.CODE_EMPTY_ISSUER, "Issuer is empty. Session token: " + sessionToken); + } - return getAndValidateUserFromShortSessionValue(shortSession); + // Check for old Frontend API format (without .cloud.) + final String expectedOld = "https://" + this.projectId + ".frontendapi.corbado.io"; + if (tokenIssuer.equals(expectedOld)) { + return; + } + + // Check for new Frontend API format (with .cloud.) + final String expectedNew = "https://" + this.projectId + ".frontendapi.cloud.corbado.io"; + if (tokenIssuer.equals(expectedNew)) { + return; + } + + // Check against the configured issuer (e.g., a custom domain or CNAME) + if (!tokenIssuer.equals(this.issuer)) { + throw new TokenValidationException( + ValidationErrorType.CODE_ISSUER_MISSMATCH, + "Issuer mismatch (configured via FrontendAPI: '" + + this.issuer + + "', JWT issuer: '" + + tokenIssuer + + "')"); + } } } diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java index ae6ea30..b92da49 100644 --- a/src/main/java/com/corbado/services/UserService.java +++ b/src/main/java/com/corbado/services/UserService.java @@ -1,9 +1,5 @@ package com.corbado.services; -import java.util.Objects; - -import javax.annotation.Nullable; - import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; import com.corbado.generated.api.UsersApi; @@ -11,29 +7,57 @@ import com.corbado.generated.model.UserCreateReq; import com.corbado.generated.model.UserStatus; import com.corbado.services.base.ApiService; - +import java.util.Objects; +import javax.annotation.Nullable; import lombok.NonNull; -/** Service for managing users. */ +/** + * Service class responsible for managing user operations in the Corbado system. This class provides + * functionality for creating and managing user accounts, including their status and authentication + * details. + * + *

The service supports: + * + *

    + *
  • User creation with custom status + *
  • WebAuthn integration for passwordless authentication + *
  • User status management + *
+ * + *

This service is typically used in conjunction with the Corbado authentication system to manage + * user accounts and their authentication methods. + * + * @see com.corbado.entities.UserEntity + * @see com.corbado.generated.model.UserStatus + * @see com.corbado.exceptions.CorbadoServerException + */ public class UserService extends ApiService { /** * Constructor for UserService. * - * @param client User API client + * @param client User API client for making requests to the Corbado backend */ public UserService(final UsersApi client) { super(client); } /** - * Create a user. + * Creates a new user in the system with the specified parameters. * - * @param fullName the full name - * @param status the status - * @param explicitWebauthnID the explicit webauthn ID - * @return the user entity - * @throws CorbadoServerException If any server-side error occurs + *

This method creates a user with: + * + *

    + *
  • A full name for display purposes + *
  • A status indicating their account state + *
  • Optional WebAuthn ID for passwordless authentication + *
+ * + * @param fullName the user's full name for display purposes + * @param status the initial status of the user account + * @param explicitWebauthnID optional WebAuthn ID for passwordless authentication + * @return the created user entity + * @throws CorbadoServerException if any server-side error occurs during user creation */ public UserEntity create( @NonNull final String fullName, @@ -54,11 +78,14 @@ public UserEntity create( } /** - * Create a user. + * Creates a new user in the system using a predefined request object. * - * @param request User create request - * @return UserCreateRsp Response - * @throws CorbadoServerException If any server-side error occurs. + *

This method allows for more flexible user creation by accepting a complete request object + * that can include additional parameters not available in the simplified create method. + * + * @param request the complete user creation request containing all necessary parameters + * @return the created user response + * @throws CorbadoServerException if any server-side error occurs during user creation */ public UserEntity create(@NonNull final UserCreateReq request) throws CorbadoServerException { Objects.requireNonNull( @@ -93,7 +120,7 @@ public UserEntity createActiveByName(@NonNull final String fullName) * Delete user. * * @param userId the user id - * @throws CorbadoServerException exception thrown on error or if user is not found + * @throws CorbadoServerException exception thrown on error or if user is not found. */ public void delete(@NonNull final String userId) throws CorbadoServerException { try { diff --git a/src/test/java/com/corbado/integration/IdentifierServiceIT.java b/src/test/java/com/corbado/integration/IdentifierServiceIT.java index f4f5c27..17b1ef3 100644 --- a/src/test/java/com/corbado/integration/IdentifierServiceIT.java +++ b/src/test/java/com/corbado/integration/IdentifierServiceIT.java @@ -6,6 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; + import com.corbado.base.AbstractSdkTest; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; @@ -18,9 +19,9 @@ import com.corbado.services.IdentifierService; import com.corbado.util.TestUtils; import java.util.List; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import lombok.extern.slf4j.Slf4j; /** The Class UserServiceIT. */ @Slf4j @@ -61,7 +62,7 @@ private void assertValidationErrorEquals( * Sets the up class. * * @throws StandardException the standard exception - * @throws CorbadoServerException + * @throws CorbadoServerException the server side error */ @BeforeAll public void setUpClass() throws StandardException, CorbadoServerException { @@ -220,7 +221,7 @@ void test_updateIdentifier_ExpectSuccess() /** * Test list all emails by user id expect success. * - * @throws CorbadoServerException + * @throws CorbadoServerException the server side error */ @Test void test_listAllEmailsByUserId_expectSuccess() throws CorbadoServerException { diff --git a/src/test/java/com/corbado/integration/UserServiceIT.java b/src/test/java/com/corbado/integration/UserServiceIT.java index 989ef09..ebd046a 100644 --- a/src/test/java/com/corbado/integration/UserServiceIT.java +++ b/src/test/java/com/corbado/integration/UserServiceIT.java @@ -3,6 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; + import com.corbado.base.AbstractSdkTest; import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; @@ -36,9 +37,9 @@ void test_InstantiateSdk_ExpectNotNull() { } /** - * Test case for user creation with validation error. * + * Test case for user creation with validation error. * - * @throws CorbadoServerException + * @throws CorbadoServerException the standard exception */ @Test void test_UserCreateBlankName_ExpectSuccess() throws CorbadoServerException { @@ -72,7 +73,7 @@ void test_UserGet_ExpectNotFound() { assertThrows( CorbadoServerException.class, () -> { - final UserEntity ret = this.fixture.get("usr-1234567890"); + this.fixture.get("usr-1234567890"); }); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); @@ -113,7 +114,7 @@ void test_Delete_ExpectUserWillNotBeFound() throws CorbadoServerException, Stand assertThrows( CorbadoServerException.class, () -> { - final UserEntity ret = this.fixture.get(user.getUserID()); + this.fixture.get(user.getUserID()); }); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); diff --git a/src/test/java/com/corbado/unit/SessionServiceTest.java b/src/test/java/com/corbado/unit/SessionServiceTest.java index b6dc2bd..64572f1 100644 --- a/src/test/java/com/corbado/unit/SessionServiceTest.java +++ b/src/test/java/com/corbado/unit/SessionServiceTest.java @@ -6,6 +6,22 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.anyString; +import com.auth0.jwk.Jwk; +import com.auth0.jwk.JwkException; +import com.auth0.jwk.JwkProvider; +import com.auth0.jwt.JWT; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.IncorrectClaimException; +import com.auth0.jwt.exceptions.JWTVerificationException; +import com.corbado.entities.UserEntity; +import com.corbado.enums.exception.ValidationErrorType; +import com.corbado.exceptions.StandardException; +import com.corbado.exceptions.TokenValidationException; +import com.corbado.services.SessionService; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonSyntaxException; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; @@ -24,7 +40,6 @@ import java.util.List; import java.util.Map; import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -36,31 +51,18 @@ import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; -import com.auth0.jwk.Jwk; -import com.auth0.jwk.JwkException; -import com.auth0.jwk.JwkProvider; -import com.auth0.jwk.SigningKeyNotFoundException; -import com.auth0.jwt.JWT; -import com.auth0.jwt.algorithms.Algorithm; -import com.auth0.jwt.exceptions.IncorrectClaimException; -import com.auth0.jwt.exceptions.JWTDecodeException; -import com.auth0.jwt.exceptions.JWTVerificationException; -import com.auth0.jwt.exceptions.TokenExpiredException; -import com.corbado.entities.SessionValidationResult; -import com.corbado.exceptions.StandardException; -import com.corbado.services.SessionService; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonSyntaxException; - /** Unit Test for session service. */ @ExtendWith(MockitoExtension.class) public class SessionServiceTest { + private static final String TEST_PROJECT_ID = "pro-55"; + /** The Constant PRIVATE_KEY_PATH. */ private static final String PRIVATE_KEY_PATH = "src/test/java/com/corbado/unit/data/rsakey.pem"; + private static final String INVALID_PRIVATE_KEY_PATH = + "src/test/java/com/corbado/unit/data/invalidRsaKey.pem"; + /** The Constant JWKS_PATH. */ private static final String JWKS_PATH = "src/test/java/com/corbado/unit/data/jwks.json"; @@ -88,6 +90,8 @@ public class SessionServiceTest { /** The private key. */ private static RSAPrivateKey privateKey; + private static RSAPrivateKey invalidPrivateKey; + // ------------------ Set up --------------------- // /** @@ -104,6 +108,7 @@ public static void setUpClass() sessionService = createSessionService(); jwks = readJwks(); privateKey = readPrivateKey(PRIVATE_KEY_PATH); + invalidPrivateKey = readPrivateKey(INVALID_PRIVATE_KEY_PATH); } /** @@ -143,7 +148,7 @@ void test_testDataIsPresent() throws InvalidKeySpecException, NoSuchAlgorithmExc */ @Test void test_testGenerateJwt() throws InvalidKeySpecException, NoSuchAlgorithmException { - assertNotNull(generateJwt("1", 3, 4)); + assertNotNull(generateJwt("1", 3, 4, privateKey)); } /** @@ -151,25 +156,20 @@ void test_testGenerateJwt() throws InvalidKeySpecException, NoSuchAlgorithmExcep * * @param issuer the issuer * @param jwksUri the jwks uri - * @param shortSessionCookieName the short session cookie name * @param expectValid the expect valid */ @ParameterizedTest @MethodSource("initParametersTestData") void testInitParametersValidation( - final String issuer, - final String jwksUri, - final String shortSessionCookieName, - final boolean expectValid) { + final String issuer, final String jwksUri, final boolean expectValid) { if (expectValid) { // No exception should be raised - assertDoesNotThrow( - () -> new SessionService(shortSessionCookieName, issuer, jwksUri, 0, false)); + assertDoesNotThrow(() -> new SessionService(issuer, jwksUri, 0, false, TEST_PROJECT_ID)); } else { // ValidationError should be raised assertThrows( IllegalArgumentException.class, - () -> new SessionService(shortSessionCookieName, issuer, jwksUri, 0, false)); + () -> new SessionService(issuer, jwksUri, 0, false, TEST_PROJECT_ID)); } } @@ -186,14 +186,20 @@ void testInitParametersValidation( */ @ParameterizedTest @MethodSource("provideJwts") - void test_getCurrentUser(final String jwt, Class e) - throws StandardException, IncorrectClaimException, JWTVerificationException, JwkException { - - if (e != null) { - assertThrows(e, () -> sessionService.getAndValidateCurrentUser(jwt)); + // In all tests SessionService is configured with frontendAPI=https://auth.acme.com + void test_getCurrentUser( + final String jwt, + final Class expectedException, + ValidationErrorType expectedValidationErrorType) { + + if (expectedException != null) { + final TokenValidationException exception = + assertThrows(expectedException, () -> sessionService.validateToken(jwt)); + if (expectedValidationErrorType != null || exception.getErrorType() != null) { + assertEquals(expectedValidationErrorType, exception.getErrorType()); + } } else { - final SessionValidationResult validationResult = - sessionService.getAndValidateCurrentUser(jwt); + final UserEntity validationResult = sessionService.validateToken(jwt); assertEquals(TEST_NAME, validationResult.getFullName()); assertEquals(TEST_USER_ID, validationResult.getUserID()); } @@ -209,13 +215,11 @@ void test_getCurrentUser(final String jwt, Class e) static Stream initParametersTestData() { return Stream.of( // Valid session service - new Object[] {"s", "2", "name", true}, + new Object[] {"s", "2", true}, // Test empty issuer - new Object[] {"", "2", "name", false}, + new Object[] {"", "2", false}, // Test empty jwks_uri - new Object[] {"s", "", "name", false}, - // Test empty short_session_cookie_name - new Object[] {"s", "2", "", false}); + new Object[] {"s", "", false}); } /** @@ -228,23 +232,32 @@ static Stream initParametersTestData() { static List provideJwts() throws InvalidKeySpecException, NoSuchAlgorithmException { final List testData = new ArrayList<>(); - // JWT with invalid format - testData.add(new Object[] {"invalid", JWTDecodeException.class}); - // JWT signed with wrong algorithm (HS256 instead of RS256) final String jwtWithWrongAlgorithm = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik" + "pvaG4gRG9lIiwiYWRtaW4iOnRydWV9.dyt0CoTl4WoVjAHI9Q_CwSKhl6d_9rhM3NrXuJttkao"; - testData.add(new Object[] {jwtWithWrongAlgorithm, SigningKeyNotFoundException.class}); + testData.add( + new Object[] { + jwtWithWrongAlgorithm, + TokenValidationException.class, + ValidationErrorType.CODE_INVALID_TOKEN + }); + // Empty JWT + testData.add( + new Object[] { + "", TokenValidationException.class, ValidationErrorType.CODE_EMPTY_SESSION_TOKEN + }); // Not before (nbf) in future testData.add( new Object[] { generateJwt( "https://auth.acme.com", System.currentTimeMillis() / 1000 + 100, - System.currentTimeMillis() / 1000 + 100), - IncorrectClaimException.class + System.currentTimeMillis() / 1000 + 100, + privateKey), + TokenValidationException.class, + ValidationErrorType.CODE_JWT_BEFORE }); // Expired (exp) @@ -253,8 +266,10 @@ static List provideJwts() throws InvalidKeySpecException, NoSuchAlgori generateJwt( "https://auth.acme.com", System.currentTimeMillis() / 1000 - 100, - System.currentTimeMillis() / 1000 - 100), - TokenExpiredException.class + System.currentTimeMillis() / 1000 - 100, + privateKey), + TokenValidationException.class, + ValidationErrorType.CODE_JWT_EXPIRED }); // Invalid issuer (iss) @@ -263,19 +278,78 @@ static List provideJwts() throws InvalidKeySpecException, NoSuchAlgori generateJwt( "https://invalid.com", System.currentTimeMillis() / 1000 + 100, - System.currentTimeMillis() / 1000 - 100), - IncorrectClaimException.class + System.currentTimeMillis() / 1000 - 100, + privateKey), + TokenValidationException.class, + ValidationErrorType.CODE_ISSUER_MISSMATCH }); - - // Success + // Wrong private key testData.add( new Object[] { generateJwt( "https://auth.acme.com", System.currentTimeMillis() / 1000 + 100, - System.currentTimeMillis() / 1000 - 100), + System.currentTimeMillis() / 1000 - 100, + invalidPrivateKey), + TokenValidationException.class, + ValidationErrorType.CODE_JWT_INVALID_SIGNATURE + }); + // Success with cname + testData.add( + new Object[] { + generateJwt( + "https://auth.acme.com", + System.currentTimeMillis() / 1000 + 100, + System.currentTimeMillis() / 1000 - 100, + privateKey), + null, + ValidationErrorType.CODE_JWT_INVALID_SIGNATURE + }); + // Empty issuer + testData.add( + new Object[] { + generateJwt( + "", + System.currentTimeMillis() / 1000 + 100, + System.currentTimeMillis() / 1000 - 100, + privateKey), + TokenValidationException.class, + ValidationErrorType.CODE_EMPTY_ISSUER + }); + // "Success with new Frontend API URL in JWT", + testData.add( + new Object[] { + generateJwt( + "https://" + TEST_PROJECT_ID + ".frontendapi.cloud.corbado.io", + System.currentTimeMillis() / 1000 + 100, + System.currentTimeMillis() / 1000 - 100, + privateKey), + null, null }); + // "Success with old Frontend API URL in JWT", + testData.add( + new Object[] { + generateJwt( + "https://" + TEST_PROJECT_ID + ".frontendapi.corbado.io", + System.currentTimeMillis() / 1000 + 100, + System.currentTimeMillis() / 1000 - 100, + privateKey), + null, + null + }); + + // "Wrong project id", + testData.add( + new Object[] { + generateJwt( + "https://" + "pro-1" + ".frontendapi.corbado.io", + System.currentTimeMillis() / 1000 + 100, + System.currentTimeMillis() / 1000 - 100, + privateKey), + TokenValidationException.class, + ValidationErrorType.CODE_ISSUER_MISSMATCH + }); return testData; } @@ -317,7 +391,8 @@ private static RSAPrivateKey readPrivateKey(final String privateKeyPath) * @throws InvalidKeySpecException the invalid key spec exception * @throws NoSuchAlgorithmException the no such algorithm exception */ - private static String generateJwt(final String iss, final long exp, final long nbf) + private static String generateJwt( + final String iss, final long exp, final long nbf, RSAPrivateKey privateKey) throws InvalidKeySpecException, NoSuchAlgorithmException { final Algorithm algorithm = Algorithm.RSA256(privateKey); @@ -340,11 +415,11 @@ private static String generateJwt(final String iss, final long exp, final long n */ private static SessionService createSessionService() { return new SessionService( - "cbo_short_session", "https://auth.acme.com", "https://example_uri.com", 10, - false); // URLs do not matter, url access is mocked + false, + TEST_PROJECT_ID); // URLs do not matter, url access is mocked } /** diff --git a/src/test/java/com/corbado/unit/data/invalidRsaKey.pem b/src/test/java/com/corbado/unit/data/invalidRsaKey.pem new file mode 100644 index 0000000..82985fa --- /dev/null +++ b/src/test/java/com/corbado/unit/data/invalidRsaKey.pem @@ -0,0 +1,29 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDLz6W6oWFh92+W +Sv59SZGx6M7vqjToarfMLR328mCgmZCkijiBf5h63LuT+YQMzGZQylamK199cU6r +HE/gtGxuroenICY9HyxLwrEqiycBJXO1ndD5cZMy7d9iQn5ibQiC7wIcnoFwAqYA +j71mW0QnAWOCXXrGVPZOn5lPBg/+Gv/jG9eOhKHptxPNVeznxe5p7RIJWGlKszyo +co71WgVrzi9CQXWFdy5WKUgq81Dn6B3Id5vfJE/zDaa64eMS69HumMWuOqK7UXXd +zidUz0IfJ/FqfSrQL+6N3x0RHm00VHHCV5qnszhoVo982y3lddihJfQ2/APL2qf7 +679eRbWLAgMBAAECggEAX4wlYe0uPkNF6OuXixzmVMWT3f+pdhwxtmKgXZkbe68C +hGDYRL2Qumio96JOKcHZZZ62KIjE54YrH0TSncF35BumNM95ncXzekD31b4Otxbb +vBUUVxzLqWCjDOmnXnVHPDrYfppAjEZxlGnOnSHEPZUFFaTFXh2OqyVfNhDdhn5D +OWSVXFRutOXf6vMjFJzxXde/clMDS0FgzcVYW7ojPTsSJK65q279wbtXNrCie0Ws +s78hmx9PUx2VHfUVvA2VZhVJbjmhS/ThUgT7asjUXGp1Rg1zz6Q98MOU3Vcn4hoa +JZGV7Zi+FQTGN7/mJRQwv2+RR4hsAxwyP9wPJ2gyIQKBgQDVoUUFfdBEnW9q3/vN +qSyfOb7GnmfO+ZgfODWoL4BHW+/I74a8m04hWEv+shhvBL4jtxCto9UQS5WBAybP +NOb2/jqm8WGqWu1n2k3pNX4K0d/mEXh/KNoc+KbaSv1ze5KPWXpPzUably8WdPNB +u1gSmDLFW6UboOGDG7cRRQMSdwKBgQD0O9duTdCirYdx3Fy0bVv3rSfAWhaVmTlp +GjKm1sLJkNUsO5eB3ts3tqGWPsOK1TKkgCfcYcN604XPbsng1MJaDvmA/uFOc7yh +79naNDZkr4MFxwxBBmwizBmVp8ycDoeXBa34K7mJ3xhhkBqZoj90NyQrsrJ/r3RI +iZCCebhGjQKBgQC5BQt6ThTq2E9/CK5U2IhE/wYzj03o/FK79zrBhyJaq01pgcn3 +36ozRv3KgQSYYksrM4nGWXZWvp+lNM2P+AlxMY4quDQWDto+b9u6dxHK3SpFYCw0 +NXVyUghwVzJbqlKsxJoiM29LogyuLmvgKhmFQTv3of/FhfjKTF6pHlQi0QKBgQDg +fWy8T7w4+0XnC4UOtwJ0uu0x6dyebzOM/u6V2gs7GOxIdxIA5qYbJLyMDG7SWrrs +53s8H4R9jpWNIClhhk6KVv9RaXYRFWLKeluFLL7ed1D4a4hA8LVOmsndfFofC1/o +GelZll85ch3H95vroW2v1ctieyOFJ/G7hu6Ub2tJNQKBgHnZgHq3QylHTZHkokeP +58HEE80ZEqqMEaMsVlkKw8e9Z7/BklTOFRdBWQFjRDTiLOnI0VXRD2M170VFP+7J +Jdqz5P2EUeO4dxG/EyXLmA/ef3xQG1Kf7U6nbBSMAfRlnp4lt+wBLPXpiRGXM5u5 +KGtqwJa1GYP/6zTAET5UPVEE +-----END PRIVATE KEY----- + diff --git a/src/test/java/com/corbado/util/TestUtils.java b/src/test/java/com/corbado/util/TestUtils.java index a897091..1d6e4e4 100644 --- a/src/test/java/com/corbado/util/TestUtils.java +++ b/src/test/java/com/corbado/util/TestUtils.java @@ -1,9 +1,5 @@ package com.corbado.util; -import java.util.Random; - -import org.apache.commons.lang3.StringUtils; - import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; @@ -11,8 +7,9 @@ import com.corbado.generated.model.UserStatus; import com.corbado.sdk.Config; import com.corbado.sdk.CorbadoSdk; - import io.github.cdimascio.dotenv.Dotenv; +import java.util.Random; +import org.apache.commons.lang3.StringUtils; /** The Class TestUtils. */ public class TestUtils { @@ -26,6 +23,9 @@ public class TestUtils { /** The Constant CORBADO_BACKEND_API. */ public static final String CORBADO_BACKEND_API = "CORBADO_BACKEND_API"; + /** The Constant CORBADO_FRONTEND_API. */ + public static final String CORBADO_FRONTEND_API = "CORBADO_FRONTEND_API"; + /** The Constant CANNOT_BE_BLANK_MESSAGE. */ public static final String CANNOT_BE_BLANK_MESSAGE = "cannot be blank"; @@ -120,13 +120,19 @@ public static CorbadoSdk instantiateSDK() throws StandardException { if (StringUtils.isEmpty(backendApi)) { backendApi = dotenv.get(CORBADO_BACKEND_API); } - Config config = null; - if (StringUtils.isEmpty(backendApi)) { - config = Config.builder().apiSecret(apiSecret).projectId(projectId).build(); - } else { - config = - Config.builder().apiSecret(apiSecret).projectId(projectId).backendApi(backendApi).build(); + + // Check for CORBADO_BACKEND_API + String frontendApi = System.getenv(CORBADO_FRONTEND_API); + if (StringUtils.isEmpty(frontendApi)) { + frontendApi = dotenv.get(CORBADO_FRONTEND_API); } + final Config config = + Config.builder() + .apiSecret(apiSecret) + .projectId(projectId) + .backendApi(backendApi) + .frontendApi(frontendApi) + .build(); return new CorbadoSdk(config); }